Re:A look at asm.js and the future with WebAssembly
by azakai on Saturday January 16, 2016 @12:57PM
(#10916058)
Not necessarily, since their GC semantics might differ from JavaScript. For example, if they have finalizers, then compiling into JS isn't an option.
Other semantic differences might also make this hard or impossible. Compare pyjamas to pypy.js, for example - the former compiles to JS, but has known differences from proper Python semantics (long bignums), while the latter is a straight port of a Python VM, so the semantics are identical.
Since these are garbage collected languages, wouldn't it make more sense compile to plain JavaScript, treating that as VM-bytecode, and avoid doing things that slows down JavaScript VMs?