Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions demos/run-fib.tape
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,25 @@ Sleep 220ms
Enter
Sleep 2s

Type "wago module imports fib.wasm"
Type "wago module exports fib.wasm"
Sleep 220ms
Enter
Sleep 2s

Type "wago run fib.wam"
Type "wago fib.wam"
Sleep 260ms
Backspace
Type "sm 30"
Sleep 220ms
Enter
Sleep 3s

Type "wago compile --invoke fib fib.wasm"
Sleep 220ms
Enter
Sleep 6s

Type "./fib 30"
Sleep 220ms
Enter
Sleep 3s
57 changes: 26 additions & 31 deletions getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,13 @@ curl -fsSL https://install.wago.sh/cmd | cmd
</Tab>
</Tabs>

The bootstrap downloads a checksummed installer for your platform, then walks you through the destination and `PATH` setup. Go is only needed if Wago cannot download a release manager and has to build one from source.

Open a new terminal if the installer changed your `PATH`, then make sure the manager is ready:

```sh
wago --version
```

The manager handles versions and projects. It intentionally does not bundle a runtime.
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 without installing the CLI:
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
Expand All @@ -62,25 +58,25 @@ wago version install
![Downloading, inspecting, and running the Fibonacci module](/demos/run-fib.gif)

```sh
curl -fsSL \
https://wago.sh/corpora/fib.wasm \
-o fib.wasm
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 host requirements before running it:
You can inspect its exports before running it:

```sh
wago module imports fib.wasm
wago module exports fib.wasm
```

No imports means this module is self-contained. It does not need WASI, files, network access, or a custom host function.
The module exports a `fib (i32) -> i32` function. Without `--invoke`, Wago selects `_start`, then `main`, then the module's only exported function. If several exported functions remain, name one with `--invoke` or `-e`.

## 4. Run it

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

```sh
wago run fib.wasm 30
wago fib.wasm 30
```

You should see:
Expand All @@ -89,40 +85,39 @@ You should see:
fib(30) = 832040
```

Wago decoded and validated the module, compiled it to native code, created an instance, selected the exported function, converted `30` to the argument type from the Wasm signature, and printed the result.
## 5. Try the everyday commands

`run` is the default command, so this is equivalent:
Create a standalone executable:

```sh
wago fib.wasm 30
wago compile --invoke fib fib.wasm
```

## 5. Try the everyday commands
Standalone executables default to `_start`, so `--invoke fib` bakes the library-style function into this one.

Validate without executing:
<Tabs sync="run-os">
<Tab title="macOS / Linux">

```sh
wago validate fib.wasm
./fib 30
```

A successful validation is quiet.

Precompile it for faster startup on the same host architecture:
</Tab>
<Tab title="PowerShell">

```sh
wago build fib.wasm -o fib.wago
wago run fib.wago 30
```powershell
.\fib 30
```

Show the runtime, project, and plugin scope Wago selected:
</Tab>
<Tab title="Command Prompt">

```sh
wago status
```cmd
fib 30
```

::: warning Precompiled files are not portable releases
A `.wago` artifact is tied to its host architecture and Wago's compiled format. Keep the original `.wasm` and rebuild the artifact after an incompatible Wago upgrade.
:::
</Tab>
</Tabs>

## Where to go next

Expand Down
40 changes: 19 additions & 21 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,17 @@ description: A wonderfully quick, compact, and extensible WebAssembly runtime fo

Glad you're here!

## Pick your way in

<CardGroup>
<Card title="Run a Wasm file" href="/getting-started" icon="fa-play">
Install Wago, choose a runtime, and run a real module before moving on to the full CLI guide.
</Card>
<Card title="Embed Wago in Go" href="/guides/embed-wago" icon="fa-code">
Keep a runtime in your process, reuse compiled modules, and create isolated guest instances.
</Card>
<Card title="Connect Wasm to Go" href="/guides/host-functions" icon="fa-right-left">
Bind reflection-free host functions and exchange values through checked guest memory.
</Card>
<Card title="Extend Wago with plugins" href="/guides/plugins" icon="fa-plug">
Add WASI, host capabilities, compiler hooks, or custom WebAssembly features through the plugin system.
</Card>
</CardGroup>

## What is Wago?

Wago is a wonderfully quick, compact, and extensible WebAssembly runtime for Go.

Originally, we designed it with microcontrollers in mind. We figured that if it could run well on a tiny system, it could run even better on a conventional, more powerful one.

A quote has stuck with me throughout the project:

> “Fast hardware should bring excellence, not reason to waste it.”

We built Wago around that idea. It pushed us to cut overhead, memory use, and bloat instead of hiding them behind faster hardware. Our goal is to make Wago as fast and capable as possible without ever letting it grow wasteful.
We built Wago around this idea. Because of it, we pushed to cut overhead, memory use, and bloat instead of hiding them behind faster hardware. Our goal is to make Wago as fast and capable as possible without ever letting it grow wasteful.

We wanted the community to shape Wago too. Its plugin system lets users supply imports, control code generation, and even add custom WebAssembly features. Plugins can take Wago in new directions without forcing every new idea into the core runtime.
The community should shape Wago too. Its plugin system lets users supply imports, control code generation, and even add custom WebAssembly features. Plugins can take Wago in new directions without forcing every new idea into the core runtime.

## What's in the box?

Expand All @@ -46,3 +27,20 @@ We wanted Wago to be wonderful to use, so we've actually added quite a bit.
- **Manager**: install, swap, and update Wago runtimes across nightly, canary, or a specific commit.
- **Registry**: discover and publish extensions at [plugins.wago.sh](https://plugins.wago.sh).
- **Go API**: compile once, create isolated instances, call typed exports, access guest state, and honor cancellation inside your own process.

## Digging in

<CardGroup>
<Card title="Run a Wasm file" href="/getting-started" icon="fa-play">
Install Wago, choose a runtime, and run a real module before moving on to the full CLI guide.
</Card>
<Card title="Embed Wago in Go" href="/guides/embed-wago" icon="fa-code">
Keep a runtime in your process, reuse compiled modules, and create isolated guest instances.
</Card>
<Card title="Connect Wasm to Go" href="/guides/host-functions" icon="fa-right-left">
Bind reflection-free host functions and exchange values through checked guest memory.
</Card>
<Card title="Extend Wago with plugins" href="/guides/plugins" icon="fa-plug">
Add WASI, host capabilities, compiler hooks, or custom WebAssembly features through the plugin system.
</Card>
</CardGroup>
Binary file modified public/demos/run-fib.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.