WebAssembly / tool-conventions

Conventions supporting interoperatibility between tools working with WebAssembly.
Artistic License 2.0
297 stars 65 forks source link

Add a text format for `producers` and `dylink.0` custom sections #228

Closed alexcrichton closed 2 months ago

alexcrichton commented 3 months ago

This proposes a text format based on the annotations proposal for two custom sections defined in this repository. The annotations proposal is likely to reach phase 4 and "basically done" status in the near future. The wasm-tools repository has implemented the text format documented here for a bit now and it seemed best to document this upstream as well to both gather consensus and help guide other implementations.

I'll note that the text format documented here is the first thing I thought of for these sections. Right now these are largely used in read-only capacities where it's helpful for inspecting output but I'm not aware of anyone relying on the exact syntax. In that sense I'm more than happy to change syntax here and bikeshed a bit, I don't want to just assume that what's proposed here can't change.

TerrorJack commented 3 months ago

Out of curiousity, does wasm-tool support consuming a .wat textual file with dylink.0 custom sections?

alexcrichton commented 3 months ago

Yes, wasm-tools supports round-trip-ing both these sections.

alexcrichton commented 3 months ago

Whoops thanks for the sharp eye, right on all counts

alexcrichton commented 2 months ago

Oh wanted to follow-up on this, was there anything else that I should update/add?

sbc100 commented 2 months ago

Still lgtm!

alexcrichton commented 2 months ago

Oh I should probably also clarify I am unable to merge myself, so if you wouldn't mind merging that'd be appreciated.