Wasmtime 为 WebAssembly 增加 Go 语言绑定
为提供更好的跨平台支持,WebAssembly 正在积极推动其在本地桌面端的进展。与此同时,Wasmtime(WebAssembly runtime)近期为它增加了 Go 绑定功能,这意味着开发者可直接在 Go 应用程序中调用 WebAssembly 模块。 Wasmtime 提供了 JIT 风格的 WebAssembly runtime,这是一个属于字节码联盟的项目,此前已为 Rust, C, Python 和 Microsoft .NET 提供了绑定,Go 语言则是其最新绑定的语言。 wasmtime-go 的代码已开源,下面介绍一个使用 wasmtime-go 编写 "Hello, world!" 的代码示例: package main import ( "fmt" "github.com/bytecodealliance/wasmtime-go" ) func main() { // Almost all operations in wasmtime require a contextual `store` // argument to share, ...

