⚙️ WebAssembly a second language, hiding in every browser
Your browser ships a stack machine that runs compiled bytecode at near-native speed. C, C++, Rust, Go, and Fortran compile to it — that's how Photoshop, AutoCAD, and Unity run on the web. The module below wasn't compiled by anything: it was assembled by hand, byte by byte, and lives in this page as an array of numbers.
The entire module — 95 bytes
Running it
add(2, 3) → …
sumto(100) (a real WASM loop) → …
Race: the same loop in JS vs WASM
Sum 1…N with 32-bit wraparound (both sides use i32 math, so results match — and yes, they overflow, because this is real low-level arithmetic):
| Result (i32) | Time | |
|---|---|---|
| JavaScript | — | — |
| WebAssembly | — | — |