Skip to content

Examples

Every page in this section walks through a program that exists in the repository and runs in CI. Nothing here is a sketch: the guests are real .wasm files built by real toolchains, and the host code is the file you can open beside it.

Terminal window
git clone https://github.com/samyfodil/wazy && cd wazy
make test.examples

That builds nothing and downloads nothing — the guest binaries are committed. Each tutorial also gives the command for its own example alone, and the toolchain command that produced its guest if you want to rebuild it.

Start here if you have a .wasm and a Go program and want them talking. These examples use plain core modules: the interface is integers and a linear memory, and both sides agree on the layout by hand.

A component carries its own typed interface, so values cross as Go values and the hand-agreed layout above disappears. These four are the reason wazy exists as something other than a wazero fork.

The guides cover the same ground as reference rather than walkthrough, and pkg.go.dev has the generated API documentation. Getting started is the five-minute version of tutorial 01.

Missing an example you wanted? Open an issue.