Introduction to Node.js with Ryan Dahl
ontwik.com
ontwik.com
I can't seem to wrap my head around it because there are alternatives that have been around longer and are more mature. Is it the excitement of building on top of Google's v8 engine, or the incredible ease of use (I've seen about 15 show HN: Node.js chat server in ____ lines of code), or what?
I'm not bashing node at all, I actually just started getting into it myself and I'm _really_ enjoying it. But within the past 6 months I feel like I can't go a day without hearing about it somewhere.
So you can think of Node.js as essentially the interpreter pattern for systems programming: use a higher-level language to specify what you want done, where the real heavy lifting is going on in a faster, lower level language.
Now the people who get excited about Node on HN seem to see it as a faster, future replacement for Rails (a web development framework), which it might become, but really isn't. It just doesn't have the abstractions you would want to build a well-connected stack with router, controllers, ORM, etc. You end up typing all the glue yourself, and so much of it ends up being confusing if you write it all async.
A more appropriate use of node is to break down monolithic Rails-style apps into very small, distributed services, where the data model itself is possibly not even written in Node, but where Node is doing routing to them.
So think of Node as a tool for writing network system programs in proper Unix style as small, orthoganal, cooperative tools.
This isn't true. If your DB has an async API, just wrap that up, otherwise you're limited to pushing queries to a query-thread-pool to keep the rest of your app async or implement your DB's protocol in whatever framework you're using. Twisted has native DB drivers + the ability to push to a thread pool if you're dealing with a legacy API.
At least to me, Erlang sounds awesome feature-wise, and have glanced over it many times, but every time I see an actual program I decide to just go with Python anyway.
That being said, we are using V8 just as Node and do support JS only NodeJS (and other CommonJS) packages. We are also looking to integrate Node into the platform for doing real time web socket type of operations.
Javascript has the additional allure of running the same code on the client as on the server, which can be nice. And, node is pretty fast.
Partial list: https://github.com/joyent/node/wiki/modules
All easily installable via
npm install express
and in yourscript.js: require('express')
Edit: Isaac Schlueter is currently working on getting tests of the modules to show up in search.npmjs.org (to see which modules are good).The easy forking of small, simple-to-hack, almost-adequate libraries on GitHub really, really helps.