WebAssembly (WASM) is a compact, stack-based bytecode that runs in a tightly sandboxed virtual machine. Originally built for the browser, it has become a universal compilation target: code in Rust, C++, Go or AssemblyScript compiles to one .wasm binary that runs identically on any host. At the edge — CDN points of presence close to users — this portability and a microsecond cold start make WASM a compelling alternative to containers.
Working principle
The host embeds a WASM runtime (Wasmtime, WasmEdge, V8). A module is validated for memory safety, then either interpreted or JIT/AOT compiled to native code. Crucially, a module has no ambient authority: it can only touch the linear memory and the explicit functions the host grants it through WASI (the WebAssembly System Interface). This capability-based model is what makes multi-tenant edge execution safe.
| Property | Containers | WASM modules |
|---|---|---|
| Cold start | 100 ms – seconds | < 1 ms typical |
| Image size | Tens–hundreds of MB | KB – low MB |
| Isolation | OS / kernel namespaces | VM-level capability sandbox |
| Portability | Per-architecture image | One binary, any host |
| Density | Moderate | Very high (thousands/node) |
What's newThe Component Model and WASI Preview 2 let WASM modules expose and consume typed interfaces, enabling language-agnostic composition — a major 2024–2026 milestone for server-side WASM.
Applications
- Edge functions / serverless on CDNs (request rewriting, A/B, auth)
- Plugin systems — safely run untrusted third-party extensions
- Portable ML inference and lightweight microservices at the edge
References & further reading
- Haas et al., “Bringing the Web up to Speed with WebAssembly,” PLDI 2017.
- WASI / WebAssembly Component Model specifications, Bytecode Alliance, 2024.
- Hall & Ramachandran, “An Execution Model for Serverless Functions at the Edge,” IoTDI 2019.