(no title)
adrianfcole | 3 years ago
waPC [1] (used by some things like kubewarden) is an example of a plugin system, and its go integration [2] is one of the few things currently using wazero. It also integrates with alternatives such as wasmer and wasmtime, so you can look at the code to see how things are different.
We were intentionally hush about the project as we finish version 1.0, so weren't pushing for a lot of integrations, rather serving early adopters. Hence, wapc-go is currently the main victim of our api ;)
hope this helps!
skybrian|3 years ago
adrianfcole|3 years ago
Anyway, if you use `wazero.NewRuntime()` magically it redirects to `wazero.NewRuntimeCompiler()`[1]. When the compiler is in use, all the native stuff happens automatically and you don't need to change your binary based on the wasm you use.
This is actually neater than it seems as embedded compiler is goroutine safe, meaning you can compile modules concurrently.
https://pkg.go.dev/github.com/tetratelabs/wazero#NewRuntimeC...