API Reference wasm v#0.1.0

View Source

Modules

Run a WASI command module and get its exit status and output back.

Optional native file access that closes the WASI path race.

File access for WASI, over whichever backend is available.

The network capability.

Capability-scoped path resolution.

WASI Preview 1, as an Erlang host interface.

Sockets, as WASI descriptors.

A WebAssembly runtime for Erlang/OTP.

Application callback.

Compiled code, kept on disk so a node restart does not pay for it again.

Who is still using a piece of generated code, and when its slot may be reused.

Names and bounds for generated code.

WebAssembly binary format decoder.

The 0xFE opcode space: threads. Add an atomic instruction here.

Instruction and expression decoding.

The 0xFB opcode space: garbage collection.

The 0xFD opcode space: fixed-width SIMD. Add a vector instruction here.

Node-wide resource accounting.

Structured errors and traps.

The interpreter.

Mutable globals that two instances can share.

The garbage-collected object store.

Instantiation: turning a validated module into something executable.

When a module gets compiled, and how a call reaches the result.

The processes that compile modules, under supervision.

The authority on who still holds a shared resource.

LEB128 varint decoding, strict per the WebAssembly binary format.

Resource limits, and an honest account of what they do not cover.

Linear memory backed by chunked atomics arrays.

Compiled modules, cached node-wide and keyed by content hash.

Conversion between IEEE 754 bit patterns and the runtime float representation.

Floating-point arithmetic over the hybrid representation wasm_num describes.

Float to integer truncation, both families. Read this if a conversion traps where you expected a clamp, or the other way round.

Fixed-width SIMD: v128 values and the operations on them. Read this before you add a vector instruction, or when you want to know what one costs.

Root supervisor. What application:ensure_all_started(wasm) gets you

Tables, with reference semantics.

Type identity: when two declared types are the same type. Read this when a cast or an import you expected to succeed is being refused as a type mismatch.

Module-level validation. This is what decides whether you get {error, #{class := invalid}} back, and everything it proves is what the interpreter is then allowed to assume.

Types and alignment for the 0xFE opcode space.

Function body validation. Read this when a module you believe is well typed is being rejected.

Operand types for the 0xFD vector opcode space. Add a vector instruction's types here, alongside its decoding.

memory.atomic.wait and memory.atomic.notify. Read this when a threaded guest is parked and you want to know who is meant to wake it.

Specification scripts: the .wast format the conformance suite is written in. You want this only if you are running the suite.

The text format, parsed into the same #module{} the binary decoder produces.

What immediate an instruction takes, by name. Add a text-format instruction here if, and only if, it carries an immediate.

Tokens of the WebAssembly text format. Start here when the text parser rejects something it should accept.

Numeric literals of the text format. Read it when a literal round-trips to bits you did not expect.

Tokens to a tree, and the thing that tells you where your parenthesis is missing.