WebAssembly / WebAssembly/component-model
Component Model should allow `post-return`s to take no result-specific params
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 1.4k
- Forks
- 130
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 15
Description
In components where the post return function doesn't need to know which values being returned because (e.g. the entire bump allocator is reset) the current requirement that the type of post-return takes as parameters the return values is very inconvenient.
It would be very helpful if it was possible to provide a function taking no result-based arguments either as a separate canonical option or as post-return being detected as behaving this way by their type.
For a concrete example, in the Claw compiler, a prebuilt allocator module is used which exports a clear function. This clear function cannot be used in a post-return for a function which returns anything because it's type is not correct.
As a result, in order to create valid post-returns
- the code module needs to import
clear - new post-return functions are needed in the code module
- that need potentially new types to be encoded
- that ignore their arguments
- that all call
clearin the exact same way
- those exported functions need to be aliased,
- and then each generated post-return may be used as
post-return
This is a ton of work and unneeded binary size for something the Component Model could make unnecessary.
Contributor guide
No contributing guide indexed for this repository
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 issue #309 and the Component Model rules for post-return function types, then inspect the linked Claw allocator.wat example. Define the behavior for post-return functions that take no result-specific arguments and verify that the allocator's clear function can be used without generated forwarding functions or aliases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100