NodeConf today. It's an impressive turnout for a first time event for a new project that hasn't even hit a 1.0 release yet.I'm at the very first
Ryan Dahl, the creator of Node.js, is the keynote speaker. Here's what he has to say about where the project is going, including why and how Node.js is coming to Windows.
Tom Hughes-Croucher introduces Ryan Dahl, calls him a benevolent dictator.
Dahl is talking about the changes made in Node.js thus far. May 2009 was the initial release, 0.4 was released in February of this year, with an emphasis on getting SSL to work properly.
.5 is the next release, and Windows capability is the major goal.
Windows is the most popular OS in the world, so they want to run on it.
You can run Node.js on Cygwin, but it's suboptimal.
Is it possible to do decent servers in Windows? Yes, but not with a direct native port.
Good server on Unix means:
-set sockets non-binding
-[I missed the second bullet point]
Windows has select() and non-blocking sockets but select() is not constant-time. It becomes noticeably slow with more than 100 sockets.
Windows has WSAEventsSelect() but it must be used with WSAWaitForMultipleEvents() which is limited to 64 sockets per thread.
It's possible to do really good server on Windows using I/O completion ports. In Unix you wait for file descriptor changes to do non-blocking I/O
In windows, you cal asynchronous functions on sockets and get notified of completion.
IOCP supports sockets, pipes and regular files. In other words, Windows has true asynchronous capabilities.
Dahl says Node's API can be refactored to support Windows with minimal API disturbance.
What's required is an abstraction layer over the Unix and Windows styles of I/O. There have been several attempts (libev, libevent, boost ASIO) but none are acceptable.
The Node team built its own abstraction layer called libio.
The TCP socket/server is working cross platform now.
It will be easy to install - a Node install can be a single executable, like Putty.
Binary installers are preferable to both Windows users and some Linux users.
"If we can't get at least gigabit throughput from a TCP pair over loopback on every OS, we've failed."
Q: "Are there any big things that you have to give up to do Windows?"
A: "No. The big thing we had to do is move the lib.js to C-land."
Q: "Have you thought much about what comes after Windows compatibility?"
A: "There's a lot of clean-up stuff that has to happen, but we're quickly approaching a stable version."
Q: "How can we best prepare to have our scripts used on Windows?"
A: "Don't worry about it. We will make every effort to make every piece of core API work on all platforms in the best possible way. Just hold off."
Q: "What's the next big thing after Windows?"
A: "We need some system for linking nodes togethr and opening channels between them."
Q: "What are the biggest problems people have with Node?"
A: 1) The programming style is difficult for people until they get used to it. 2) It's a single threaded thing.
Update: You can find Dahl's slides here (PDF).