Figma, Photoshop-on-web and in-browser video editors aren't JavaScript miracles — they're WebAssembly. The concept, minus the hype:
What it is
WASM is a compact binary instruction format browsers execute at near-native speed. Code written in C++/Rust/Go compiles TO WebAssembly and runs alongside JavaScript — same page, same sandbox.
// Rust → compiled to .wasm
fn fibonacci(n: u32) -> u64 { ... }
// JavaScript loads and calls it
const { instance } = await WebAssembly.instantiateStreaming(fetch("math.wasm"));
instance.exports.fibonacci(40); // ~10–50x faster than the JS versionWhat it is NOT
- Not a JS replacement — WASM has no DOM access; JS orchestrates, WASM crunches
- Not automatically faster for everything — crossing the JS↔WASM boundary has costs; DOM-heavy apps gain nothing
Where it wins
- Ports of native code: games (Unity), Photoshop, AutoCAD, SQLite in the browser
- Heavy computation: image/video processing, crypto, ML inference (many in-browser AI demos)
- ffmpeg.wasm: video conversion entirely client-side — no upload needed
Fresher takeaway
You almost certainly won't write WASM — you'll use libraries built on it. The interview-ready summary: "compiled languages targeting a fast browser runtime; JS for glue and UI, WASM for compute." Pair with Web Workers and heavy work never touches the main thread.
← All Articles