WebAssembly / design

WebAssembly Design Documents
http://webassembly.org
Apache License 2.0
11.38k stars 693 forks source link

More clarity around position of Name Section #1174

Open sbc100 opened 6 years ago

sbc100 commented 6 years ago

BinaryEncoding.md currently says The name section may appear only once, and only after the Data section.

The spec currently says: The name section should appear only once in a module, and only after the data section.

This doesn't make sense for modules that don't have a data section at all. What I think the author intended is ..only after all known sections. To me it makes sense that the name section come after all known sections (even ones that are yet to be added) since I could be used to name elements in any of the known sections.

Technically as it stands today the name section only really needs to follow the Function section (since it can only name function) but I think forcing to come after all known sections make the most sense from a forward looking perspective.

jfbastien commented 6 years ago

Until we add other known sections 😉 I think we should provide an ordering with current known sections.

sbc100 commented 6 years ago

OK, but the main point is that after the data sectionis not the right wording for that.