Skip to content

WIT: consider dropping unions #236

@lann

Description

@lann

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 unions, I think we should put the onus on WIT authors to select reasonable case names on an equivalent variant.

A quick Github search (and review of WASI) suggests that unions are not currently in use outside of tests and samples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions