wasmerio / wasmer-go

🐹🕸️ WebAssembly runtime for Go
https://pkg.go.dev/github.com/wasmerio/wasmer-go
MIT License
2.83k stars 161 forks source link

Add interface types support #75

Open mfateev opened 5 years ago

mfateev commented 5 years ago

Thanks for proposing a new feature!

Motivation

I would like to embed Go wasm code. Currently Go comes with syscall/js bindings. Having them implemented in go-ext-wasm would allow easy communication with the hosted Go code.

Proposed solution

Implement API bindings to syscall/js.

Alternatives

The better alternative would be a native way to bind to the hosted Go process functions. Ideally allowing more complex argument types like structures.

mfateev commented 5 years ago

It looksl ike interface types is the way to go: https://hacks.mozilla.org/2019/08/webassembly-interface-types/

Hywan commented 5 years ago

WebAssembly Interface Types (WIT) has changed a lot since the Mozilla blog post. We are working on implementing it, see https://github.com/wasmerio/wasmer/pull/787/. I think it will drastically change the Wasm landscape.