Web Assembly
12-21-2025
The web runs on JavaScriptFor better or for worse. If you know anything about this language, you'll know that it was never meant for heavy computation, predictable performance, advanced memory control, etc. So how do programmers create games, physics simulations, and other programs/applications that rely on the principles mentioned above? The answer is Web Assembly. Casually known as WASM, Web Assembly allows programmers to compile performant languages like C, C++, and Rust and run their code in a sandboxed environment within the browserIt also can run outside of the browser.
Under the hood, WASM is a low-level, binary instruction format that provides a new execution layer to the browser. However, it comes with limitations. Since it runs in a sandbox, WASM programs have no OS or filesystem. It is entirely stack based, only supporting structured control flow. Another important thing to note is that while communication between JS and WASM is possible, it is not freeSimilar to C-bound python functions.
As mentioned earlier, WASM can run outside of the browser via WASI, or the Web Assembly System Interface. WASI provides WASM with useful tools:
- Files
- Clocks
- Env Vars
WASI provides some interesting use cases, allowing WASM to take on different roles in developing cloud systems, edge computing, and deterministic compute.