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.