WebAssembly/stringref

String literal section text format

dcodeIO opened this issue · 0 comments

In WebAssembly/binaryen#4768 (comment) 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: #23