WebAssembly / wabt

The WebAssembly Binary Toolkit
Apache License 2.0
6.86k stars 699 forks source link

Update GC proposal support to recent phase 2 version #1874

Open takikawa opened 2 years ago

takikawa commented 2 years ago

There is some support for the GC proposal in wabt already behind a flag, but it predates the current design for the proposal (that recently went to phase 2) that includes new type constructs like rec, sub, and so on.

Now that the design is more stable, it could be a good time to catch up support in wabt. I'm interested in working on this if nobody already has patches in progress.

turbolent commented 10 months ago

Just ran into this while investigating what the Kotlin compiler generates, using wasm2wat

0000067: error: unexpected type form (got -0x32)

https://github.com/WebAssembly/gc/blob/main/proposals/gc/MVP.md#defined-types: rec

Are there any other tools that can be used to inspect modules that use the GC MVP?

sbc100 commented 10 months ago

You can use the tools in binaryen (e.g. wasm-dis and wasm-as)

turbolent commented 10 months ago

@sbc100 Thanks, wasm-dis works well and even has colored output, nice 👌