3 ms·
> It also enables event driven programming through tokio, which is a better fit for web servers than green threads (you're mostly waiting on the network) This
by jeremyjh 8y ago
> It also enables event driven programming through tokio, which is a better fit for web servers than green threads (you're mostly waiting on the network)
This is a really strange thing to say. Erlang is still an event-driven I/O runtime, it just doesn't inflict the user with the burden of continuation passing like tokio does. What is the benefit of doing that yourself? Even with futures its far more verbose and awkward than it needs to be. And since the entire ecosystem is not built on this io system, you will always be finding libraries - even very popular ones, such as diesel - that are incompatible with it and forcing you into threadpools. Every library in use with BEAM uses async I/O in exactly the same way.
- ilovecaching 8y agoThis is an implementation detail that you have no control over. From the point of a view of a process, io is synchronous. This is very limiting. It's better to keep decisions of concurrency in libraries rather than bake it into the language.
- jeremyjh 8y agoCan you elaborate on the limits this imposes? What is it that you can do with direct access to an event loop that you cannot do in Erlang?
- deleted 8y ago[deleted]