Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Sorry, just read this now. JS's core DNA is as an event language because it was designed for the browser UI which is all about events. Through a wonderful turn of events someone slapped V8 on the server and people started dabbling with JS on the server at the same time as epoll() and/or kqueue emerged and started being used to amazing effect by nginx and other projects.

And so we ended up with this sweet spot of a fast event platform with a super accessible language and a way to handle hundreds of thousands of connections with almost no CPU load. So it's not really about the deficiencies of Ruby (which is awesome for what it's good at) but it's about how incredibly strong node.js and epoll() is for doing anything that would normally be designed with multiple threads and blocking architecture.

So with regards to my square peg/round hole comment. I didn't mean sarcasm - what I mean is that node.js is just so incredibly great at any task where you're waiting on stuff that would block in old-school multi-threaded architecture - both in terms of performance (no load when nothings happening), architecture (a single thread and event loop does it all) and programmability (event handlers, callbacks closures and the syntax are so great for this kind of coding).



view as:

The thing is, Ruby can use epoll/libuv as well, so how is that an advantage of Node.js? So the only difference is in the languages themselves, and I don't see where Ruby lacks - after all, the callback pattern is pretty embedded in the language with blocks, and arguably more pleasant to use than JS functions.

Then by all means, use Ruby. Most langs have epoll.

I'll use Python anyway :) I just wanted to understand why people advocated for Node.js over Ruby.

Legal | privacy