This is an archived page. It's not actively maintained.

Server-Side JavaScript

Here's a radical idea: Use one language to write entire Web apps -- and have that language be the one that billions of web pages every day already use.

Sounds obvious doesn't it, but for at least the first twelve years of the Web's evolution, developers have pretty much had to use different languages on the server than what they use in the browser which leads to segregated teams, disaprate know-how, and at times plenty of server-side gymnastics with string manipulation to generate HTML or Ajax pages. Of course the simplicity of using JavaScript on the server was part of Netscape's original vision back in the day with Netscape LiveWire. But that was when 350 MHz servers were the best thing you could buy and long before Mozilla emerged from the Netscape organization to continue to advance the state of Web technologies. Today with computing cycles having increased more than 10-fold and Mozilla's work on Rhino (JavaScript interpreter in Java) and SpiderMonkey (JavaScript interpreter in C) and JavaScript itself, we have very solid foundations for JavaScript to become extraordinarily useful and applicable on the server-side again -- this time with performance in the same range as with other popular server-side environments like PHP and Ruby on Rails. And with TraceMonkey to be available soon, JavaScript (both client side and server-side) could see 20x to 40x speed improvements according to Brendan Eich, Mozilla CTO and creator of JavaScript. Server-Side JavaScript is another way that, as this article quotes Brendan, "that Mozilla wants to 'get people thinking about JavaScript as a more general-purpose language' and show them that 'it really is a platform for writing full applications.'"

Many vendors today are embedding Mozilla Rhino or Mozilla SpiderMonkey into Web server environments. And some like Aptana with the open source Jaxer server actually embed the entire Mozilla Firefox browser engine (which includes SpiderMonkey) within a Web server to enable server-side Ajax and server-side DOM access in addition to server-side execution of JavaScript.