5 exercises on WebAssembly terms — memory, system interface, and tooling.
0 / 5 completed
1 / 5
In WebAssembly, what is linear memory?
WebAssembly linear memory is a single, contiguous, resizable array of raw bytes that serves as a module's heap. It is addressed by zero-based integer offsets and can grow in 64 KiB pages. Because the host validates every access against the memory's bounds, a Wasm module cannot read or write outside its own sandbox — a key security property. The host (e.g. JavaScript) can also read and write this same buffer, which is how values like strings and arrays are passed across the boundary, since Wasm itself only has numeric value types.
2 / 5
What is WASI?
WASI (WebAssembly System Interface) is a standardized set of APIs that lets WebAssembly run outside the browser while still accessing operating-system-like capabilities — files, clocks, random numbers, networking — in a portable, secure way. It follows a capability-based security model: a module can only touch resources (like a specific directory) that the host explicitly grants it, rather than the whole filesystem. WASI makes Wasm a viable target for server-side and CLI applications, enabling "write once, run anywhere" binaries independent of OS and CPU architecture.
3 / 5
What does wasm-bindgen do?
wasm-bindgen is a Rust tool and library that bridges the gap between Wasm's numeric-only ABI and high-level types. It generates the JavaScript and Rust glue needed to pass strings, structs, closures, and JS objects across the boundary, and it lets Rust import and call browser/JS APIs. You annotate Rust functions and types with #[wasm_bindgen], and the tool emits a typed JS wrapper plus TypeScript definitions. It underpins much of the Rust-to-web workflow, handling memory marshalling that would otherwise be tedious and error-prone.
4 / 5
What is the WebAssembly component model?
The component model is an emerging standard that builds on core Wasm to enable interoperable, composable software components. It introduces interface types and the WIT (Wasm Interface Type) language so components can exchange high-level data — strings, records, lists, variants — without hand-written glue, regardless of source language. Components encapsulate their own memory and only communicate through typed interfaces, improving safety and reuse. This lets you, for example, write one component in Rust and another in Python and link them together, with WASI itself redefined in component-model terms.
5 / 5
What is wasm-pack?
wasm-pack is a build orchestration tool for shipping Rust as WebAssembly to the JavaScript ecosystem. It compiles your Rust crate to Wasm, runs wasm-bindgen to generate the JS bindings and TypeScript types, optionally optimizes the binary with wasm-opt, and assembles an npm-ready package complete with a package.json. It supports several targets (bundler, web, nodejs) depending on how the output will be loaded. In short, it turns the multi-step Rust-to-web toolchain into a single command, smoothing publishing to npm.