3 ms·
asm.js is a low-level statically typed subset of javascript, roughly equivalent to C (that's not exactly it but close). As a result, it can be AOT-compiled to
by masklinn 14y ago
asm.js is a low-level statically typed subset of javascript, roughly equivalent to C (that's not exactly it but close).
As a result, it can be AOT-compiled to machine code rather efficiently and lead to excellent performances with special support, while still being 100% compatible with browsers providing no special support (as it's a subset).
The idea is to make it an efficient (if low level) language to use out of the box, and an efficient compilation target for higher-level non-javascript languages (C and C++ are used for comparisons but e.g. clojurescript or elm could compile to asm.js as well instead of their current javascript target).
Basically, as the name implies asm.js tries to be an assembly for the web, but a backwards-compatible one (as opposed to NaCl)