Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To be fair, Erlang escaped from the lab in 1988, and only supported SMP in 2006. Node.js was released in 2009, it's only had 6 years, maybe it's still a bit early for SMP?


You can use SMP just fine in Node.js today with https://nodejs.org/api/cluster.html.

The problem with Node.js and concurrency is that everything depends on trusting code to be perfectly written, and that perfectly written code must be written in a naturally confusing callback style that is really easy to screw up.

If you do it perfectly, then you get great scalability. But one bonehead mistake will ruin your concurrency. By contrast with a pre-emptive model you get decent scalability really easily, but now you've got a million and one possible race conditions that are hard to reason about.

This is not a new design tradeoff. Go back to the days of Windows 3.1 or the old MacOS versions below OS X. They all used cooperative multi-tasking, just like Node.js. Today what do we have? Pre-emptive multi-tasking in Windows, OS X, *nix and iOS.

Web development has actually gone back to a model that operating systems abandoned long ago. As long as your app is small, there is a chance that it will work. But as your app grows? Good luck! (That is why operating systems uniformly wound up choosing hard to debug race conditions over predictably impossible to solve latency problems from cooperative multi-tasking.)


You can totally run a cluster of Node instances. But each instance can only do one thing at a time. No multiprocessing, you have to spin up a new VM for each thing you want to do.

You also don't get shared memory concurrency when it's beneficial, and you have to speak in callbacks.

There are better langs out there for concurrent web. Erlang and Haskell+Warp are fantastic, for instance.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: