-
Notifications
You must be signed in to change notification settings - Fork 951
WASM: Support for setting an imported function's module name #455
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
Conversation
We definitely need this. However, I'm slightly worried by adding two different ways to set the wasm module name: I would prefer to have just one. I have a slight preference for Related: golang/go#25612 |
Pinging to bring this PR back to life, hopefully... :) |
Thanks @deadprogram. @aykevl I agree with changing the stand alone module comment to
I'm good either way. Let me know. Thanks! |
I think we should use Sounds good? |
I agree with @deadprogram, I have a slight preference for |
62e8717
to
1be121e
Compare
@aykevl @deadprogram Tweaks made, rebased on |
1be121e
to
8d3678c
Compare
Hi @pkedy thank you for making the requested changes. Looks good to me, now squash/merging. Thanks again for your contribution! |
The fork by @neelance for adding support for was appears to follow the following pattern:
Source: golang/go@master...neelance:wasi#diff-a3fd4d4a4e3586f091ff65fe86eacb13R1527 This is of course a branch and not official, but I wonder whether we should be using the same pattern? |
Honestly I haven't put much thought into this name yet, other than making it similar to Unfortunately the Go compiler is currently written in a way that allows flags like |
@neelance thanks for your comment! Well, to be honest I don't really like the If I were to vote for any format, it would be the |
Why use |
Historical reasons, that's all. |
I need to compile a WebAssembly program that imports functions from a host that uses a module namespace other than the standard
env
. I enhancedgo:export
to support this. For example, in addition to the default export (env
module)You can set the module using
//go:export [module] <name>
Alternatively, you can use a separate comment
//go:module <name>
in conjunction withgo:export
orgo:linkname
. I'm happy to make any tweaks to the argument format.I tried to run
make test
but got clang linker errors. I tested usinggo install
andwasm2wat
to print the imports of the compiled wasm.This is a first step for issue #423.