bytecodealliance / wit-bindgen

A language binding generator for WebAssembly interface types

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a new low-level `describe` output for inspecting the canonical ABI details of

fitzgen opened this issue · comments

This is a potential alternative to #965 but they aren't necessarily mutually exclusive.

The goal here is to create an easy way to see the concrete canonical ABI details for a particular WIT, on the command line.

This new "generator" would output the size and alignment of types, as well as the offsets of their fields where appropriate.

For example, given

point {
    x: u32,
    y: u32,
}

it would create output something like

record point:
    size: 8
    align: 4
    fields:
        x: 0
        y: 4

Basically a human-readable dump of the IR that wit-bindgen produces.

For functions, it should similarly produce a human-readable version of the operations required to lift/lower as well as the core Wasm signatures.

cc @titzer