the zero dependency WebAssembly runtime for Go developers
WebAssembly is a way to safely run code compiled in other languages. Runtimes
execute WebAssembly Modules (Wasm), which are most often binaries with a
wazero is the only zero dependency WebAssembly runtime written in Go.
Get the wazero CLI and run any Wasm binary
curl https://wazero.io/install.sh | sh ./bin/wazero run app.wasm
Embed wazero in your Go project and extend any app
import "github.com/tetratelabs/wazero" // ... r := wazero.NewRuntime(ctx) defer r.Close(ctx) mod, _ := r.Instantiate(ctx, wasmAdd) res, _ := mod.ExportedFunction("add").Call(ctx, 1, 2)
By avoiding CGO, wazero avoids prerequisites such as shared libraries or libc, and lets you keep features like cross compilation. Being pure Go, wazero adds only a small amount of size to your binary. Meanwhile, wazero’s API gives features you expect in Go, such as safe concurrency and context propagation.
When can I use this?
You can get the latest version of wazero like this.
go get github.com/tetratelabs/wazero@latest
Please give us a star if you end up using wazero!