3 ms·
I'm curious - what does WASM offer that emscripten + asm.js didn't?
by torginus 4y ago
I'm curious - what does WASM offer that emscripten + asm.js didn't?
- jsheard 4y agoFrom the creator of Emscripten: https://hacks.mozilla.org/2017/03/why-webassembly-is-faster-than-asm-js/ https://hacks.mozilla.org/2017/03/why-webassembly-is-faster-... Asmjs was a clever hack but still a hack, and starting over with a clean slate let them fix various limitations inherent to using Javascript as a compilation target
- pjmlp 4y agoOnly because they refused to adopt PNaCL.
- azakai 4y agoWasm is smaller and faster than JavaScript and asm.js. It is both faster on average, it has far better predictability (far fewer performance cliffs or pitfalls), and it starts up faster (faster to decode + no need to warm up the JIT with types at runtime). You can test this pretty easily, since Emscripten still supports JavaScript output with a flag (for environments that lack wasm support for whatever reason). Comparing Emscripten's default wasm output to JS output for the same benchmark will show those benefits in most cases.