16 Nov 2012 JSConf Down Under: A Conference Report
Say what you will about Java class files and Jar files, but they’re a standard. The strength of the JVM as a platform is that no matter what language you’re using, you can still access libraries written in other languages. It’s a chief selling point of Scala, Groovy, JRuby and Clojure.
Isaac Schlueter was another highlight of the conference. Perhaps best known as the creator of NPM, on the day he was actually speaking about the rethink of streams that is upcoming in Node.js 0.10.
Isaac did a great job of explaining the drawbacks of the current API, as well as how the new API will fix those problems. Essentially it boils down to the old API continually pushing data at you – whether you can handle it or not – versus the new API simply telling you when data is available, but letting you decide when you’re going to get it. The old API required many module developers to implement their own buffering, which is both hard to do and represented a duplication of effort. The new API avoids the need to do buffering at all.
For those concerned about how the changes will affect their existing Node.js apps, the old APIs will still be available, but built on top of the new API. This means your code won’t break, and in the event that you’re currently using
pause() to try and hold back the firehose of data, may even work a little bit better for you.
I hope this is the last big change to Node.js before a 1.0 release. Isaac himself admitted to a grudging acknowledgement of the need to stabilize the API. He also confessed that the new approach is something that even the venerable Unix stream programming model supports.
Perhaps it’d good to get some more old, experienced eyes over the approaches that Node is taking. I want Node.js to be more than just a platform for the current generation of talented hackers to relearn lessons that previous generations have encountered in the past. I want it to be the best of the new and the old.