hornbeck

thoughts on business, community and customer service

node.js

leave a comment »

After seeing a tweet from Chris Wanstrath today about node.js I figured I would take a look and see what it’s about.

Node.js is a “purely evented” framework for Google’s V8 javascript engine that gives you the ability to write client/server apps in a message passing, non-blocking, concurrent way. In the description they say,

“Node is similar in design to systems like Ruby’s Event Machine or Python’s Twisted. Node takes the event model a bit further. For example, in other systems there is always a blocking call to start the event-loop. Typically one defines behavior through callbacks at the beginning of a script and at the end starts a server through a call like EventMachine::run(). In Node it works differently. By default Node enters the event loop after executing the input script. Node exits the event loop when there are no more callbacks to perform. Like in traditional browser javascript, the event loop is hidden from the user.”

“no function in Node directly performs I/O. Because nothing blocks, less-than-expert programmers are able to develop fast systems.”

“But what about multiple-processor concurrency? Threads are necessary to scale programs to multi-core computers. The name Node should give some hint at how it is envisioned being used. Processes are necessary to scale to multi-core computers, not memory-sharing threads. The fundamentals of scalable systems are fast networking and non-blocking design—the rest is message passing. In the future, I’d like Node to be able to spawn new processes (probably using the Web Workers API), but this is something that fits well into the current design.”

Node.js is the first javascript library that really makes me want to dive in and work with javascript for more than just trivial ajax effects on a web page. They seem to be on the right path for developing a solid solution for people that don’t want to learn functional/concurrent languages but still want some of that power.

There are already people building adapters to a few of my favorite “nosql” based key/value and document stores,

If you want to get involved or find out more information check out their google group and their docs. Not sure that I will use it anytime soon but I will definitely keep my eye on it for the future.

Written by hornbeck

July 19, 2009 at 11:00 pm

Posted in javascript

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: