WebAssembly
A portable, stack-based binary instruction format and W3C web standard that lets code compiled from languages like C++, Rust, and Go run in every major browser — the fourth language of the web after HTML, CSS, and JavaScript.
Created by WebAssembly Community Group — a joint effort by engineers from Mozilla, Google, Microsoft, and Apple (WebKit)
WebAssembly (abbreviated Wasm) is a portable, stack-based binary instruction format — a compact, low-level code format designed to be a compilation target for languages like C, C++, Rust, and Go, and to execute safely inside a sandbox at speeds approaching native code. It is not a language most people write by hand; it is the language their compilers speak to the web. Announced jointly by Mozilla, Google, Microsoft, and Apple’s WebKit team in June 2015 and shipping in browsers by March 2017, WebAssembly became a W3C Recommendation on December 5, 2019 — officially the fourth language of the web, after HTML, CSS, and JavaScript, and the first new one in over two decades. Today it also runs far beyond the browser: on servers, at the edge, in plugin systems, and inside blockchain and container platforms.
History & Origins
For twenty years, JavaScript was the only programming language browsers could execute natively. Anything else — C++ games, CAD engines, video codecs — had to be rewritten, plugged in (Flash, Java applets, ActiveX), or squeezed through JavaScript. Two projects in the early 2010s attacked that limitation from different directions:
- Google Native Client (NaCl/PNaCl) ran sandboxed native code inside Chrome, achieving excellent performance but never gaining adoption in other browsers.
- Mozilla’s asm.js (released in March 2013 by Alon Zakai, Luke Wagner, and David Herman) took the opposite approach: a strict, statically analyzable subset of JavaScript that compilers like Emscripten could target, and that engines could optimize aggressively. Because asm.js was still JavaScript, it ran everywhere — just faster where engines recognized it.
asm.js proved the demand — game engines like Unity and Unreal were ported to it — but it inherited JavaScript’s costs: bulky text-based delivery and slow parsing of megabytes of source. The obvious next step was a binary format designed from scratch for the purpose.
On June 17, 2015, in a rare act of four-vendor coordination, engineers from Mozilla, Google, Microsoft, and WebKit announced WebAssembly as a joint project, with Brendan Eich publicly framing it as asm.js’s successor. Design proceeded in the open in the W3C WebAssembly Community Group. After a cross-browser “browser preview” in late 2016, the vendors declared the Minimum Viable Product (MVP) design complete in February 2017. Firefox 52 shipped WebAssembly enabled by default in March 2017 — the first browser to do so — with Chrome 57 following the same month and Safari 11 and Edge 16 completing the set that fall. Google retired PNaCl in favor of WebAssembly shortly thereafter.
Standardization followed: the W3C chartered a formal Working Group in 2017, published first public working drafts in February 2018, and elevated the Core Specification 1.0 to a full W3C Recommendation on December 5, 2019.
Design Philosophy
WebAssembly’s design goals, stated from the outset, form a tight quartet:
- Fast — a compact binary format that decodes, validates, and compiles quickly (Figma reported in 2017 that Wasm parsed roughly an order of magnitude faster than the equivalent asm.js), and whose instructions map efficiently onto real CPUs, with the explicit aim of near-native execution speed.
- Safe — code runs inside a memory-safe sandbox. A module can only touch its own linear memory and the functions explicitly imported into it; it cannot make system calls, read the host’s memory, or escape the embedder’s control.
- Portable — the format is hardware-independent, operating-system-independent, and embedder-independent. The same
.wasmbinary runs on x86 and ARM, in a browser or a standalone runtime. - A good compilation target, not a competitor to JavaScript — Wasm was deliberately positioned to complement JavaScript: compute-heavy kernels in Wasm, orchestration and DOM work in JS, with cheap calls across the boundary.
Two structural decisions define the format. First, WebAssembly is a stack machine: instructions push and pop operands on an implicit stack, which keeps binaries compact and validation simple. Second, every module is statically validated before it runs — types, stack depths, and control flow are all checked ahead of time, so the runtime never encounters malformed code paths.
Uniquely among “assembly” languages, Wasm also ships with an official human-readable text format (WAT), using S-expressions, so the binary format is always inspectable and hand-writable:
(module
(func $add (param $a i32) (param $b i32) (result i32)
local.get $a
local.get $b
i32.add)
(export "add" (func $add)))
Loading and calling it from JavaScript takes a few lines:
| |
Key Features
- Compact binary format with a defined structure of typed sections (types, functions, memories, tables, exports), streamed and compiled while still downloading.
- Four core numeric types in the MVP —
i32,i64,f32,f64— later joined by the 128-bitv128SIMD vector type (Wasm 2.0) and garbage-collected struct, array, and reference types (Wasm 3.0). - Linear memory: a resizable, bounds-checked byte array that a module owns outright. This is how C/C++ heaps are modeled — pointer arithmetic happens inside the sandbox, unable to reach anything outside it.
- Capability-style imports: a module has no ambient abilities. Every function it calls from the outside world — DOM APIs in a browser, file access under WASI — must be handed to it explicitly at instantiation.
- Deterministic validation and structured control flow: no arbitrary jumps; blocks, loops, and branches are nested and type-checked, which makes single-pass verification possible.
- Broad compiler support: C and C++ via Emscripten and clang/LLVM (which gained an official Wasm backend), Rust via its
wasm32targets, Go via its officialjs/wasmport (since Go 1.11 in 2018), C# and .NET via Blazor, Kotlin via Kotlin/Wasm, plus dedicated Wasm-first languages like AssemblyScript, a TypeScript-like language that compiles directly to WebAssembly.
Evolution
WebAssembly has grown through carefully staged, backwards-compatible feature proposals rather than big-bang releases:
- 1.0 / MVP (2017–2019) — the deliberately minimal core: four numeric types, linear memory, functions, tables, and the JavaScript embedding API. Finalized as a W3C Recommendation in December 2019.
- 2.0 (drafted 2022, completed 2024–2025) — consolidated the first wave of post-MVP proposals: 128-bit SIMD vector instructions, multiple return values, reference types, bulk memory operations, and sign-extension instructions. It reached W3C Candidate Recommendation with a snapshot on December 17, 2024, and the Working Group declared it complete in March 2025, adopting an “evergreen” living-standard model in which the specification is continuously maintained.
- 3.0 (completed September 17, 2025) — the largest update yet, years in the making: garbage collection (letting managed languages like Java, Kotlin, OCaml, and Dart target Wasm without shipping their own collectors), guaranteed tail calls (essential for functional languages), exception handling, multiple memories per module, relaxed SIMD, and a 64-bit address space option that raises the addressable-memory ceiling from 4 GiB to, in principle, 16 exabytes.
The other axis of evolution happened outside the browser. In March 2019 Mozilla announced WASI (the WebAssembly System Interface) — a standardized, capability-based way for Wasm modules to access files, clocks, sockets, and other system resources without a browser, prompting Docker co-founder Solomon Hykes’s much-quoted remark that had Wasm+WASI existed in 2008, Docker would never have needed to exist. That November, Mozilla, Fastly, Intel, and Red Hat founded the Bytecode Alliance, home of the Wasmtime runtime and the emerging Component Model, which defines how Wasm modules written in different languages compose through typed, language-neutral interfaces. Standalone runtimes (Wasmtime, Wasmer, WasmEdge) brought Wasm to servers and edge platforms, and Docker itself shipped a Docker+Wasm technical preview in October 2022 that runs Wasm workloads side by side with Linux containers.
Current Relevance
WebAssembly in the mid-2020s is quietly everywhere:
- In browsers, it powers the heaviest applications on the web: Figma, Adobe Photoshop’s web version, AutoCAD Web, Google Earth, video conferencing effects, in-browser emulators and games, and ports of libraries like SQLite, FFmpeg, and OpenCV. Support ships by default in Chrome, Firefox, Safari, and Edge.
- At the edge and on servers, platforms such as Fastly Compute and Cloudflare Workers use Wasm’s millisecond-scale instantiation and strong isolation as a lighter-weight alternative to containers for multi-tenant code.
- As a universal plugin format, embedded by applications (Envoy proxy filters, Shopify Functions, stream processors) that need to run untrusted user code safely in-process.
- In new language ecosystems: with Wasm 3.0’s garbage collection now standard, managed languages — Kotlin, Dart/Flutter, Java, OCaml — can target the web without bundling a runtime, something the MVP could never offer them.
The specification itself is actively developed under the W3C’s evergreen model, with the Bytecode Alliance’s WASI and Component Model work pushing toward a genuinely language-agnostic software ecosystem. Wasm is no longer an experiment; it is boring, load-bearing infrastructure — the highest compliment infrastructure can receive.
Why It Matters
WebAssembly ended JavaScript’s twenty-year monopoly as the only language of the browser — not by replacing it, but by opening the web to every language with a compiler. It is one of the very few technologies in web history on which all four major browser vendors cooperated from day one, and it went from announcement to universal browser deployment in roughly two and a half years, then to a formal W3C standard in about four and a half.
Its deeper significance may lie beyond the web entirely. WebAssembly demonstrates a model the industry had chased for decades — one portable, verifiable, sandboxed binary format for all languages and all platforms — that the JVM, CLR, and Native Client each approached but never universalized. With WASI, the Component Model, and standard garbage collection in place, Wasm has become a serious candidate for the neutral substrate of cloud, edge, and embedded computing: write in any language, compile once, run anywhere, trust nothing by default. For a format whose first job was speeding up browser games, that is a remarkable second act.
Timeline
Notable Uses & Legacy
Figma
The collaborative design tool's C++ rendering engine runs in the browser via Emscripten-compiled WebAssembly. In Figma's June 2017 measurements, switching from asm.js to Wasm cut load time — app initialization plus document download and first render — by more than 3x across document sizes.
Autodesk AutoCAD Web
Autodesk brought its decades-old C++ AutoCAD codebase to the browser by compiling it to WebAssembly with Emscripten, demonstrated publicly in 2018 — a flagship example of porting a massive legacy desktop application to the web without a rewrite.
Adobe Photoshop on the web
Adobe's browser version of Photoshop, first shown in public beta in 2021, runs the application's C++ core compiled to WebAssembly with Emscripten, leaning on Wasm threads and SIMD support in modern browsers.
Google Earth
The web version of Google Earth compiles its native C++ codebase to WebAssembly, which allowed Google to expand Earth beyond Chrome's Native Client to Firefox, Edge, and other browsers starting with a 2019 beta.
Fastly Compute
Fastly's edge-computing platform executes customer code as WebAssembly modules on the Wasmtime runtime, using Wasm's sandboxing and fast per-request instantiation instead of containers or virtual machines.
Shopify Functions
Shopify lets merchants and app developers customize backend commerce logic — discounts, payment and delivery options — by uploading WebAssembly modules that Shopify executes inside a tightly sandboxed, time-limited runtime on its own infrastructure.
Language Influence
Influenced By
Influenced
Running Today
Run examples using the official Docker image:
docker pull emscripten/emsdkExample usage:
docker run --rm -v $(pwd):/src emscripten/emsdk emcc hello.c -o hello.js