Skip to navigation

The Next Big Thing

Last year Steve Yegge speculated that Javascript (JS from now on) would become the Next Big Thing, that is, reach the level of ubiquity that only C, C++ or Java have so far experienced.

In August, the future of JS, Ecmascript-4, was buried only to be born again as ECMAScript-Harmony. It is a lot less complex and we should see the first implementations early next year.

Meanwhile, JS browser engines are out-speeding each other, bringing closer the day when JS will render and animate in your browser as smoothly as Flash or a Desktop application:

In June, Webkit, announced SquirrelFish, their next generation JS engine. It now compiles JS syntax tree to bytecode, making SquirrelFish 1.5 times faster than Firefox 3.

On Saturday, Mozilla announced that TraceMonkey, the next version of their JS engine, will be available in FF 3.1. It incorporates the Tracing Just-In-Time compiler Adobe developed for Actionscript and is roughly twice faster than FF3’s engine (6 times faster at manipulating images) !

Great ! But how does it work ? TraceMonkey finds hotspots, selected parts of the software where a lot of time is spent, based on the actual execution of the program. These hotspots are then compiled into native instructions the computer can understand. This selective compilation doesn’t require a lot of memory (unlike entire programs compilers), which means that it’s also good for mobile devices, one of Mozilla’s main focuses for browser development.

To get an idea of the speedup, here is a screencast showing image manipulations with FF3 and with FF3.1 (with TraceMonkey).

To try TraceMonkey, get a nightly of Firefox 3.1, open about:config, and set javascript.options.jit.content to true (it’s disabled by default).

Both SquirrelFish and TraceMonkey take advantage of cutting edge Programming Language research, and it’s just the beginning of JS implementation speed-ups, they say ! Microsoft has to step up its game !

Maybe Steve Yegge was onto something after all…

PS: Oh yes and Google just announced they are launching a new browser, Chrome, based on Webkit it will feature… V8, a new Javascript engine, meant to be faster and safer ! So there we are, Mozilla, Apple and now Google are raising the bar.

Love what we’ve said? Think we’re talking nonsense? Don’t worry about being polite, just let us have it. We’re not afraid of telling you that you’re talking crap, so don’t be afraid of telling us the same.