Registry / other / bytecodealliance-wasmtime-go-v3

bytecodealliance-wasmtime-go-v3

JSON →
library3.0.2gogounverified

Package wasmtime is a WebAssembly runtime for Go powered by Wasmtime.

go get github.com/bytecodealliance/wasmtime-go/v3
INSTALL
IMPORT
SIG · BYTECODEALLIANCE-W
B
bytecodealliance-wasmtime-go-v3
othergov3.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

wasmtime
github.com/bytecodealliance/wasmtime-go/v3

Compiles a simple WebAssembly module and calls an exported add function.

package main import ( "fmt" "github.com/bytecodealliance/wasmtime-go/v3" ) func main() { engine := wasmtime.NewEngine() store := wasmtime.NewStore(engine) wasm, _ := wasmtime.Wat2Wasm("(module (func (export \"add\") (param i32 i32) (result i32) local.get 0 local.get 1 i32.add))") module, _ := wasmtime.NewModule(engine, wasm) instance, _ := wasmtime.NewInstance(store, module, []wasmtime.AsExtern{}) add := instance.GetFunc(store, "add") result, _ := add.Call(store, 1, 2) fmt.Println(result) }
Debug
Known issues
breakingVersion 3.0.0 introduced breaking changes from v2, including API restructuring.
fix
Update import path to /v3 and adjust code for new API.
affects: >=3.0.0
Upgrade
Version history
3.0.2latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
10
OpenAI (training)
2
Amazon
1
Bingbot
1
Resources
bytecodealliance-wasmtime-go-v3 — go get bytecodealliance-wasmtime-go-v3 · libregistry