Hacker News new | ask | show | jobs
by knrz 2225 days ago
Also one of my favourite points about Elixir/Erlang — having no distinctions between async/await makes programming flow better.
1 comments

That's the benefit of integrating async in the runtime itself. It abstracts it from the language, which doesn't have to know about it. Just like a GC abstract memory handling.
Right. Even POSIX.1 has the same "messaging" functionality, so:

* spawn/1 becomes fork()

* send/2 becomes kill()

* receive F -> ... G -> ... end becomes sigaddset(&s,F);sigaddset(&s,G);sigwait(&s,&r)

There are of course other issues, like there aren't that many signals, or that memory management is hard, or whatever, but these are solved by other languages as well, so you can imagine this is at least straightforward to implement.

The downside is that it means you can have functions that you can't write. That can be a big bummer to a lisp programmer, but I don't think python, javascript, etc, programmers care about that, so I think history will judge the trend to colour functions as lazy and shortsighted.