3 ms·
> NodeJS really does solve the problem around the "many simultaneously persistent connections", something that would be really hard to do without something like
by bschwindHN 8y ago
> NodeJS really does solve the problem around the "many simultaneously persistent connections", something that would be really hard to do without something like NodeJS
What part of it is really hard to do without NodeJS? You can do this easily in Go, Elixir, C++, Rust, etc.
- pjmlp 8y agoJavaScript everywhere mentality?
- aphexairlines 8y agoThe nice thing about Node.js's design is that (almost) all IO is non-blocking by design, so developers can't block their programs on IO by accident. In other platforms developers need discipline to choose non-blocking APIs over blocking ones, or to wrap their blocking calls in async execution contexts like threads or coroutines.
- bschwindHN 8y agoI'm just disagreeing that it's "really hard" for languages besides JavaScript. Concurrency in Go is stupid easy, it's built into the language. Pretty sure Elixir is the same story. C++ and Rust are slightly more difficult but still nowhere near "really hard" when it comes to making a socket server that can serve hundreds of thousands. Here's a nice WebSocket server in C++: https://github.com/uNetworking/uWebSockets/blob/master/README.md https://github.com/uNetworking/uWebSockets/blob/master/READM...
- Rapzid 8y agoAll the "sync" commands are blocking. In my experience developers need discipline to avoid using those and blocking the whole app. Of the languages mentioned I believe Go is actually closest to all io being non blocking by default; with the caveat that you are using multiple go routines.