What is WebAssembly — and why it only understands numbers

People usually say one thing about WebAssembly: "fast, like native code." True. But they leave out the other half, and the other half is the interesting part.
WebAssembly only understands numbers. That's it. No strings, no buttons, no network calls. Want to show text on the page? Go ask JavaScript. And that's not an oversight — it's deliberate design.
What WebAssembly is, in plain words
WebAssembly (Wasm for short) is a low-level binary format that browsers can execute very fast.
Almost nobody plans to write it by hand. Wasm is a compilation target: you take existing code in C, C++ or Rust, run it through a compiler, and get a file that runs in a tab. A library someone spent twenty years building for the desktop suddenly opens from a link.
The key point: Wasm doesn't replace JavaScript, it sits next to it. They split the work:
- JavaScript — flexible and alive, knows the DOM, the network, events, the whole package ecosystem.
- WebAssembly — a dumb, very fast calculator that takes a chunk of work and hands back a result.
Why it only understands numbers
Look inside a Wasm module and you'll find linear memory — one enormous array of bytes — plus instructions that shuffle numbers around it.
That wasn't an accident: in a language like C++, everything already is a number. A character is a number. A pointer is a number too — just an index into memory. Wasm inherited that logic from its ancestor asm.js, where C++ compiled down to a subset of JavaScript that only did arithmetic.
Which leads to the consequence that trips up beginners: Wasm can't touch the page directly. Creating an element, attaching a handler, calling fetch — it does all of that by calling into JavaScript. It can't even hand you a string: it hands back a number, the address where the bytes live in its memory, and JS assembles the string.
It also lives in a sandbox: the same origin rules and the same browser permissions as any script. Compiled C++ doesn't get access to your files just because it's C++.
Where the speed comes from
Three reasons, and "faster language" isn't the main one.
- Parsing. Wasm is a compact binary designed for machines. JavaScript is written by humans, so its syntax is redundant and the browser has to validate it before running. Figma's engineers measured it back in the day: Wasm parses roughly 20x faster than the equivalent asm.js.
- The optimisation already happened. The C++ went through a compiler with all optimisations before it ever became a Wasm file. The browser mostly translates instructions one-to-one. With JavaScript, the browser has to optimise on the fly, guessing at types.
- Cached machine code. The browser can happily cache the translation of a Wasm module to native code. Second visit, that step costs almost nothing.
Figma moved from asm.js to Wasm and got three times faster load times — and the win didn't depend on document size. The file itself barely shrank, though: after compression, asm.js weighs about the same. Wasm's speed is about how fast the browser gets to running your code, not about bytes on the wire.
What already runs on it
The list is genuinely impressive: image and video editors in the browser, game engines, emulators, entire databases like SQLite inside a tab, video processing with ffmpeg without uploading a single file.
For us, something else matters more — Wasm carries AI in the browser. Before WebGPU, models were computed exactly this way: on the CPU, through Wasm. Slow, but working. Today Wasm is the fallback path for anyone whose GPU isn't available, and that path isn't going anywhere.
The standard keeps moving too: Wasm 3.0 landed in September 2025. Three things from it worth remembering:
- 64-bit memory — a module used to cap out at 4 GB, on the web the ceiling is now 16;
- garbage collection — languages that clean up after themselves now compile to Wasm properly, not just C and Rust;
- exceptions — errors used to be routed through JavaScript, awkwardly and slowly.
Do I need to learn WebAssembly?
Probably not, and that's a fine answer. Wasm almost always arrives inside somebody else's library: you install a package, it ships a .wasm file, and things are simply faster. You write modules by hand when you're porting existing C++ or Rust to the web.
Will WebAssembly replace JavaScript?
No, and it isn't trying to. Wasm can't see the DOM, can't handle events, and isn't meant to. Its stated job is to complement JavaScript wherever raw computation matters. Which to pick for a given task: see WebAssembly vs JavaScript.
Is running someone's C++ in my browser safe?
Yes — about as safe as running an ordinary script. A Wasm module executes in the same sandbox under the same browser rules. It gets no filesystem access and can't bypass permissions; everything it can reach was handed to it explicitly by JavaScript.
The AI Architect 2027 course: step by step from computer basics to your own app and first customers. 543 short lessons on your phone.





