Closed lann closed 11 months ago
Personally I'd agree with this and would be in favor 👍
I'd be fine dropping them too. Initially they were added because the proposal spawned out of Web IDL, which has union
. But yeah, I can see how it ends up being a special case for many languages, especially the statically-typed ones.
Even in JavaScript, they're still tagged awkwardly and don't actually correspond to the IDL / TypeScript equivalents, so this seems fine to me as well.
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.com/bytecodealliance/wasmtime/blob/367bdc8c66df62d6854966a90564b42692a3f023/crates/wit-bindgen/src/rust.rs#L317
Rather than expecting each bindings language to come up with a generic naming scheme to handle
union
s, I think we should put the onus on WIT authors to select reasonable case names on an equivalentvariant
.A quick Github search (and review of WASI) suggests that
union
s are not currently in use outside of tests and samples.