WebAssembly / WebAssembly/binaryen
Wasm vs Wasm2js export naming is incompatible
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 69
Description
With Wasm2js generating valid ES modules, some information about export names is lost making Wasm modules and their Wasm2js counterpart non-interchangeable.
For example, if the Wasm module exports a function named hello#world, this will be exported as-is in Wasm but as hello_world in Wasm2js output.
Now one could argue that the mangling is necessary to make ES modules in the first place, and another person could argue that compatibility of the resulting module instance is more important. I'd personally favor the latter, since AssemblyScript uses export names (which do allow such symbols by the spec) to transport information about what is an instance method as part of the export's name (like MyClass#myInstanceMethod vs MyClass.myStaticMethod).
Any thoughts?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the hello#world export example in both a Wasm module and its Wasm2js output, then compare the resulting export names. The issue is resolved when equivalent module instances preserve compatible export names, including names containing #, or when the project documents an agreed alternative.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100