Badass JavaScript

A showcase of awesome JavaScript that pushes the boundaries of what's possible on the web, by @devongovett.

Link: Excellent Article Clarifying Mozilla’s asm.js Project by John Resig

April 3rd 2013

John Resig has written an excellent article clarifying some of the questions that have arisen over the past few weeks regarding Mozilla’s asm.js project. If you haven’t heard of it already, asm.js is a highly optimizable subset of JavaScript designed mostly for compilers like Emscripten. I wrote an article about it a few weeks ago when the spec was first released right here on this very blog, so check that out if you want some more introductory details.

John’s article talks about some of the use cases for asm.js, some of the common misconceptions about it, and finally includes a question and answer section with Mozilla’s compiler engineer David Herman, who is one of the authors of the asm.js specification. It’s definitely a good read, so check it out!

I think asm.js will be really important over the coming months and years, and I’m excited to see other browser vendors already getting on board. I got even more excited about it when I saw Mozilla and Epic Games’ demo showing the Unreal Engine running in the browser at very good performance, thanks to Emscripten and asm.js last week.

I’m looking forward to trying out asm.js myself very soon as well, especially for the JavaScript audio codecs that I worked on as a part of Audiocogs (née Labs). Unfortunately, asm.js isn’t really designed for human authors so it would be a very big task to convert one of our existing codecs to use it. However, it is very promising for new ports, and I’ve already starting playing around with using Emscripten to compile libogg and libvorbis to JavaScript to use with the Aurora.js framework. It will be interesting to see the performance and code size differences between the hand ports we’ve done and the Emscripten generated ones. Now I just have to find the time to actually do it! :)