What is the difference between asm.js and WebAssembly?

Is asm.js code compiled in time and run? Compiled into what?

asm.js is regular javascript code, and is compiled into bytecode by the JS interpreter as always. However, an interpreter with asm support is supposed to do ahead-of-time compilation, and possibly to generate more efficient code representation because of the static typing. See http://asmjs.org/ for details.

what are the differences between asm and wasm (other than text vs binary)?

None, for now. wasm is supposed to be backwards-compatible, compilable to asm (which again is executable as normal JS). It might however be extended with more features in the future as support for it grows.

What does this mean for other scripting languages, running in the browser?

The latter, rather, as Python still needs to be interpreted. Scripting languages that don’t need an interpreter can of course be directly compiled to (w)asm, given that there is a compiler (chain) that supports it as a target.

Leave a Comment

tech