Modern tooling: WebAssembly, WebGPU and AI assistants · Part 34 of 36
WebAssembly: a portable compilation target
Expert 18 min
What Wasm is, how it runs next to JavaScript, what Wasm 3.0 (2025) added, and where WASI and the component model stand.
What you will learn
- You can explain what WebAssembly is and when it beats JavaScript.
- You can name the features standardised in Wasm 3.0.
- You can describe WASI and the component model for running Wasm outside browsers.
Before this: JIT compilers and optimisations
What WebAssembly is
WebAssembly (Wasm) is a compact, typed, binary instruction format for a stack-based virtual machine. You don't usually write it by hand: you compile C, C++, Rust, Go, Zig, C#, Kotlin and many other languages to it. Every major browser has run it since 2017, and it became a W3C Recommendation in 2019.
Key properties:
- Fast to load and compile: engines validate and compile Wasm in a single pass, often while it downloads.
- Predictable performance: values have static types (i32, i64, f32, f64, v128 for SIMD, references), so engines need no speculation — close to native speed for number crunching.
- Sandboxed: a module can only touch its own linear memory and the functions it is explicitly given (imports). It can't access the DOM, files or network unless the host hands it functions to do so.
- Portable: the same
.wasmfile runs in browsers, Node.js, Deno and standalone runtimes such as Wasmtime and WasmEdge.

Using it from JavaScript
const { instance } = await WebAssembly.instantiateStreaming(
fetch("/lab/blur.wasm"),
{ env: { log: (x) => console.log(x) } } // imports the module may call
);
instance.exports.blur(ptr, width, height); // call an exported function
Wasm doesn't replace JavaScript; it complements it. Good uses: image and video processing, codecs, physics, CAD kernels, databases (SQLite compiled to Wasm), games, and porting existing C/C++/Rust libraries to the web. Applications like Figma and Photoshop on the web rely on it. For typical UI code, JavaScript stays simpler, and crossing between the two has a cost.
Wasm 3.0 (September 2025)
In September 2025 the WebAssembly Community Group announced that Wasm 3.0 was complete — the largest update since 1.0. It standardises features that had been shipping one by one:
- Garbage collection (WasmGC): structs and arrays managed by the host's GC, so languages like Java, Kotlin, Dart and OCaml can compile to Wasm without shipping their own collector.
- Memory64: 64-bit memory addresses for more than 4 GB of memory.
- Multiple memories in one module.
- Exception handling with tagged exceptions (
exnref). - Tail calls, typed function references, relaxed SIMD, and deterministic profile options.
Browser support varies by feature; check compatibility tables before relying on, for example, Memory64.
Outside the browser: WASI and components
WASI (WebAssembly System Interface) defines how Wasm talks to the outside world without a browser: files, clocks, random numbers, sockets, HTTP. WASI 0.2 (January 2024) is built on the component model, which describes module interfaces in a language called WIT, so components written in different languages can be linked together safely. Work on WASI 0.3 adds native async support. Uses include plugin systems (an editor or database that runs untrusted extensions safely), edge computing, and serverless functions that start in microseconds.
Limits to keep in mind
- Talking to the DOM still goes through JavaScript.
- Debugging compiled code is improving (DWARF support in DevTools) but is harder than debugging JavaScript.
- Downloads can be large if you compile a whole runtime.
- Sandboxing protects the host, not the logic inside: memory-unsafe C compiled to Wasm can still corrupt its own linear memory.
Key points
- Wasm is a compact, typed, sandboxed bytecode that runs in all major browsers and in standalone runtimes.
- It complements JavaScript for heavy computation and ported native libraries.
- Wasm 3.0 (September 2025) standardised GC, Memory64, multiple memories, exception handling and tail calls.
- WASI 0.2 (January 2024) and the component model let Wasm run outside browsers with typed interfaces.
- The sandbox protects the host; bugs inside a module can still corrupt its own memory.
Flashcards
- Question: What does WasmGC enable?
- Answer: Garbage-collected languages (Java, Kotlin, Dart…) compile to Wasm using the host’s GC.
- Question: When was Wasm 3.0 announced as complete?
- Answer: September 2025.
- Question: What is WASI?
- Answer: The WebAssembly System Interface — standard APIs for Wasm outside browsers.
- Question: Can a Wasm module read the DOM directly?
- Answer: No — only through functions JavaScript gives it as imports.
Check yourself
Think about your answer, then open it. In the app the quiz is interactive, earns points and brings back what you missed.
Which features are part of Wasm 3.0?
- Garbage collection (WasmGC)
- Memory64
- Exception handling
- Direct DOM access
Show the answer
Garbage collection (WasmGC); Memory64; Exception handling
DOM access still goes through JavaScript imports.
Source: Wasm 3.0 Completed, 2025
Why can engines compile Wasm without speculation?
- Values have static types
- It is interpreted only
- It has no functions
- It runs on the GPU
Show the answer
Values have static types
Static typing lets engines generate efficient code directly.
Source: WebAssembly Specification
A C library compiled to Wasm has a buffer overflow. What can it corrupt?
- Its own linear memory
- The browser’s memory
- Other tabs
- The operating system kernel
Show the answer
Its own linear memory
The sandbox confines access to the module’s own memory, but inside it bugs still corrupt data.
Source: MDN, WebAssembly concepts
WASI 0.2 is built on the WebAssembly ___ model.
Show the answer
component
The component model defines typed interfaces (WIT) between components.
Source: WebAssembly Specification / WASI
Sources
- WebAssembly Specification (Release 3.0), W3C WebAssembly Working Group, 2025
- Wasm 3.0 Completed, WebAssembly Community Group (A. Rossberg), 2025
- MDN Web Docs: WebAssembly, Mozilla, 2025
Facts checked on 2026-11-30. Skillgrove lessons are free learning material — no certificate and no accreditation.