3 ms·
> I challenge you to come up with something it does that isn't done far better in another ecosystem. A single, standard event loop that literally every library
by geofft 10y ago
> I challenge you to come up with something it does that isn't done far better in another ecosystem.
A single, standard event loop that literally every library in the ecosystem uses so you don't have to worry about it.
The other options are compiled languages (Windows message pump, Qt or GTK+ event loop, etc.), which aren't what people seem to want for Node's use case, or things like Twisted. For all of those options other than maybe Windows, you don't get to assume that the entire ecosystem speaks the same event loop protocol. And I don't think any of these options do it far better than Node does. Twisted is pretty good, probably a little better, but Node is just fine too.
Note that I am not a Node.js programmer. I can kind of work with existing apps in Node because I can kind of write JS sometimes (I'm really more of a C person). I just know what other technologies are good at.
- PeCaN 10y ago> A single, standard event loop that literally every library in the ecosystem uses so you don't have to worry about it. Tcl? Erlang/OTP?
- imagist 10y ago> A single, standard event loop that literally every library in the ecosystem uses so you don't have to worry about it. Using an event loop with all the other threading models available out there is like bringing a knife to a gunfight. I could maybe argue that JavaScript's event loop isn't as good as other event loops, but while actor models exist, I'm not sure why we'd even talk about event loops.
- geofft 10y agoActor models don't solve the problem of getting a good-sized ecosystem going. If you have production-ready actor-model libraries for all the random things I might want to connect to, great, but I'm not currently aware of such things existing. (Maybe that's a failure of listening on my part!) If you want to develop that ecosystem, awesome, and I totally support that. But I would much rather bring a knife to a gunfight than some totally awesome, straight-from-the-laboratory gun that's never been tested in combat.
- imagist 10y ago> If you have production-ready actor-model libraries for all the random things I might want to connect to, great, but I'm not currently aware of such things existing. If you have production-ready event loop libraries for all the random things I might want to connect to, great, but I'm not currently aware of such things existing. Part of the problem with the Node ecosystem is that the bar for "production ready" is very, very low. For example, literally nothing in NPM is production ready where security matters, because the package system is fundamentally insecure. left-pad broke builds everywhere--what if instead of failing to download, it introduced a backdoor? And even if you assume all the randos who maintain NPM packages are trustworthy, there's no signature verification on code, so any of them could have their accounts compromised and there would be no way to tell. This is the code you want me to run on my server? Really? Node has a large ecosystem, but the subset of Node's ecosystem which is actually quality software is quite small. > But I would much rather bring a knife to a gunfight than some totally awesome, straight-from-the-laboratory gun that's never been tested in combat. Me too, but I'm exceedingly surprised to hear you quote this as a positive of Node.
- geofft 10y agoI am not really familiar with how to deploy Node in production, having never done so, but aren't there relatively easy ways to mirror NPM locally? Or can't you just check node_modules into version control (possibly a separate branch or something)? Honestly if I had to deploy Node in production I'd be inclined to see if I can just use those Node libraries that are packaged for Debian. I do the same thing for deploying Python, Perl, C, etc. in production.