James Cat's rough && ready blog

Compiling to asm.js

Posted in asm.js by zzjames on June 9, 2013

Mozilla’s asm.js is very exciting for web game programmers, although it points towards a future where javascript (mainly in the form of asm.js) will be a compilation target for things like games. This is due to the need for the additional typing that needs to be declared. You just can’t add types to javascript without having some kind of compilation step to set up the heap (implemented as typed array buffers in asm.js, lljs etc) – it may be that work to get LLJS to compile into asm.js modules for perforance dependent code mean we (javascript programmers) can still code in javascipt and get the benefits of compiling to asm.js also – and why not? it seems annoying that you have to write in C, a  30 year old language to compile to JavaScript a language which is half that old.

Members of Microsoft’s Typescript seem to think at some point you’ll be able to compile that to asm.js – seems reasonable so the future looks like they’ll be quite a number of languages that compile to asm.js.