All this power for what? Faster applications More immersive games Virtual reality Augmented reality Live video/image processing Big Data/Machine learning
WebAssembly is fast WASM is more compact -> Faster FETCH of the source WASM is closer to machine code -> Faster DECODING, COMPILING and OPTIMISING No need to RE-OPTIMISE No garbage collection
Export functions to JS Keyword EMSCRIPTEN_KEEPALIVE EMSCRIPTEN_KEEPALIVE int sum(int x, int y) { return x + y; } Expose only the interface of the WASM module to JS
“Currently, calling a WebAssembly function in JS code is slower than it needs to be. The JIT doesn’t know how to deal directly with WebAssembly, so it has to route the WebAssembly to something that does. … This can be up to 100x slower than it would be if the JIT knew how to handle it directly. ” Lin Clark
Future features Formal Specification Threads supports SIMD acronym to Single Instruction Multiple Data (back to Stage 3 on TC39) Exception handling Garbage collection Direct DOM access ES6 Module integration