Est. 2017 Advanced

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)

Paradigm Stack-based binary instruction format; portable compilation target
Typing Static, Strong
First Appeared 2017
Latest Version WebAssembly 3.0 (September 2025)

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:

  1. 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.
  2. 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.
  3. Portable — the format is hardware-independent, operating-system-independent, and embedder-independent. The same .wasm binary runs on x86 and ARM, in a browser or a standalone runtime.
  4. 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:

1
2
3
4
const { instance } = await WebAssembly.instantiateStreaming(
  fetch("add.wasm")
);
console.log(instance.exports.add(2, 3)); // 5

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 MVPi32, i64, f32, f64 — later joined by the 128-bit v128 SIMD 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 wasm32 targets, Go via its official js/wasm port (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

2013
Mozilla engineers including Alon Zakai, Luke Wagner, and David Herman release asm.js, a highly optimizable subset of JavaScript designed as a compiler target for C and C++ (via Emscripten). Together with Google's Native Client and Portable Native Client (PNaCl) sandboxing projects, it is the direct precursor to WebAssembly.
2015
On June 17, 2015, engineers from Mozilla, Google, Microsoft, and the WebKit project jointly announce WebAssembly, with Brendan Eich framing it as the successor to asm.js. Work proceeds in the open under the W3C WebAssembly Community Group.
2016
In March 2016, experimental implementations in Firefox, Chrome, and Edge run an early demo of Unity's 'Angry Bots'. In late 2016 the four browser vendors ship a coordinated 'browser preview' of WebAssembly behind flags, inviting feedback on the draft binary format before freezing it.
2017
The vendors reach consensus in February that the Minimum Viable Product (MVP) is complete. In March 2017, Firefox 52 becomes the first browser to ship WebAssembly enabled by default, with Chrome 57 following the same month. The W3C charters a formal WebAssembly Working Group to standardize the design.
2017
Safari 11 (September) and Microsoft Edge 16 (October) add support, and in November 2017 Mozilla declares WebAssembly supported in all major browsers — roughly two and a half years from announcement to universal deployment.
2018
In February 2018 the W3C Working Group publishes the First Public Working Drafts of the WebAssembly Core Specification and its JavaScript and Web APIs.
2019
WebAssembly breaks out of the browser: Mozilla announces WASI, the WebAssembly System Interface, in March — prompting Docker co-founder Solomon Hykes to remark that if Wasm and WASI had existed in 2008, Docker would never have needed to be created. In November, Mozilla, Fastly, Intel, and Red Hat found the Bytecode Alliance to build shared, secure Wasm runtime infrastructure such as Wasmtime.
2019
On December 5, 2019, the WebAssembly Core Specification 1.0 becomes an official W3C Recommendation, making WebAssembly the fourth language to run natively in browsers, after HTML, CSS, and JavaScript.
2022
The W3C publishes the first public working draft of WebAssembly 2.0 in April, gathering post-MVP features such as 128-bit SIMD vector instructions, multiple return values, reference types, and bulk memory operations. In October, Docker ships a Docker+Wasm technical preview that runs Wasm modules alongside Linux containers.
2024
WebAssembly 2.0 reaches W3C Candidate Recommendation, with a Candidate Recommendation Snapshot published on December 17, 2024. The Working Group adopts an 'evergreen' living-standard model, declaring Wasm 2.0 complete in an announcement in March 2025.
2025
On September 17, 2025, WebAssembly 3.0 is declared complete — the largest update in the language's history, adding garbage collection, guaranteed tail calls, exception handling, multiple memories, and a 64-bit address space that lifts the previous 4 GiB linear-memory ceiling.

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

asm.js Google Native Client (PNaCl)

Influenced

Running Today

Run examples using the official Docker image:

docker pull emscripten/emsdk

Example usage:

docker run --rm -v $(pwd):/src emscripten/emsdk emcc hello.c -o hello.js
Last updated: