|
|
|
|
|
by jerf
5813 days ago
|
|
"With coroutines you have to worry about IO all over the place and have to make your functions coroutine safe and Ryan Dahl," No, no, a thousand times no. Node.js partisans really need to start actually using Erlang or Haskell for a little while before spouting this canned line off. You do not have to jump through enormous hoops to deal with IO in Haskell or Erlang, it just works. Callbacks are behind the state of the art. Coroutines or generators or any other cooperative-multitasking primitives in languages that didn't support them from day one and have enormous sets of libraries not "cooperative-aware" are behind the state of the art, too. This is all just "cooperative multithreading" again and I am yet to see anyone explain why this time is going to turn out any different than last time we tried cooperative multithreading. |
|
The actual cutting edge of event-driven server architecture[1] looks something like this:
(And even then it has marginal benefits in terms of throughput and latency compared to threaded implementations.)[1] Li and Zdancewic. Combining events and threads for scalable network services. Proc. 2007 PLDI (2007).