Stream: wit-bindgen

Topic: ✔ dropping unions


view this post on Zulip Lann Martin (Aug 21 2023 at 14:30):

I think we should remove unions from WIT: https://github.com/WebAssembly/component-model/issues/236

Unions are uniquely challenging to implement in bindings because their cases do not have kebab-case names. See for example the wit-bindgen Rust generator's awkward solution to this: https://github....

view this post on Zulip Lann Martin (Aug 21 2023 at 14:32):

I suppose if we want to maintain the 1:1 mapping from CM types then that would entail removing them from the CM type system as well.

view this post on Zulip Lann Martin (Aug 21 2023 at 14:35):

I'm slightly skeptical of tuples as well, but I think a lot more languages have a "natural" representation of tuples than unions.

view this post on Zulip Joel Dice (Aug 21 2023 at 14:45):

:thumbs_up: unions are awkward in Python, too.

view this post on Zulip Alex Crichton (Aug 21 2023 at 14:49):

commented as well, but I agree they'd be good to remove :+1:

view this post on Zulip Lann Martin (Aug 21 2023 at 15:36):

Given the feedback from Alex and Luke on the issue, I cross-posted reference issues to wit-bindgen and wasmtime for visibility

view this post on Zulip Karel Hrkal (kajacx) (Aug 21 2023 at 18:08):

I have not even used the wit unions, for me, variant is just better.

view this post on Zulip Lann Martin (Aug 25 2023 at 17:23):

For those following along at home, unions have been dropped from the spec and from wasm-tools, with PRs ready in wit-bindgen and wasmtime just awaiting dependency releases

Closes #236
This removes all relevant references to "union". Fixes #1179

view this post on Zulip Notification Bot (Aug 26 2023 at 16:07):

Scott Waye has marked this topic as resolved.

view this post on Zulip Notification Bot (Aug 26 2023 at 16:09):

Scott Waye has marked this topic as unresolved.

view this post on Zulip Scott Waye (Aug 26 2023 at 16:09):

Sorry, marked wrong topic as resolved.

view this post on Zulip Lann Martin (Aug 28 2023 at 12:26):

Actually, with https://github.com/bytecodealliance/wasmtime/pull/6913 merged, this is done. Farewell unions, we hardly knew used thee.

...and bump wasm-tools deps. Fixes #6871

view this post on Zulip Notification Bot (Aug 28 2023 at 12:26):

Lann Martin has marked this topic as resolved.


Last updated: Dec 23 2024 at 12:05 UTC