Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upwasm: re-use //export mechanism for exporting identifiers within wasm modules #25612
Comments
agnivade
added
the
Arch-Wasm
label
May 28, 2018
ianlancetaylor
added
the
NeedsInvestigation
label
May 31, 2018
ianlancetaylor
added this to the Unplanned milestone
May 31, 2018
sbinet
referenced this issue
Sep 20, 2018
Open
syscall/js: Make syscall/js optional when compiling wasm? #27766
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sbinet commentedMay 28, 2018
Right now, compiling the following piece of Go code:
like so:
will produce the following
foo.wasmmodule:especially:
ie: the user can not control what is exported.
the recommended way to export something currently, is to use
js.NewCallback.this is - mainly - because one needs to setup a few things for the Go and js runtimes to cooperate nicely together.
I would argue that, in the same spirit than when one compiles the same
main.gofile with-buildmode=c-shared, it should be possible to achieve the same thing forGOOS=xyz GOARCH=wasm, and only export what is//export-ed.initialization of the runtime(s) would be performed via the wasm module's start function.
(this is a re-hash of neelance#22.)