| ▲ | yetihehe a day ago |
| It doesn't. It's "promise" based, not "communicating sequential processes". Erlang has more preemptive scheduling, a "thread" can be preempted at any time, here you can only be synchronized when you wait for result. It is called "actor-based", because only functions tagged as "actor" can call waiting functions. This is more node.js-like communication than erlang. |
|
| ▲ | jacquesm 21 hours ago | parent | next [-] |
| By they looks of it they changed the word 'async' to 'actor' because they thought it was cool not because it actually uses the actor pattern. Which to me seems to be namespace pollution. |
| |
| ▲ | voidmain 21 hours ago | parent | next [-] | | If I were designing it today rather than in... 2008?, I would use the terms 'async' and 'await' because they are a lingua franca now. And for a modern audience that already knows what promises are it probably makes sense to start the explanation with that part. But the thing as a whole was intended to build lightweight asynchronously communicating sequential processes with private state that can be run locally or in a distributed way transparently, restarted on failure, etc. I don't think the choice of terms was obviously a crime at the time. | |
| ▲ | junon 21 hours ago | parent | prev [-] | | Unfounded guess, they probably didn't want to bump into the new C++ keywords for async/await. |
|
|
| ▲ | thesz 16 hours ago | parent | prev [-] |
| They build channels on top of these "promises" and "futures" and this made them square into communicating sequential processes category. Also, you can look at promise-future pair as a single-element channel, again, it's CSP. BTW, Erlang does not implement CSP fully. Its' interprocess communication is TCP based in general case and because of this is faulty. |
| |
| ▲ | yetihehe 4 hours ago | parent [-] | | It is not TCP based. In Erlang processes have mailboxes. But they don't have promises, you send a message and wait for response with timeout or do something else. And TCP is only used between nodes (vm instances). But you can use any communication channel (UDP, unix sockets, tls, serial port, some other process doing funny things). > Its' interprocess communication is TCP based in general case and because of this is faulty. What? It's faulty because of TCP? No, in Erlang it is assumed that communication can be faulty for a lot of reasons, so you have to program to deal with that and the standard library gives you tools to deal with this. |
|