Maximizing Go's Capabilities with the WebAssembly System Interface

21st March 2024

Rajiv Ranjan Singh

Achille Roussel

Agenda

2

Speaker - Rajiv Ranjan Singh

3

Speaker - Achille Roussel

4

An open-source community journey

5

WebAssembly Architectures

6

The WebAssembly System Interface (WASI)

7

Why is WASI important?

8

What is Go?

9

An example Go program

package main

import "fmt"

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

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
11

Go is also an ecosystem

12

History of WASI Support in the Go Toolchain

13

Task #1: Learn the Craft

14

Task #2: Power Through

15

Task #3: Deliver the Product

16

Task #4: Celebrate

17

Using the go:wasmimport directive

package main

import "unsafe"

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

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!
19

Making Go plugins with wasip1

20

Kube Scheduler Wasm Extension

21

Go wasip1 in a nutshell

22

When to use Go vs TinyGo when targetting WASI?

23

The future of WASI in Go

Three main workstreams:

24

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.)