Stream: wasm

Topic: wasm-tools crate to emit bytecode


view this post on Zulip Yury Delendik (Sep 22 2020 at 16:26):

The wast crate emits bytes. Was there a plan to create a separate crate to do just emitting part?

view this post on Zulip Alex Crichton (Sep 22 2020 at 16:35):

@Yury Delendik I've always wanted to have one but I never had concrete plans beyond a desire

view this post on Zulip fitzgen (he/him) (Sep 22 2020 at 17:56):

I was thinking I should pull these bits out of wasm-smith but haven't got around to it

view this post on Zulip fitzgen (he/him) (Sep 22 2020 at 17:56):

wasm-smith supports "relocations" of going back and fixing up length prefixes and stuff, which I imagine is valuable for such a crate

view this post on Zulip fitzgen (he/him) (Sep 22 2020 at 17:57):

its all in this module: https://github.com/fitzgen/wasm-smith/blob/main/src/encode.rs

A WebAssembly test case generator. Contribute to fitzgen/wasm-smith development by creating an account on GitHub.

view this post on Zulip fitzgen (he/him) (Sep 22 2020 at 17:59):

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)

view this post on Zulip Yury Delendik (Sep 22 2020 at 17:59):

basic use case I'm entertaining atm is merging serveral modules (multi-memory and stuff)

view this post on Zulip Yury Delendik (Sep 22 2020 at 18:01):

so wasmparsers will be reading + some logic to change indices in operators

view this post on Zulip fitzgen (he/him) (Sep 22 2020 at 19:27):

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