stringref icon indicating copy to clipboard operation
stringref copied to clipboard

String literal section text format

Open dcodeIO opened this issue 3 years ago • 0 comments

In https://github.com/WebAssembly/binaryen/pull/4768#discussion_r911525282 the question regarding a text format for the string literal section came up. I see one good argument to optionally include the section in the text format as an alternative to (conveniently) folding the contents into string.const "the literal", that is (exact) round-trips to preserve section contents even if those are not referenced by a string.const instruction, which also might, after optimizations, lead to changes in ordering. As a format, I imagine

(strings
 (string "the literal")
)

where string.const in the text format can use either string.const 0 or string.const "the literal", similar to the type section. Does that sound good? :)

Related: https://github.com/WebAssembly/stringref/issues/23

dcodeIO avatar Jul 01 '22 15:07 dcodeIO