-
Notifications
You must be signed in to change notification settings - Fork 122
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
panic: unknown module: go #40
Comments
Hello, Life itself focuses on execution of pure WebAssembly modules; Go modules compiled down to WebAssembly require some external functions to be available under a namespace titled In order to support Go modules compiled down to WebAssembly, it is a matter of creating an import resolver that provides implementations of all the external functions necessary under Import resolvers may be created for supporting virtually any kind of functionality; even for supporting interfacing with the GPU or creating a GUI straight from a WebAssembly module for example. The We would really love for any initial work done by the community for specifically supporting Go modules compiled down to WebAssembly, or otherwise look into further work on having the Go compiler spit out pure WebAssembly modules (rather than rely on an external set of functions from a defined It unfortunately isn't one of our biggest priorities right now to be creating stub implementations for said import resolvers, though we are more than happy to help should anyone look to kickstart one off (for Go for example). |
Having the same problem package main
import "fmt"
func main() {
fmt.Println("Hello, WebAssembly!")
} GOOS=js GOARCH=wasm go build -o main.wasm $ ./life -entry '' main.wasm
Resolve func: go debug
panic: unknown module: go
goroutine 1 [running]:
main.main()
/Users/mota/.gvm/pkgsets/go1.11/global/src/github.com/perlin-network/life/main.go:79 +0x886 would be helpful to see a working example of compiling Go to WASM that can be resolved by this library |
@losfair It's fair to lock this issue to prevent me toos. But it still an open issue that most who try Life with Go will hit. Closing it is misleading. And it deters community contribution; which was requested above. |
@glycerine Life itself is a virtual machine and we think runtime support like the Go runtime is out of scope of this project. Discussions in #23 provide some suggestions on running Go on Life though. |
@losfair I'm surprised you aren't compiling from Go, since Life is written in Go. Out of curiousity, how are you generating your wasm code to run on Life? |
Hello, anyone have any luck using Life's Import resolvers to use go-compiled wasm modules within Life? |
osx high sierra, v10.13.6
A basic test of
life
and the output of the go11 wasm produces the errorpanic: unknown module: go
.The text was updated successfully, but these errors were encountered: