3 ms·
I'm not an asm.js expert by anyway means, but I did have some success using it. So here's some basic facts: 1) asm.js is Javascript, albeit a strict subset 2)
by marcosscriven 12y ago
I'm not an asm.js expert by anyway means, but I did have some success using it. So here's some basic facts:
1) asm.js is Javascript, albeit a strict subset
2) asm.js is not Emscripten. Emscripten is rather a tool that converts LLVM IR to asm.js - in fact, before asm.js was released, Emscripten still worked, albeit significantly slower.
3) While you can't 'compile' Javascript to asm.js, you could in theory manually convert it - the reason it's so closely associated with C/C++ is that there's type information available to do the conversion to asm.js automatically
4) Just as an example, asm.js works by doing things like bitwise ORing numbers with zero to make it possible for the Javascript engine to immediately know you're actually only dealing with integers. In that sense it gives you AOT-like potential, rather than running the loop a few hundred times to see what you're getting before JITing it.
With V8, Google seem to be taking the approach it's better to optimise more generally, rather than focussing on asm.js.