WebAssembly
A portable, sandboxed bytecode that browsers and other hosts compile to fast native code.
WebAssembly, or Wasm, is a compact binary instruction format designed as a compile target. Languages like C, C++, Rust, Zig and Go compile to it, and the host (a browser, Node, an edge runtime or a standalone engine) compiles the bytecode to native machine code before running it. Speed is usually within a small factor of native.
Its defining property is isolation. A Wasm module gets one linear block of memory and can call only the functions its host imports into it. It has no direct access to files, the network or other memory. That makes it a strong sandbox. Browsers have tested it against hostile code for years, which is why people reach for it to run untrusted or agent-written code.
The core spec is deliberately small, so most capability comes from the host. In a browser that means JavaScript APIs and Web Workers. Outside the browser, WASI supplies files, clocks and sockets. Newer proposals add threads and shared memory, SIMD, garbage-collected types, and JSPI (JavaScript Promise Integration), which lets Wasm pause on asynchronous work. Full operating systems in the browser rely on JSPI.
In practice Wasm shows up as plugins and extensions, edge functions, ports of desktop apps like image editors and CAD tools, language runtimes such as Python in the browser, and whole virtual machines running in a tab.
WASI
The WebAssembly System Interface, a standard set of OS-like capabilities (files, clocks, sockets) for Wasm outside the browser.
WASI, the WebAssembly System Interface, is a standard way for a WebAssembly program to talk to the operating system around it. WebAssembly on its own can only compute. WASI adds the things a command-line program expects, such as reading files, getting the time, reading environment variables and opening sockets, in a form that doesn't depend on any one OS or CPU.
WASI is capability-based. A program can't open any file it likes. The host hands it specific directories or sockets at startup, and nothing else exists for it. That makes WASI programs easy to sandbox: run the same .wasm file under wasmtime, Wasmer or WasmEdge, and grant only the folder it needs.
The standard has been delivered in stages. Preview 1 covered basic POSIX-like calls. Preview 2 moved to the component model with typed interfaces such as HTTP. Some runtimes go further with their own extensions. WASIX, for example, adds threads, process spawning and full sockets so that tools like bash and curl can run unmodified.
WASI also runs in the browser through shims that implement its calls on top of JavaScript. Some tools use this to run converted containers or language runtimes inside a tab.