Image credit: Mozilla researcher Alon Zakai can find all the gory technical details about how this works here and in this earlier post by Axel Rauschmayer.
#FIREFOX NIGHTLY CODE#
Unless the project hits any roadblocks, Mozilla expects OdinMonkey to ship with the stable version of Firefox 22 in June.Īsm.js is a strict subset of JavaScript that “can be used as a low-level, efficient target language for compilers.” As the asm.ja specs note, this sub-language “effectively describes a safe virtual machine for memory-unsafe languages like C or C++.” Because it is just a subset of JavaScript, this also means that the code would still run in any other browser, too – it would “just run slower in the other browsers than in Firefox,” as a Mozilla spokesperson told me earlier today. OdinMonkey, Firefox’s name for its asm.js optimization module, allows developers to write their code in C or C++, compile it to JavaScript using Emscripten and run it at a speed that is within 2x of native performance. To bridge this gap, Mozilla launched the asm.js project a while back and today, this code has landed in Firefox Nightly. Browsers today are able to execute JavaScript code significantly faster than just a few years ago, but even as our web apps now look more like desktop apps, JavaScript performance is still a far cry from what you can expect from a native program written in something like C or C++.