What WebAssembly Is and Why It Matters

Fractional CTO · Founder of Injuria.ai
For almost the entire history of the web, the browser had exactly one native language: JavaScript. There had been other ways to run code in a page, Java applets, VBScript in Internet Explorer, ActionScript inside Flash, but those were plugins or vendor-specific, and all of them died. JavaScript was the only language every browser could run on its own. If you wanted your code to execute on a page, you wrote it in JavaScript or compiled down to JavaScript and hoped it was fast enough. WebAssembly, usually shortened to Wasm, changed that. It gives the browser a second thing it can run natively, a compact and fast format dozens of languages can target, and it did so without replacing JavaScript or breaking a single existing page.[1]
What it actually is
WebAssembly is a binary instruction format. Instead of shipping human-readable source, you ship a compiled module of low-level instructions the browser can validate and execute quickly.[8] It is designed around a stack-based virtual machine, a simple model where instructions push and pop values from a stack, which is easy to verify for safety and to translate to real machine code.[2] The same module runs the same way across browsers and operating systems.
It is a compile target, not a language you write by hand. You write Rust, C, C++, or Go, and a compiler produces a .wasm file. There is a text format for reading and debugging, but almost nobody authors it directly.
(module
(func (export "add") (param $a i32) (param $b i32) (result i32)
local.get $a
local.get $b
i32.add))
That is the human-readable view of a module that adds two integers. In practice your compiler generates the binary equivalent, and you call the exported add from JavaScript as if it were a normal function.
It did not come from nowhere
The clean story is that Wasm appeared and broke JavaScript's monopoly, but it had two direct ancestors worth crediting. Mozilla's asm.js showed you could write a strict, statically-typed subset of JavaScript that engines could optimize aggressively, proving near-native speed was possible in a browser. Google's Native Client, NaCl, took a different route, running sandboxed native code directly. Neither won, but together they proved the concept and led the browser vendors to collaborate on a proper standard, which is what Wasm is. It is less a revolution than the shipped, agreed-upon version of ideas that had been circulating for years.[9]
Where the speed comes from
JavaScript is flexible and has gotten remarkably fast, but it has ceilings. It is dynamically typed, so the engine spends effort at runtime figuring out what your values are, and its performance can be unpredictable, because the engine optimizes based on guesses and sometimes throws that work away when a guess turns out wrong. A Wasm module arrives already compiled to low-level instructions with explicit types, so the browser does far less guesswork and the performance stays consistent rather than warming up and occasionally stumbling. It is not always faster than the best possible JavaScript, but it is more predictable, which for compute-heavy work is usually what you actually want.
Wasm also runs inside the same security sandbox as everything else in the browser. A module cannot reach out and touch your files or memory on its own. It can only do what the page explicitly hands it, which is why the browser can run untrusted compiled code from anywhere without the risks that sank native plugins.
The boundary, and the memory
The part people underestimate is the boundary between Wasm and JavaScript. Wasm on its own has no direct access to the page, the DOM, or browser APIs, so to change what is on screen it calls into JavaScript, which is still the glue to the browser. Crucially, a Wasm module works inside a single contiguous block called linear memory, essentially one big resizable array of bytes shared with JavaScript. Simple numbers cross the boundary cheaply, but anything structured, a string, an object, an image, has to be serialized into that shared memory and read back out, and that copying has a cost. A lot of real-world Wasm performance work is really about minimizing trips across this boundary. It matters because it explains both the strength and the awkwardness of the model.
The languages that reach it, including new ones
Rust has become the most popular language for serious WebAssembly work, with mature tooling.[10] C and C++ compile to Wasm through the Emscripten toolchain, which is how decades of existing native code reached the browser, though modern LLVM can also target Wasm directly without Emscripten for code that does not need its browser-API shims. The bigger recent news is WasmGC, a built-in garbage-collection capability enabled in Chrome, Edge, and Firefox in late 2023, but not in Safari until late 2024, which lets managed languages like Java, Kotlin, and Dart compile to Wasm efficiently instead of each bundling its own heavy runtime.[6] The set of languages that can target Wasm well keeps widening.
It complements JavaScript, it does not replace it
This is the part people most often get wrong. Wasm is not trying to kill JavaScript and would be a poor choice for most of what JavaScript does well.[8] The healthy pattern lets each do what it is good at: JavaScript handles the interface, the events, and the orchestration, while WebAssembly handles the heavy, numeric, performance-sensitive core. A photo editor runs its filters in Wasm while JavaScript manages the buttons and layout, the two calling back and forth across that small, carefully managed boundary.[11]
What it unlocks, in and beyond the browser
The clearest examples are applications that used to be impossible in a browser. Figma runs its editor largely in WebAssembly, a big reason a browser tab can feel like a desktop app.[7] The ffmpeg media toolkit was compiled to Wasm, so video processing happens locally without uploading files. Games built in engines like Unity ship to the web through Wasm.[9] And the idea turned out to be bigger than the browser. If Wasm is a safe, portable, fast way to run code in a sandbox, the sandbox need not be a browser. The WebAssembly System Interface, WASI, defines a controlled way for modules to talk to a host system, opening the door to servers and the network edge, where a Wasm module starts in a fraction of the time a container takes and runs in tight isolation.[4][12] The current frontier, the Component Model, aims to let modules written in entirely different languages interoperate natively without JavaScript glue at all.[5]
Why it matters
WebAssembly ended the browser's single-language era without the disruption such a change usually brings.[13] It lets fast code from almost any language run on the web safely, it gives existing native codebases a path to the browser, and it is quietly becoming a portable runtime well beyond the browser itself. The reason I think it matters more than the hype suggested, and in a quieter way, is that it reframed the browser from an application you run inside to a universal, secure place to run anything. You may never write a line of it directly. The web keeps getting more capable because it is there.
Sources (13)
- WebAssembly (official site)
- WebAssembly Core Specification
- MDN Web Docs: WebAssembly
- WebAssembly System Interface (WASI)
- WebAssembly Component Model
- V8 blog: garbage-collected languages on WebAssembly (WasmGC)
- Figma: "WebAssembly cut Figma's load time by 3x"
- Rick Battagline, The Art of WebAssembly (No Starch Press, 2021)
- Mike Rourke, Learn WebAssembly (Packt Publishing Ltd, 2018)
- Kevin Hoffman, Programming WebAssembly with Rust (The Pragmatic Programmers LLC, 2019)
- Sendil Kumar Nellaiyapen, Practical WebAssembly (Packt Publishing Ltd, 2022)
- Jianguo Chen, Xiaonan Luo, Yuanlong Yu, Blockchain and Trustworthy Systems (Springer Nature, 2026)
- Brian Sletten, WebAssembly: The Definitive Guide ("O'Reilly Media, Inc.", 2021)