wasm: expose functions on instance.exports like rust and emscripten #31574
Labels
arch-wasm
WebAssembly issues
FeatureRequest
Issues asking for a new feature that does not need a proposal.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
It would be nice to expose exported functions from go modules in the WASM instance.exports like Rust and emscripten does. This would allow for Go to work nicely with ES modules so it doesn't have to rely on assigning anything to the JS global object. This would also make the interface for calling WASM functions more standard and feel more natural in ES modules.
Example
How does Rust do this
https://www.hellorust.com/demos/add/index.html
emscripten also has support for instance.exports (https://gist.github.com/kripken/59c67556dc03bb6d57052fedef1e61ab).
Here is some more info on exported functions in WASM: https://developer.mozilla.org/en-US/docs/WebAssembly/Exported_functions
The text was updated successfully, but these errors were encountered: