Skip to content

Getting started

This guide takes you from an empty machine to a successful WebAssembly call. You will install the Wago version manager, select a runtime, download a tiny module, and run it.

Installing Wago and selecting a canary runtime

Install the manager

bash
go run github.com/wago-org/wago/cli/wago-installer@latest
bash
curl -fsSL https://install.wago.sh/unix | sh
powershell
irm https://install.wago.sh/ps | iex
sh
wago --version

You can think of the wago command as a version manager. It handles version installing, upgrading, and switching. In order to run wasm, you need to install the actual runtime.

If you only need Wago as a library in an existing Go project, add the package directly:

sh
go get github.com/wago-org/wago

Install a runtime

sh
wago version install

Download a small module

Downloading, inspecting, and running the Fibonacci module

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

This module exports a function named fib. It takes one i32 argument and returns the corresponding Fibonacci number.

You can inspect its exports before running it:

sh
wago module exports fib.wasm

The module exports a fib (i32) -> i32 function. Without --invoke, Wago selects _start, then main, then the module's only exported function—in this case, fib. If several exported functions remain, name one with --invoke or -e.

Run it

In this case, fib is the only exported function, so Wago selects it automatically:

sh
wago fib.wasm 30

You should see:

text
832040

Try the everyday commands

Wago uses either Go 1.22 or newer or TinyGo 0.41.1, the tested TinyGo baseline, to link standalone executables. Make sure one of them is available on PATH.

Create a standalone executable:

bash
wago compile fib.wasm -o fib
./fib 30
powershell
wago compile fib.wasm -o fib.exe
.\fib.exe 30
cmd
wago compile fib.wasm -o fib.exe
fib.exe 30

Where to go next

Released under the Apache 2.0 License.