2 ms·
To me the most important aspect of Erlang is the runtime's scheduler, which is preemptive instead of cooperative. This allows the message passing, sequential co
by LtdJorge 2y ago
To me the most important aspect of Erlang is the runtime's scheduler, which is preemptive instead of cooperative. This allows the message passing, sequential code and lightweight processes to be much more effective than in any other general language or framework using cooperative scheduling (like async runtimes or coroutines in Rust, .Net, Kotlin, Lua).
You can write actually synchronous code in Erlang and the runtime makes it so that no process blocks any other process by preempting them on a schedule.
- assbuttbuttass 2y agoSounds a lot like Go
- LtdJorge 2y agoYes, goroutines are preemptive, too. And they took a lot of inspiration from Erlang and the BEAM when they designed goroutines and channels. In Go you manage your goroutines and channels explicitly, while the BEAM runs all processes for you, and I've seen Robert Virding run an infinite loop in one Erlang process while the rest were serving requests, the core with the loop stayed at 100% but 0 requests were dropped and the latency and throughput was more or less the same, pretty crazy capabilities. You can do the same in Go but it's a lot more manual.