Server-side v8 JavaScript 15 September 2008

The Google Chrome v8 Engine looks promising. Fast and lean, easy embeddable. It implements the ECMA-262 3rd edition, also known as JavaScript 1.5.

The next killer web application language might indeed be JavaScript. This is already seen by Helma, a framework that runs server side JavaScript on Rhino in a JVM.

A promising first v8 fastcgi module (new name: llv8call) is already in the making, written in C++. Most cannot afford running a complete JVM on a server like needed by Helma. Using v8 also opens the possibility of shared hosting plans like done by PHP, as one fastcgi process can execute several projects simultaneously. This is hard to do with Helma, and similarly hard with Ruby on Rails. Why is it easier with v8? It is designed for short startup time when reading in new code. Therefore, the code does not have to be held in memory all the time, and that is a requirement for shared hosting.

To be better as PHP for server side scripting, we need at least:

  • a library. Ports from PHP might be quick and easy, as PHP is written in C.
  • modules for the popular web servers like Apache and Lighttpd.

I would really like to see JavaScript in favor of PHP, as I like the language more. For this, I would appreciate v8 to adopt the useful features of JavaScript 1.7 or 1.8 standards. Rhino is at 1.7, and Mozilla’s Tracemonkey already executes JavaScript 1.8.

The future development is yet open, however JavaScript could give a substantial performance gain to web scripting languages. First, the v8 engine is very fast compared to ruby in this very simple benchmark. Whether JavaScript drags Ruby and Python in Webapps or not – the now open sourced techniques of v8 are likely to be reused in other interpreters.

Update: jslibs is another JavaScript library providing fcgi bindings. IO and various native modules like SQLite are accessible. They base it on the new Tracemonkey engine, which has a good performance, and supports more JavaScript language features (JS1.8).

Update 2: K7JS provides a library for V8. Like llv8call, they thrive to create a standard library for V8 (thanks, Sébastien). Update 2b: k7js.org seems to be offline.