Re:We 30x'd our Node parallelism
by james-mcelwain on Friday December 13, 2019 @11:13AM
(#21782827)
Are you seriously arguing against event loops as a category? Blocking in non-blocking code is going to be an issue whether the language is C or JavaScript (duh).
[ Parent
| on HN ]
For these kinds of programming, yes, I argue against it. A single stalling function in Node deadlocks the whole system; a single stalling thread in the C++ model still permits other threads to run. This is a risk that is completely avoidable by not using languages which require event loops at their core.
JavaScript doesn't require event loop design. You can do a PHP like backend design with JS, where each request is handled by a fresh process, and all JS functions block. There's nothing in the language that prevents this.
Some features would become unusable, like Promises and async/await, but those would be worthless in such a design anyway.
Nobody does it. Nobody implemented it yet. Nobody made it production ready. That is what a few minutes of googling gave me.
As much as I'd like to see it, your JS without an event loop is a purely theoretical construct so far.
I did blocking design using Duktape for my runtime Linux distro reinstallation tool and some other projects. It works fine and it's easier than implementing async aware bindings.
I wouldn't implement it for the HTTP server/backend use case, because I find the blocking/share nothing architecture of PHP limiting.
The point is the language doesn't prevent this kind of architecture.