When Is WebAssembly Going to Get DOM Support?
9 months ago
- #JavaScript
- #WebDevelopment
- #WebAssembly
- WebAssembly (Wasm) is designed with a strict separation from JavaScript, unlike asm.js which is embedded in JavaScript.
- Wasm can call JavaScript APIs, including the DOM, through JavaScript glue code, allowing seamless integration.
- Wasm's core goal is to optimize performance for web applications, not to eliminate JavaScript entirely.
- Wasm modules declare imports and exports, and JavaScript can instantiate these modules to provide necessary APIs.
- Wasm initially supported only numeric types (i32, i64, f32, f64), but can still interact with JavaScript APIs that handle objects.
- Exception handling, blocking operations, and garbage-collected values have been added to Wasm to improve performance.
- The Wasm Component Model is being explored for more direct access to web APIs, but it's still under development.
- Web APIs are currently native to JavaScript, making direct Wasm access complex without significant effort.
- The W3C Wasm Community Group oversees Wasm's development, focusing on consensus and incremental improvements.
- Wasm is best used as an implementation detail, with build tools generating both JavaScript and Wasm for web applications.