3 ms·
wasm and asm.js are perfect examples of incremental improvements rather than building something from scratch. The benefit of this is that incremental improvemen
by richdougherty 11y ago
wasm and asm.js are perfect examples of incremental improvements rather than building something from scratch. The benefit of this is that incremental improvements can be built slowly on top of existing deployed JavaScript engines, whereas writing something from scratch has a serious bootstrapping problem.
The wasm/asm.js story goes like this so far:
1. emscripten, a JavaScript backend for LLVM, demonstrates that you can "compile" C/C++ code into JavaScript.
2. Some vendors start writing specific optimisations for emscripten-style JavaScript code.
3. This is formalised into a subset of JavaScript called asm.js.
4. More browser vendors get onboard with asm.js optimisations.
5. wasm is proposed. Initially it is a compact binary format that is equivalent to asm.js and that can be trivially translated into asm.js at runtime using a polyfill.
The future might look like this:
6. Browsers adopt wasm natively, so the asm.js shim can be dropped, giving more performance benefits.
7. Further enhancements to wasm follow and wasm perhaps begins to diverge from its underlying JavaScript runtime.
8. ???
- cpeterso 11y agoHow long until someone implements WebAssembly instructions in hardware? ARM's "Jazelle" supported some JVM instructions in hardware.
- h1282227 11y agoHardware support only makes sense if the optimisations are already included in the compiler output. The JVM does all the optimisations which makes Java Bytecode not suitable for that purpose.