I have been reading about asm.js and WebAssembly recently:
http://ejohn.org/blog/asmjs-javascript-compile-target/
https://brendaneich.com/2015/06/from-asm-js-to-
Is asm.js code compiled in time and run? Compiled into what?
Different browsers compile asm.js code in different ways. As of August 2015:
Other than asm.js being text and wasm (web assembly) being binary, what are the differences between the 2?
asm.js is just JavaScript and thus must behave exactly according to the JavaScript spec. As a new standard, WebAssembly is able to fix some corner cases where JavaScript behavior is not the ideal (from a performance or compilation perspective) [3]. In the future [4], WebAssembly will be able to add features that would otherwise be difficult to express in JavaScript.
What does this mean for other scripting languages, running in the browser? Take python for example, is it going to be
- python code compiled to wasm? or
- python interpreter (Cpython) compiled into wasm and interpret python?
In v.1, the simplest way to run Python in a browser will be to compile a Python interpreter to wasm, as you said. This means, e.g., the Python GC is running in wasm code and manually managing the wasm linear memory. There has already been an experimental projects to add an asm.js backend to PyPy [5] (which could work just as well for wasm). It currently runs into limitations of asm.js that could be addressed by the dynamic linking future feature of wasm. Going further, wasm seeks to provide both GC integration and JIT compilation support both of which would allow more efficient and natural integration with the Web platform.