Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Return Values #937

Closed
RyanLamansky opened this issue Jan 4, 2017 · 11 comments
Closed

Multiple Return Values #937

RyanLamansky opened this issue Jan 4, 2017 · 11 comments

Comments

@RyanLamansky
Copy link

As noted in the future features document, the stack based nature of WebAssembly lends itself to the possibility of supporting multiple return values from blocks / functions. This would be immediately useful for returning values larger than 8 bytes without having to add extra steps to pass them through a memory area. The binary encoding already leaves open the possibility for multiple return values by simply changing return_count from varint1 to varint32.

@titzer
Copy link

titzer commented Jan 16, 2017

We actually already implemented a prototype of this in V8, actually, which was one of the prerequisites to generalizing from the postorder to the stack machine.

@titzer
Copy link

titzer commented Jan 25, 2017

Closing, as this issue is already on the roadmap.

@titzer titzer closed this as completed Jan 25, 2017
@RyanLamansky
Copy link
Author

Would it be appropriate to re-open this and use a tracking label?

@lukewagner
Copy link
Member

Since it's already on the roadmap, I think the next steps would be to create a spec repo branch adding the feature, tests, etc, but we're still figuring out that whole process. I do think this is something we should get to soon, though.

@RyanLamansky
Copy link
Author

Any progress on the process? The issue I filed immediately before this one, #936, is similar but was never closed. If that one is still open, this one should be re-opened.

@jfbastien
Copy link
Member

I think @titzer closed it because he's pretty sure someone from his team or Mozilla will champion the idea soon. They both have sample implementations in their VM, and we've discussed this quite often over beers, so I expect it to happen in the future.

@rossberg
Copy link
Member

Yeah, I will propose it once I'm through with writing the MVP spec.

@Thaina
Copy link

Thaina commented Jun 27, 2017

@rossberg-chromium I think this issue should be reopened until the MVP spec released

@jfbastien
Copy link
Member

The MVP design is already out and shipping in some browsers. Multiple return values will need to be proposed to the WebAssembly CG before it can go into the spec. What @rossberg-chromium was saying was "I'm currently working on finishing writing the MVP spec, and a work item I want to tackle after this are multiple return values". There's no hard dependency between the two work items, but there's a soft dependency in @rossberg-chromium 😁

@dvtate
Copy link

dvtate commented Aug 18, 2020

bump

@rossberg
Copy link
Member

rossberg commented Aug 18, 2020

For anybody rediscovering this old issue: multiple return values have been standardised in Wasm by now, the proposal has been merged into the spec as of 2020-04-09 and are implemented in all major engines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants