WebAssembly / WebAssembly/binaryen
Provide a way to detect asyncified exports
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 69
Description
Currently, Asyncify pass transforms only functions that call into potentially asynchronous imports (directly or indirectly) and leaves others untouched.
However, from the JavaScript wrapper side, it's impossible to know which exports ended up being asyncified and which not, and so all exported functions end up being transformed into async ones even if it's unnecessary.
In order to improve efficiency and provide an async API only for exports that actually require it, Asyncify pass should somehow mark the transformed exports.
There are two potential ways to go about this: 1) add custom prefix or suffix to export names which would be detected as a marker and stripped by the JS wrapper or 2) add a custom section(s?) listing all such export names that could be read by JS wrapper using WebAssembly.customSections('asyncify').
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 with the Asyncify pass and the JavaScript wrapper described in the issue, then examine how WebAssembly customSections('asyncify') is exposed. Define a marker for exports that were asyncified and verify that the wrapper can use it to provide async behavior only for those exports.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, wasm
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100