2017-02-01

ufm: (Default)
Пока у хабзиллы я вижу только одну проблему. Впрочем - эта проблема есть и у диаспорты. В случае миграции с сервера на сервер меняеться "имя", так как оно привязано к серверу. Я могу сейчас сделать експорт всего своего небольшого блога на своём сервере и перенести его на hubzilla.site, например. Но тогда у меня сменится имя с ufm@ufm.su на uufmm@hubzilla.site (я там под таким именем зарегестрировался для тестирования межсерверного взаимодействия).
Почему для id пользователя небыло введено какое нибудь 128 число, к которому уже можно привязать любое имя - непонятно.
"Хоть сама ложись". Останавливает только то, что реально - это никому не нужно. Все любят ругать мордокнигу и жж, но продолжают ими пользоваться.

pony

2017-02-01 22:08
ufm: (Default)
Читаю документация на pony. Пока нравится.
ufm: (Default)
if a > b then
  env.out.print("a is bigger")
end

Can I use integers and pointers for the condition like I can in C? No. In Pony if conditions must have type Bool, i.e. they are always true or false. If you want to test whether a number a is not 0, then you need to explicitly say a != 0. This restriction removes a whole category of potential bugs from Pony programs.


Вот есть же у кого-то мозг. А еще прикольно:

1 + 2 * 3
We will get a value of 9 if we evaluate the addition first and 7 if we evaluate the multiplication first. In mathematics there are rules about the order in which to evaluate operators and most programming languages follow this approach.

The problem with this is that the programmer has to remember the order and people aren't very good at things like that. Most people will remember to do multiplication before addition, but what about left bit shifting versus bitwise and? Sometimes people misremember (or guess wrong) and that leads to bugs. Worse, those bugs are often very hard to spot.

Pony takes a different approach and outlaws infix precedence. Any expression where more than one infix operator is used must use parentheses to remove the ambiguity. If you fail to do this the compiler will complain.
This means that the example above is illegal in Pony and should be rewritten as:
1 + (2 * 3)
Repeated use of a single operator however is fine:
1 + 2 + 3


#ponylang #programming #software