-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] tinygo not needed #562
Comments
https://github.com/yomorun/yomo/tree/master/example/7-wasm Should be updated |
Thanks for mention this @gedw99, we will try it! |
some example golang out there is still broken because of this. "CallImport" has now gone and been replaced with " //go:wasmimport". Here is an example of failing code for browser WASM. I know it does not really apply to the yomorun use cases but anyway. you need go1.21rc3 OR gotip...
go version
go version go1.21rc3 darwin/amd64
gogio -x -target js -o explorer.wasm .
go list -f {{.ImportPath}} .
go list -f {{.Dir}} .
go build -ldflags=-X gioui.org/app/internal/log.appID=org.gioui.explorer -tags= -o explorer.wasm/main.wasm .
gogio: go build -ldflags=-X gioui.org/app/internal/log.appID=org.gioui.explorer -tags= -o explorer.wasm/main.wasm . failed: # gioui.org/x/explorer
/Users/apple/go/pkg/mod/gioui.org/[email protected]/explorer/explorer_js.s:6: unrecognized instruction "CallImport"
/Users/apple/go/pkg/mod/gioui.org/[email protected]/explorer/explorer_js.s:10: unrecognized instruction "CallImport"
/Users/apple/go/pkg/mod/gioui.org/[email protected]/explorer/explorer_js.s:14: unrecognized instruction "CallImport"
asm: assembly of /Users/apple/go/pkg/mod/gioui.org/[email protected]/explorer/explorer_js.s failed And here is tinygo versus go for wasip1, which does relate to Yomorun. Note the GOOS is "wasip1": Again you need go1.21rc3 OR gotip ... tinygo build -o main.wasm -target wasm .
GOOS=wasip1 GOARCH=wasm go build -o main.wasm . |
I see, as go1.21 still in RC stage, we will support this after final release. |
It’s out now |
Ok cool thanks @fanweixiao |
Currently, tinygo has its limit for go code, for example, tinygo did not support msgpack, that means the 'yomo build' will fail if the code import msgpack package. If we introduce wasip1 as a 0-experimental level for advanced developers, would be a good idea? Wanna have your advise. |
Well I know me and many others are using golang wasm that is compiled as wasip1. So it works if compile using go or tinygo. So regarding Message pack I think you should try everything with the go compiler to see if everything works correctly. I know this is a very flakey answer but i don’t see any other way .. |
The main thing currently lack in go1.21 is YoMo depends this feature. |
and also mentioned on this hackernews thread: https://news.ycombinator.com/item?id=36387610
|
This is complex. wasip1 is incomplete in terms of the Wasm host runner and the compile exporter. So it’s a multi facetted problem space in the golang world. Maybe just stick with go 1.21 but compile wasip1 only using tinygo . wasip2 brings sockets and Wazero , wasi-run and TimeCraft are going to need to allow the host to use sockets to allow guest wasm to talk to the network. Windows support will be shakey. I know TimeCraft are not planning to support it. So just like linkedIn comments suggest, things are in flux. nothing either of use can do except mail down what works and watch the space .., |
Go now supports wasi compilation.
I have been using gotip also a d it’s been solid so far.
the go team and Wazero Team got it all working.
so the example wasm stuff should offer using go and not tinygo. Or offer both in the docs.
the gotip is also working.
it’s much much faster at compilation then tinygo too.
The text was updated successfully, but these errors were encountered: