Remove named multi-return from function types (for now at least)#368
Merged
lukewagner merged 1 commit intomainfrom Jul 12, 2024
Merged
Remove named multi-return from function types (for now at least)#368lukewagner merged 1 commit intomainfrom
lukewagner merged 1 commit intomainfrom
Conversation
alexcrichton
approved these changes
Jun 17, 2024
Mossaka
approved these changes
Jul 8, 2024
Contributor
Mossaka
left a comment
There was a problem hiding this comment.
This will simplify the specification a lot. Thanks
b9ea529 to
4c0cbf7
Compare
Member
Author
|
Ok, since noone seems to be using multi-return afaics and this is a conservative change we can always relax later (via #356), I'll go ahead and merge now (which may shake out more use cases, which will be useful data). |
alexcrichton
added a commit
to alexcrichton/wasm-tools
that referenced
this pull request
Jul 12, 2024
This commit is an implementation of WebAssembly/component-model#368 in this repository. The intention here is along the lines of a few other recent restrictions which is to avoid outright removing support and instead stage the changes a bit. To that end a new feature flag is added and multi-return functions are now gated behind this feature flag. Tests are updated to avoid using it and otherwise the actual removal of supporting code is deferred to a later date.
github-merge-queue bot
pushed a commit
to bytecodealliance/wasm-tools
that referenced
this pull request
Jul 15, 2024
This commit is an implementation of WebAssembly/component-model#368 in this repository. The intention here is along the lines of a few other recent restrictions which is to avoid outright removing support and instead stage the changes a bit. To that end a new feature flag is added and multi-return functions are now gated behind this feature flag. Tests are updated to avoid using it and otherwise the actual removal of supporting code is deferred to a later date.
Collaborator
|
This change is going to be shipped with Wasmtime 24, to be released August 20, as part of the update in bytecodealliance/wasmtime#8965 |
jsturtevant
added a commit
to hyperlight-dev/hyperlight
that referenced
this pull request
Jun 27, 2025
This was a bit more involved due to a big change in the way function return types are handled. The orginal change was done in WebAssembly/component-model#368 and put initially put behind a feature flag in bytecodealliance/wasm-tools#1670. In 0.226.0 version of wasmparser this feature flag was removed simplify the return results. This in turn simplifies the handling of the results here as well. Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
jsturtevant
added a commit
to hyperlight-dev/hyperlight
that referenced
this pull request
Jun 27, 2025
This was a bit more involved due to a big change in the way function return types are handled. The orginal change was done in WebAssembly/component-model#368 and put initially put behind a feature flag in bytecodealliance/wasm-tools#1670. In 0.226.0 version of wasmparser this feature flag was removed simplify the return results. This in turn simplifies the handling of the results here as well. Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
jsturtevant
added a commit
to hyperlight-dev/hyperlight
that referenced
this pull request
Jul 1, 2025
This was a bit more involved due to a big change in the way function return types are handled. The orginal change was done in WebAssembly/component-model#368 and put initially put behind a feature flag in bytecodealliance/wasm-tools#1670. In 0.226.0 version of wasmparser this feature flag was removed simplify the return results. This in turn simplifies the handling of the results here as well. Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
jsturtevant
added a commit
to hyperlight-dev/hyperlight
that referenced
this pull request
Jul 3, 2025
This was a bit more involved due to a big change in the way function return types are handled. The orginal change was done in WebAssembly/component-model#368 and put initially put behind a feature flag in bytecodealliance/wasm-tools#1670. In 0.226.0 version of wasmparser this feature flag was removed simplify the return results. This in turn simplifies the handling of the results here as well. Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
jsturtevant
added a commit
to hyperlight-dev/hyperlight
that referenced
this pull request
Jul 9, 2025
This was a bit more involved due to a big change in the way function return types are handled. The orginal change was done in WebAssembly/component-model#368 and put initially put behind a feature flag in bytecodealliance/wasm-tools#1670. In 0.226.0 version of wasmparser this feature flag was removed simplify the return results. This in turn simplifies the handling of the results here as well. Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
jsturtevant
added a commit
to hyperlight-dev/hyperlight
that referenced
this pull request
Jul 10, 2025
This was a bit more involved due to a big change in the way function return types are handled. The orginal change was done in WebAssembly/component-model#368 and put initially put behind a feature flag in bytecodealliance/wasm-tools#1670. In 0.226.0 version of wasmparser this feature flag was removed simplify the return results. This in turn simplifies the handling of the results here as well. Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
jsturtevant
added a commit
to hyperlight-dev/hyperlight
that referenced
this pull request
Jul 11, 2025
This was a bit more involved due to a big change in the way function return types are handled. The orginal change was done in WebAssembly/component-model#368 and put initially put behind a feature flag in bytecodealliance/wasm-tools#1670. In 0.226.0 version of wasmparser this feature flag was removed simplify the return results. This in turn simplifies the handling of the results here as well. Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
jsturtevant
added a commit
to hyperlight-dev/hyperlight
that referenced
this pull request
Jul 14, 2025
This was a bit more involved due to a big change in the way function return types are handled. The orginal change was done in WebAssembly/component-model#368 and put initially put behind a feature flag in bytecodealliance/wasm-tools#1670. In 0.226.0 version of wasmparser this feature flag was removed simplify the return results. This in turn simplifies the handling of the results here as well. Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently function types are slightly asymmetric with results having an extra single-unnamed-result option. As #356 points out, we could make params and results fully symmetric by saying that both could either be a list of all-named- or all-unnamed types. I think that topic requires some more discussion to motivate and understand the implications for bindings generators in various languages.
In the meantime, though, I don't think anyone uses or even knows about named multi-return -- the much more common thing to do is to return a
tupleorrecord(almost always wrapped in aresult). I think this means we can expect to seean ad hoc mix of multi-return and
tuple/recordin practice which seems like needless inconsistency (and wasted time arguing over what if any convention there should be). It also seems like this path will be either unimplemented or untested in current bindings generators, which bodes poorly if anyone ever does decide to use this feature.Thus, this PR proposes that, at least until we decide to go for full symmetry, we lean into the asymmetry (which is already present) and disable this additional case of named multi-return that (afaik) noone is using. If however anyone is using and appreciating named multi-return, I'd be very interested to hear about it! (I'll leave this PR open for a while to collect feedback.)