Skip to content

Latest commit

 

History

853 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

╦ ╦ ╔═╗ ╔═╗ ╔═╗
║║║ ╠═╣ ║ ╦ ║ ║
╚╩╝ ╩ ╩ ╚═╝ ╚═╝

a wonderfully quick, compact, and extensible webassembly runtime for go

CI Go >= 1.22 Release License Discord

documentation · getting started · plugins · benchmarks · discord · sponsor us

Wago is a pure-Go WebAssembly engine that compiles Wasm directly to native machine code.

Note

Wago is still beta. If you'd like to have a hand in its future, please join our Discord

Why Wago?

  • Fast and lightweight. Using a few kilobytes of ram, we compile 5x quicker and execute 1.9x faster than wazero.
  • Pure Go. Embed Wago without CGO while keeping straightforward Go builds and cross-compilation.
  • Standards Compliant We pass the official WebAssembly test suite, millions of fuzzes, and many real-world corpora.
  • Extensible by design. WASI, the Component Model, and other host capabilities live outside the core runtime as plugins.
  • Standalone executables Compile your .wasm to tiny native executables. Great for CLIs.

Pronounced wag-oh

Install

On macOS and Linux:

curl -fsSL https://install.wago.sh/unix | sh

On Windows, in PowerShell:

irm https://install.wago.sh/ps | iex

Or run the installer with Go:

go run github.com/wago-org/wago/cli/wago-installer@latest

Run a module

Download and run a small Fibonacci module:

curl -fsSL https://wago.sh/corpora/fib.wasm -o fib.wasm
wago fib.wasm 30
832040

Build a standalone executable:

wago compile fib.wasm -o fib
./fib 30

Note

If you have any questions or want to invest in the community, please join our Discord

Use Wago from Go

Add Wago to your module:

go get github.com/wago-org/wago

Run the complete Go API example:

go run github.com/wago-org/wago/examples/23-public-api@latest

The example loads a checked-in .wasm fixture, registers host functions, compiles and instantiates it, and invokes exports by name and through a resolved WasmFunc. See Embed Wago in Go for the complete guide.

Register synchronous imports with ordinary Go functions. Wago infers supported hot signatures once and dispatches them without reflection or allocation:

imports := wago.NewImports()
imports.HostFunc("env", "add", func(a, b int32) int32 { return a + b })
imports.HostFunc("math", "hypot", func(a, b float64) float64 { return math.Hypot(a, b) })

For arbitrary arity, mixed scalar types, or references, use the same HostFunc method with func(wago.HostCall). The call is a borrowed logical view supported under both Go and TinyGo. Eligible wide scalar signatures use the parked argument/result slots directly. High-arity adapters can process the borrowed raw ABI slices directly with ParamSlots() and ResultSlots(). V128 values are intentionally unsupported at host callback boundaries for now.

Resolve an export once when it will be called repeatedly:

step, err := instance.WasmFunc("step")
if err != nil {
	return err
}
out, err := step.Invoke(wago.I32(41))

Invoke handles every supported arity. The returned slice is borrowed until the next invocation on that instance; copy slots that must survive another call. A WasmFunc does not hold an execution reservation between calls.

For high-frequency one-way (i32) -> () imports, wago.I32HostEvent avoids a Go stack transition for every call. Events are delivered in order after the native invocation returns. This is an explicit deferred contract; use a normal host function when Wasm must observe the callback's effects immediately.

Performance

View the benchmarks →

Add host capabilities

Wago keeps host integrations outside the core runtime. For example, add WASI to a project with:

wago init
wago add wago-org/wasi

Use wago add --allow-all wago-org/wasi to install all subpackages, grant their requested Authorities, and accept the proposed exact Contract bindings without prompting. Explicit --scopes still narrows grants. -f / --force does not approve an installation.

See Use plugins or browse the plugin registry.

Platforms

Wago supports Linux, macOS, and Windows on amd64 and arm64. WebAssembly feature support varies by backend and host.

See the feature matrix for exact coverage.

Learn more

💖 We develop wago free-of-charge. If you or your company benefits from using wago or you'd like developement to continue, please consider sponsoring us! It'd truly mean the world

We use the Apache License 2.0 so you can enjoy wago too!

Documentation · Examples · Features · Architecture · Benchmarks · Roadmap · Contributing · Issues · Sponsor us!

P.S. pleaseeeee consider leaving us a star! i really believe in wago and if it makes it big some day, you'll know cuz you starred it!

About

a wonderfully quick, compact, and extensible webassembly runtime for go

Topics

Resources

Code of conduct

Contributing

Stars

17 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages