Hey all -- I'm working on updating jco (in particular to support the recent semver @since/@after changes) with the latest (unreleased IIRC)wasmtime-environ changes, I've run into an interesting difference:
There's wasm_decoder's Instruction enum
And wasmparser's Operator enum
Now they're obviously the same except for using tuple variants vs struct variants... except for the fact that wasm_encoder::Function::instruction takes only Instructions...
Is there a way to go in between these two obviously-identical types, or should I write some new code to go between? I'm pretty sure the types match up, and there are only so many that actually have associated data... But feels like I might be missing something.
This was recently implemented in wasm-tools but hasn't been published yet. The per-operator translation looks like this
I think you want something like this line
Ah thank you for the pointer!
I might see if I can pull in that newer version of wasm-encoder and get away with using it directly!
Victor Adossi has marked this topic as resolved.
Last updated: Dec 06 2025 at 06:05 UTC