Is it just me or does it seem like Node.js is taking off like wildfire?
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.
I think there is an interesting discrepancy between Node's sweet spot and the people who use it shallowly. If you read Ryan's short history of where it came from, Node came from writing systems code in C where he had to deal with network or async events and finding that he was writing the same code repetitively.
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.
I think you're right. Many people are treating Node.js like Tornado (http://www.tornadoweb.org/) and that's not really its intended purpose. It's hard to make requests in a webapp completely async anyway. As soon as you get database transactions involved you're screwed. I fear that too many people hear "it scales" and just jump on board without really understanding the context in which someone makes the claim.
> As soon as you get database transactions involved you're screwed
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.
I had second thoughts about saying that as soon as I hit reply. You're completely right. I should have said things get harder, and if you don't understand what you're doing to start then you're screwed and you don't even know it.
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.
I see this complaint come up a lot, it saddens me. Like any language the syntax has some warts but I don't see it being much of any worse than Python or Ruby or any others. One thing Erlang has going for it is the syntax is very small relative to many other languages.
We're aiming for the Rails (and PHP!) crowd you mention with Akshell (http://www.akshell.com). Our custom made server uses an Apache MPM like setup with synchronous I/O. Synchronous code is much easier to write and maintain and most real world webapps should be optimized for developer efficiency and ease of maintenance, rather than raw performance.
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.
A lot of large scale web apps use something like Node or message queueing along with Rails in an event-oriented architecture. An API request comes in, routes through a queue somewhere to get committed to a data store and also put in a cache. Then a web request comes in, Rails grabs data from the cache and then renders it with all of the Rails goodness for html generation, restful routing, etc.
It's new. People are tired of Ruby, Python, and Perl, which have all had async IO forever, but are old. A lot of people have spent a lot of time writing shitty software in those languages, because they were new to programming when they started. The mental image of the failures stick around for a while. Switching to a new language means you have never written any bad software in that language, and that's exciting.
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.
To me the Node.JS articles are becoming like Erlang as been, something that gets submitted to the site over and over again. Let me know when there's an extensive of a library like Java or Python :D I do like the concept of JavaScript everywhere. For instance, the porting of Toxiclibs to Processing.js is simply astounding.
This extensive library exists... as millions of separate JS pieces and snippets scattered around the web, and hundreds of (often fairly buggy) node-xyz modules on GitHub. Sure, it may be slightly less convenient than a standardized, readily packaged out-of-box library and it doesn't have 10 years of testing and refining under its belt yet. But it's there. Some like it raw and rough!
Node.js is especially interesting because it can be suited to a person like me (with a system administration background) to learn and use Javascript. Most system admins I know don't usually have a need or care to learn JS under the DOM, now that we can create network system utilities using JS with ease it is an attractive alternative to Python/Twisted for some of my projects.
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.