The wast crate emits bytes. Was there a plan to create a separate crate to do just emitting part?
@Yury Delendik I've always wanted to have one but I never had concrete plans beyond a desire
I was thinking I should pull these bits out of wasm-smith
but haven't got around to it
wasm-smith
supports "relocations" of going back and fixing up length prefixes and stuff, which I imagine is valuable for such a crate
its all in this module: https://github.com/fitzgen/wasm-smith/blob/main/src/encode.rs
I imagine that making this a crate would replace all the closure-taking functions with builder structs for ergonomics, and there would be a bunch of different builder/writer structs for each part of wasm (the same way wasmparser has a bunch of different kinds of readers)
basic use case I'm entertaining atm is merging serveral modules (multi-memory and stuff)
so wasmparsers will be reading + some logic to change indices in operators
I was thinking more something at the abstraction level of wasmparser
; that is, raw binary encoding/decoding
for higher level transforms and merging things together, walrus
might be a better bet
Last updated: Nov 22 2024 at 16:03 UTC