wasm

Concepts

The validator, the host import surface, the trap model — the model you need to use the library beyond copy-paste.

The Quickstart shows the three common shapes of caller code. This section is about the model behind those shapes: what Runtime.instantiate actually does before it returns, how host imports get wired up, and what kinds of failures cross the API boundary.

  • ModuleInstance — what Runtime.instantiate returns and the public surface for invoking exports, reading globals, and touching linear memory.
  • Validation — what runs before any wasm code does.
  • Host importsHostModule and HostFunc from the inside.
  • Traps and errors — the WasmError model and what causes each variant.
  • Tracer — instrumentation hooks for opcode counts, function transitions, throws, and traps.

Pages

  • ModuleInstance — What `Runtime.instantiate` returns and the public surface for invoking exports, reading globals, and touching linear memory.
  • Validation — Every module passes a separate validator before any code runs. Bad binaries fail at instantiate time with a precise error.
  • Host imports — How guest modules reach into Scala — the `HostModule` surface for functions, globals, memories, and tables.
  • Traps and errors — The `WasmError` ADT, what causes each variant, and how runtime traps surface.
  • Tracer — Instrumentation hooks for opcode counts, function transitions, throws, and traps — wire one in via the optional `tracer` parameter on `invoke` / `Wasi.run`.

Search

Esc
to navigate to open Esc to close