Why node.js excites me
gnegg.ch
gnegg.ch
(GitHub self-pimpage: since I use node-paperboy myself, I fixed the security hole and all the stability problems I could find. The patches haven't been merged into the main repo yet, but here's the fixed version: http://github.com/PeterScott/node-paperboy)
However, the deal with paperboy is it's more of a starting point for writing your own file based HTTP server, not so much a drop it in and serve static files affair. It's got some other problems as well. I'd fix them, but I don't really use node.js anymore. If I were still using node here's what I'd look at with paperboy:
1. No tests (ugh)
2. I'm not sure what would happen if you tried serving a large file to a slow client (it reads in a stream based fashion, but since writing to the socket doesn't block, that memory has to go somewhere) Reads might need to be throttled.
3. It doesn't have sensible defaults, like the 404 thing.
All that stuff would be trivial to look at, hopefully someone will. I myself am not a node.js developer anymore (doing a lot of eventmachine).
Thanks for the patch, I'm sure felix will add it in soon enough.
Why is that?
Wait a few months and I'm sure all this discussion will be horribly obsolete, of course.
"Now we know that we can easily write well performing servers (...)"
these kind of statements are why i rarely read nodejs articles nowadays. you can't just say that in general.
Sure, if you hit it big, you'll probably need to change things around a bit. But I think its valid to say that with Node, you don't have to worry about performance because by default its really, really fast.
Overall I have mixed feeling with my experience with Node so far (the libraries are very young, and extremely flaky). However it makes it dead simple to write apps that scale to a ridiculous level without huge amounts of upfront planning.
Performance and scalability are not always a tradeoff. When you increase performance at the runtime level, you don't decrease scalability. However it allows you to serve more requests in the same amount of time.
Most of node.js's fanbase well and truly believes this nonsense, that you can't have race conditions simply because there is no pre-emption of your running code. In fact, single-threaded, event-based logic can very easily end up in situations where the timing or ordering of network frames impact a response in an unanticipated manner.
Avoiding parallelism removes several kinds of race conditions, sure, but not all of them. You have to know how they occur, how to prevent them. You can't just use node and hope they all go away.
Also, the Node.js "cultishness" here would explain the large number of upvotes...
Edit: Just realised this looks trollish. Sorry about this - I'm genuinely interested, since I write some evented code, but couldn't find any notable differences here... I'm not sure if I should take time to explore node.js, or is it same old stuff in a new package.
Its not so much that there are more Node programmers than, say, Twisted programmers (although at this point there very well might be, especially in the Bay Area), but lots of people know Javascript, and both Javascript and Node itself are relatively easy to learn.
Edit: I don't mean to pick on Twisted here, I've been using it for about two years, and Node for only around two months, and I really like both.
Even this article's proof positive is a one feature ultra simplistic web app.
Where are the Amazons, GitHubs, Diggs, Onions, etc..
Considering that most sites will have to scale on features before they have to worry about scaling on performance it seems like too much focus is put on the groovy non-blocking nature of Node.js.
It's fairly basic, but I'm not sure what you're looking for given that it hasn't been available for very long. Amazon, github, digg, onion, were all built on very mature technology.
Either choice means that the code is harder to read, but erlang is easier to read than node code, I suspect. (Will have to investigate.)