Feeds

The Node Ahead: JavaScript leaps from browser into future

Google V8 engine spawns server world doppelgänger

Build a business case: developing custom apps

Would you like to touch my V8?

Ryan Dahl set out to build his JavaScript platform atop Mozilla's SpiderMonkey, the engine at the heart of Firefox. But after about two days, he switched to Google's V8, and that's where he stayed. "V8 is just a nice, clean library," Dahl says. "It's compact and extracted away from Chrome. It's distributed as its own package, and it's easy to build and it's got a nice header file with nice documentation. It's kind of constrained. It doesn't have dependancies on other things. It seemed much more modern than the Mozilla stuff."

Google isn't officially involved in the project, but according to Dahl and other Node developers, the company has been helpful when the project requires V8 bug-fixes or additional insight. "It's an exciting project. I was at the jsconf.eu conference in Berlin last year, and there was a lot of buzz around Node," Google V8 team member Erik Corry tells The Reg. "It's a very cool use of V8 and shows what you can do when you combine open source software in new ways, not necessarily anticipated by the original authors."

Originally, Dahl called his project web.js. It was merely a webserver, an alternative to Apache and other "blocking" servers. But the project soon grew beyond his initial webserver library, expanding into a framework that could be used to build, well, almost anything. So he rechristened it node.js.

He released an early incarnation of the platform in June 2009, but few noticed until he gave a demo at that year's jsconf. His 45-minute talk was met with a standing ovation, and the project was off and running, not just among application developers but at big-name cloud outfits as well.

The demo

"[Ryan Dahl] was certainly ahead of the game in understanding the implications of [the real-time] world," says Alexis Richardson, senior director at VMware and the former CEO of Rabbit Technologies, the outfit behind RabbitMQ, who was reading Dahl's blog before Node was released. "When he introduced Node, I was extremely impressed."

A month later, Dahl was hired by Joyent.

Node in the heavens

Joyent had already explored the idea of using JavaScript on the server side, and Node seemed to fit right into its thinking. Dahl started writing code designed to drive Joyent's infrastructure cloud, and two years on, Node is "heavily used" inside the company's service. It's also a part of Joyent's SDC6 software, which allows ISPs and other outfits to build their own infrastructure clouds.

The company uses Node in tandem with RabbitMQ – an open source messaging platform for sending data across cloud services – and at VMware, Alexis Richardson and crew have built software that lets application developers do much the same thing. They call it rabbit.js.

RabbitMQ already integrates with Java, Ruby, and Python event-based systems – including Spring Integration, EventMachine, and Twisted – and Node was the natural next step. "The combination of Node with Rabbit simplifies the motion of the data. Rabbit is a data-in-motion technology as opposed to storage technology like a database, and Node gives you a handy toolkit for interfacing that world with applications," Richardson says. "Rabbit enables the motion of the data. What Node does is provide a way to program in this style, for JavaScript users."

At the same time, rabbit.js builds on Socket I/O, a Node technology for readily pushing data to client browsers. Designed by LearnBoost CTO Guillermo Rauch, Socket I/O gives developers a single interface for pushing information to WebSocket-enabled browsers as well as browsers that don't support the relatively new push standard.

"Socket I/O gives you a duplex channel, but what it doesn't do is define what you might say or hear over that channel," says VMware staff engineer Michael Bridgen, who built rabbit.js. "RabbitMQ has semantics about how you do messaging, so I thought [the combination of RabbitMQ and node] might be a sweet spot."

The idea is to extend messaging from the cloud to the browser. On the back end, RabbitMQ lets developers pass data without a database. With rabbit.js and Socket I/O, Bridgen and VMware can do much the same when an application is talking to the client, across the web. This is just the sort of thing Node is designed to do.

Node Knockout

Node Knockout

"I think Node itself recognizes that web programming is more about network programming than it is about databases," Bridgen says. "It's about taking on some data, sending it on in that direction, and then something comes back and sending that back on again. It's about shuffling data here and there. One of the reasons that Node has been successful is that it makes that kind of asynchronous data shuffling accessible to people by couching it in JavaScript."

Rauch agrees. Node drives the length and breath of his LearnBoost app. With node, he says, you can use the same language on the front end and the back end. "That's what's so appealing," he says. "You can write your web application in JavaScript, and you can write all your back-end infrastructure in JavaScript, and you can write your client web application in JavaScript. It really is a single-stack world."

Boost IT visibility and business value

More from The Register

next story
The Return of BSOD: Does ANYONE trust Microsoft patches?
Sysadmins, you're either fighting fires or seen as incompetents now
Microsoft refuses to nip 'Windows 9' unzip lip slip
Look at the shiny Windows 8.1, why can't you people talk about 8.1, sobs an exec somewhere
Intel's Raspberry Pi rival Galileo can now run Windows
Behold the Internet of Things. Wintel Things
Linux Foundation says many Linux admins and engineers are certifiable
Floats exam program to help IT employers lock up talent
Microsoft cries UNINSTALL in the wake of Blue Screens of Death™
Cache crash causes contained choloric calamity
Eat up Martha! Microsoft slings handwriting recog into OneNote on Android
Freehand input on non-Windows kit for the first time
Linux kernel devs made to finger their dongles before contributing code
Two-factor auth enabled for Kernel.org repositories
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
7 Elements of Radically Simple OS Migration
Avoid the typical headaches of OS migration during your next project by learning about 7 elements of radically simple OS migration.
BYOD's dark side: Data protection
An endpoint data protection solution that adds value to the user and the organization so it can protect itself from data loss as well as leverage corporate data.
Consolidation: The Foundation for IT Business Transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?