Joe Armstrong on Elixir (2018)
elixirforum.com
elixirforum.com
Especially, erlang seems like the only environment where the concurrency model has such a big implication on how you build your whole system ( as opposed to just letting the framework spawn actors underneath without you even noticing, like i’ve seen in some recent dart web framework)
For example in swift, chris lattner set actor as a long term goal for concurrency, but async seems to be going to be implemented first ( probably for very good practical reasons). Yet the way erlang does it seems to be so core to its design that i’m very skeptical we’ll reach something similar.
It actually has been replicated successfully in modern multiuser operating systems. You can safely restart your web server process while the cron service or your DB stays up. One user's shell crash doesn't take down all the other ones.
The power of BEAM VM is making it possible to start millions of such processes on a machine.
There have been many instances of anyone starting a bunch of threads with some message queues and calling it "a modern super-fast Erlang" but it's just solving the wrong problem.
The concurrency model is based on the event loop: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Even...
let count = 0 ; while (count < 1000000000) { count += 1 }
Counting from 1 to a billion will block any other operation from happening. In Elixir, that's not the case. Or am missing something?
I buy the "what color is your function?" argument: http://journal.stuffwithstuff.com/2015/02/01/what-color-is-y...
If you look at Python, it has spawned sort of a parallel standard library / language around async/await. For example, as of Python 3.7 contextlib apparently has an AsyncContextManager ("with"). There are async versions of the "itertools" module floating around.
Although, Go is more like Erlang in that it doesn't suffer from this problem.
But Python and JS are two of the most popular languages in the world, so I guess that means async/await "won" ?
Having only followed the discussion about concurrency on the swift language, it seems async/await is clearly more straightforward to implement starting from a regular C-stack like compiled language, than an erlang-like system with its VM looking a lot like an OS of its own.
Abour Rust, i've seen a few actor-based frameworks, and i'm really putting a lot of hope in this language, since it seems to have both the taste for high-level & hard to implement features, and the community that goes with it. Unfortunately, here too i think the core language team needs to be heavily involved for this pattern to succeed.
In the meantime, i think i've got no other choice than to start using elixir+OTP or erlang+OTP.
He wrote really functional elixir, and you could tell he commanded expertise rarely seen. To have such a senior engineer spend his time teaching beginners, it was really inspiring. He'll be sorely missed by everybody in the Elixir community.
EDIT: To give some more context... I'm thinking about software systems that must interact with the real world (eg: robotics) where it is very hard to give guarantees that a certain action would necessarily have the desired effect. Also, it is very common for agents to function with an incomplete model of the world (which essentially encodes their assumptions on how the world ought to respond to their actions) and keep adapting their responses and changing their model based on observations. (BTW, thinking along these lines lead to an approach called behavior-based robotics)
Think of how operating system process work. You can restart a small group out of 1 million and have confidence the rest are not affected. That is a powerful and awesome ability.
Imagine you have a million threads all sharing the same data structures with complicated barriers, locks, mutexes, and condition variables. Some subset of them crash, can you confidently restart just those threads? Usually no, because they could have scribble on the memory that other threads will use, or might be holding some lock and such.
In operating systems terminology it's like when your calculator app crashed and it took down your word processor as well in Windows 3.1 days.
The part I love about Elixir is the "objects" don't have to send a message back! There's no need for the sender to sit around waiting for a reply.