Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can compile for GOOS="wasip1" with Go 1.21, check out the builtin "gotip" command to use the master branch. Unfortunately exporting functions back to Go seems to be a work in progress, since "//go:wasmexport" directive is not yet implemented. Maybe for 1.22?

In addition to that, I added some constants to "..sdk\gotip\src\syscall\syscall_wasip1.go" by hand that were throwing errors about being undefined, just by copying the values from the default unix syscall package. They were about OS files and I figured I shouldn't need them for the WASI module.

But the documentation is lacking and sometimes out of date as you perhaps found out. I'm currently stuck at having the gRPC server object in Go, and the service implementation on the WASM side, and in need of a way to register that service on the server. This means for server.RegisterService(pb ServiceDesc, &server{}) I would need to smuggle out pb and a pointer to the implementation, or for server.RegisterService(pb ServiceDesc, &server{}) smuggle in a grpc.Server pointer...



To server the WASM and WASI19 and WASI2P, i use https://github.com/stealthrocket/wasi-go/tree/main/cmd/wasir... to wrap the wasi with a host runner. This currently requires GoTip.


To run the wasi, I use NATS.

It avoids all the GPRC mess You can instead use Proto and let NATS be be Transport.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: