3 ms·
> You could compile C++ ... to JavaScript 10 years ago. That's true, but to get any sort of 'near-native' performance out of that approach, browsers had to add
by flohofwoe 4y ago
> You could compile C++ ... to JavaScript 10 years ago.
That's true, but to get any sort of 'near-native' performance out of that approach, browsers had to add special support for asm.js, running asm.js as regular Javascript would loose 3..10x performance compared to 'special cased' asm.js (if I remember right - for instance iOS Safari never added this special asm.js support, and once it supported WASM the performance jump from asm.js to WASM was dramatic and much bigger than desktop browsers which already had added special asm.js support before).
Compared to an asm.js special case in a Javascript engine, the WASM approach just makes a lot more sense, because Javascript can now focus again on being a programming language and not also being a good compile target.