Stream: general

Topic: ✔ Multi-value returns support in Wasm component model in ...


view this post on Zulip Denys Zadorozhnyi (Jan 29 2024 at 10:00):

Hi! Could someone please clarify the plans for the multi-value return support in the component model (Canonical ABI)? How far are we? I'm interested in using them in WIT interfaces in rust.

view this post on Zulip Alex Crichton (Jan 29 2024 at 15:49):

Currently AFAIK there's no plans to implement it. The knobs are all there to take advantage of it and we have binary encodings in place to eventually take advantage of it in the future too. For now it's blocked on there's no way to write a source-level program (e.g. C or Rust) which uses multi-value returns in a stable fashion.

view this post on Zulip Alex Crichton (Jan 29 2024 at 15:50):

That being said it shouldn't prevent you from returning multiple values in WIT, whether or not wasm multi-value is used is "just" an ABI detail so all WIT features should work regardless (e.g. returning a tuple)

view this post on Zulip Denys Zadorozhnyi (Jan 30 2024 at 05:23):

Thanks Alex!

view this post on Zulip Denys Zadorozhnyi (Jan 30 2024 at 05:27):

Alex Crichton said:

That being said it shouldn't prevent you from returning multiple values in WIT, whether or not wasm multi-value is used is "just" an ABI detail so all WIT features should work regardless (e.g. returning a tuple)

Oh, my bad. I forgot to mention that we're using Wasm as a frontend in our compiler https://github.com/0xPolygonMiden/compiler so we're interested in seeing multi-value returns in generated Wasm.

Compiler from MidenIR to Miden Assembly. Contribute to 0xPolygonMiden/compiler development by creating an account on GitHub.

view this post on Zulip Notification Bot (Jan 30 2024 at 05:27):

Denys Zadorozhnyi has marked this topic as resolved.


Last updated: Dec 23 2024 at 12:05 UTC