Empowering Go with WebAssembly System Interface (WASI) Unleashed

14th March 2024

Rajiv Ranjan Singh

Achille Roussel

Agenda

2

Speaker - Rajiv Ranjan Singh

3

Speaker - Achille Roussel

4

An open-source community journey!

5

What is Go?

6

An example Go program

package main

import "fmt"

func main() {
    fmt.Println("Hello wasip1!")
}
7

Go is more than a language

The go program is the entrypoint to the Go toolchain. It standardizes how developers build and maintain their applications.

$ go build
$ go mod
$ go fmt
$ go test
$ go tool pprof
8

Go is also an ecosystem

9

History of WASI Support in the Go Toolchain

10

Task #1: Learn the Craft

11

Task #2: Power Through

12

Task #3: Deliver the Product

13

Task #4: Celebrate!

14

Using the go:wasmimport directive

package main

import "unsafe"

//go:wasmimport env fasthash
func fasthash(p unsafe.Pointer, n int32) uint64
15

Building Go program for wasip1

Simple two step process:

package main

import "fmt"

func main() {
    fmt.Println("Hello wasip1!")
}
$ GOARCH=wasm GOOS=wasip1 go build -o main.wasm main.go
$ wazero run main.wasm
Hello wasip1!
16

Making Go plugins with wasip1

17

Go wasip1 in a nutshell

18

When to use Go vs TinyGo when targetting WASI?

19

The future of WASI in Go

Three main workstreams:

20

Thank you

Rajiv Ranjan Singh

Achille Roussel

Use the left and right arrow keys or click the left and right edges of the page to navigate between slides.
(Press 'H' or navigate to hide this message.)