BrowseComputing & AI / Web & Runtime Technology

WebAssembly

WebAssembly (Wasm) is a compact, portable binary instruction format designed as a compilation target for languages such as C, C++, and Rust. In a browser it runs inside a sandbox alongside JavaScript rather than replacing the browser or DOM.

Explanatory diagram for WebAssembly.
Local explanatory diagram

A useful mental model is:

source language → compiler → Wasm module → host runtime.

The Wasm module gets computation, linear memory, tables, and explicitly imported host functions. It does not inherently get arbitrary access to files, sockets, the DOM, or the operating system; the host decides which capabilities to expose.

Big idea: WebAssembly is a portable machine-code-like target with a deliberately constrained interface to its host.

Wasm is often fast because browsers can validate/compile its typed low-level instructions efficiently and because it lets mature native-language code run on the web. But Wasm is not automatically faster than JavaScript. Highly optimized JavaScript can be excellent, and crossing the JS↔Wasm boundary or manipulating the DOM can dominate workloads.

Outside browsers, systems such as WASI define standardized host interfaces for Wasm runtimes, making the format useful for plugins, edge/server workloads, and portable sandboxed components too.

This is why your GA Playground could keep its C++ core and compile it to a browser demo instead of rewriting the algorithm in JavaScript.

sources

WebAssembly official site/specificationW3C WebAssembly specificationWebAssembly design goals