Free to LearnSystems fieldbooksLesson 1
Fieldbooks/WebAssembly/Start Here
00 · Start Here & Course index

Start Here / 3-Minute Visual Primer

What Is WebAssembly (Wasm) & Bytecode Verification?

A 3-minute, zero-jargon guide to how browsers, Cloudflare Workers, and plugin sandboxes run compiled C++ and Rust safely at near-native speed.

+ Sandbox Model
Untrusted plugin bytecode verified before running inside a 64 KiB page.
Pre-flight verifier + 64 KiB isolated memory
Part 1 · Why WebAssembly Exists

How Do Browsers & Edge Clouds Run Untrusted C++ and Rust Safely?

When you open a Figma canvas, run code on Cloudflare Workers, or load a desktop app plugin, that code may have been compiled from C++ or Rust by a stranger. Running raw machine code directly on your CPU could read passwords out of neighboring memory or crash the app.

WebAssembly (Wasm) solves this in two steps: first, a fast bytecode verifier scans every instruction once before execution to guarantee stack types and jump targets are legal. Second, all memory reads and writes stay trapped inside one isolated 64 KiB memory wall (bytes 0..65535).

Raw Native Plugin (Unsafe)Can jump to arbitrary addresses, misread floats as pointers, or write past buffers into host application memory.
Verified Wasm Sandbox (Safe & Fast)Checked in one linear pass before running; structured jumps + out-of-bounds memory checks guarantee zero sandbox escapes.
Part 2 · Interactive Stack Machine Tray Walkthrough

Click Each Step to Watch the Wasm Operand Stack Work

WebAssembly has no CPU register names like r1. Instead, values live on an operand stack (a push/pop tray where new items enter at the right). Try stepping through 10 + 20:

[ ] Empty Tray
WebAssembly uses a push/pop tray (called the operand stack) instead of CPU register names. Right now the tray is empty.
Part 3 · Interactive 64 KiB Memory Wall

Why Byte 65,536 Traps Immediately

Every Wasm module gets its own byte array starting at 0. One page holds 65,536 bytes (indices 0..65535). Click below to test a 4-byte i32.store near the wall:

ALLOWED: Bytes 65532, 65533, 65534, and 65535 all sit inside page 0 (< 65536). Value 42 (0x2A) is written cleanly.
Part 4 · Plain-English Glossary & 8-Chapter Roadmap

Six Terms You Will Use Across All 8 Chapters

WebAssembly (Wasm)A compact, portable binary instruction format that lets C++, Rust, and Go run inside browsers and edge workers at near-native speed.
Operand StackA push/pop tray of typed values. Instructions pop their inputs from the right (top) and push their result back on top.
Value Types (i32 / i64 / f32 / f64)i means whole integer, f means decimal floating-point, and 32/64 is the bit width. Every slot on the stack carries its exact type tag.
Bytecode VerifierA fast pre-flight checker that scans every instruction once BEFORE execution, proving no instruction ever underflows or mismatches stack types.
64 KiB Memory WallEach plugin receives its own isolated array of bytes (1 page = 65,536 bytes, indices 0..65535). Any read or write hitting 65536+ traps immediately.
Block & Jump (br 0)block...end groups instructions; br 0 jumps cleanly out of the nearest enclosing group, skipping any leftover instructions behind it.
Chapters 1–4

Stack Types, Jumps & Unreachable Floors

See why Wasm accepts unreachable code behind br 0 while trapping bad writes, enforce i32/f32 stack types, and trace nested loop/block targets.

Chapters 5–6

64 KB Memory Walls & Indirect Calls

Prevent 32-bit wraparound bugs from sneaking past page bounds, and verify host function signatures at indirect call tables.

Chapters 7–8

Verifier Architecture & Audit Exam

Compare single-pass streaming validation against two-pass control-flow graphs, then audit and patch a real plugin before sign-off.