Has anyone tried it? I've been playing with it for the last hour and it's pretty great. I've had a soft spot for Javascript for a while, but I'd only ever used it on the browser, but now I can see that it's much more than a browser language.
Also, this tutorial is now a must-read: http://www.nodebeginner.org/
It has made me rethink to a large extent how I structure and write programs. I feel somewhat enlightened after reading it.
JS on Google V8 is an excellent piece of software, but, well, it is still nowhere near as fast as runtimes traditionally used for server-side web-development. And I mean "fast" both to write the code as well as to execute it.
It seems pretty fast to develop from here, and it might not be fast in terms of execution time, but since it uses async I/O it scales well (and, since it's a single thread/process, with none of the issues of thread synchronisation).
Besides that, Javascript is generally an amazing language. It's expressive, it has functional programming elements (closures, anonymous functions) and you can easily emulate classes if that's what you want. It has dictionaries built into the language (although they're confusingly called objects). It has implicit typing. It has lots of built-in classes (although they behave more like namespaces) and methods. And it manages to do all of that without feeling like a language that just has features piled on top of more features.
Javascript on the browser has everything you would expect a client-side browser-based language to have (and more), but on Node it has everything else. You could compare the library that comes with Node with that of Python, but I think Node's is better because I find Python's libraries have inconsistent APIs and I don't enjoy using most of them. Javascript is also a more attractive language than Python.
[edit] The only problems I can see with it are if you want to develop full applications. It's only really suited to servers and that sort of thing. But those things could undoubtedly be added with an extension framework if there was any desire for that sort of thing.
1. It lacks namespaces, packages, etc. This is a huge drawback if you want to write a big project.
2. It lacks static typing. Forget about refactoring, good IDE support, catching simple bugs by compiler, etc. Additionally performance sucks because of this, no matter how much R&D resources they put into V8.
3. As for async multithreading model and libraries, Java/Scala and Erlang kick its ass.
I view JS as a good language to compile my code into, e.g. using GWT. But not as a labguage to write complex code in.
1. Ordinary Javascript does, but Node.js doesn't. If you have a file called module.js and you want to include it from your main source file (usually called index.js), you can do:
1 2 3
var module = require('./module');
module.init();
2. Granted, but a Node.js HTTP server can be faster than Apache: http://zgadzaj.com/benchmarking-nodejs-basic-performance-tests-against-apache-php
3. I don't know Scala (still haven't checked it out, I've been meaning to) or Erlang, but I don't really like Java. Node.js doesn't use multithreading by design; it uses async I/O with a single process so that there's no need to worry about race conditions and deadlocks.
I take your points, though - it's not really suited to huge projects. However, you can write a functioning IRC server in 400 LOC with it, which is pretty awesome.
2. Why compare with Apache, which is one of the slowest web servers? Rather compare with Netty, Nginx or LightHttpd. Anyway, even if the webserver is pretty fast, the code of the application you embed is not.
3. Async I/O has been supported in Java and some other languages for many years now. Message passing is not the end of all solutions. I'd like to have a choice - to use message passing style, thread-based style or parallel-data (map-reduce) style, or even join them together. JS doesn't give this flexibility.
It's not that Javascript doesn't give you the flexibility, it's that Node doesn't. Javascript is a very flexible language, it could be adapted to multiple threads. But, as far as I know, no-one has done it. Probably because it's not a good idea, or because there's no market for it (which probably means it's not a good idea).
Also, saying that Node not supporting threading is a limitation is like saying Java not supporting functions outside of classes is a limitation. It's not a limitation when it's central to the design. As I said, the reason it doesn't support parellelisation and threading is to avoid the issues inherent to them. If it doesn't do what you need it to do (have threads, in this case), then don't use it for that.