Skip to content

Use section codes instead of section names#734

Closed
titzer wants to merge 1 commit intomasterfrom
binary_0xc_section_codes
Closed

Use section codes instead of section names#734
titzer wants to merge 1 commit intomasterfrom
binary_0xc_section_codes

Conversation

@titzer
Copy link

@titzer titzer commented Aug 1, 2016

This PR proposes uses section codes for known sections, which is more compact and easier to check in a decoder. It allows for user-defined sections that have string names to be encoded in the same manner as before. The scheme of using negative numbers proposed here also has the advantage of allowing a single decoder to accept the old (0xB) format and the new (0xC) format for the time being.

This PR proposes uses section codes for known sections, which is more compact and easier to check in a decoder.
It allows for user-defined sections that have string names to be encoded in the same manner as before.
The scheme of using negative numbers proposed here also has the advantage of allowing a single decoder to accept the old (0xB) format and the new (0xC) format for the time being.
@sunfishcode sunfishcode added this to the MVP milestone Aug 1, 2016

The names section does not change execution semantics and a validation error in
this section does not cause validation for the whole module to fail and is
instead treated as if the section was absent. The expectation is that, when a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One idea we discussed was to have the names section be defined as a user-defined section. Then all the logic here (about how you can always ignore a names section -- that it doesn't have any semantic effect) could be hoisted and apply to all user-defined sections.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would that basically mean that we move the names section to the JS embedding spec?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, although I think the names section makes sense more broadly. If we change the meaning from "user-defined" to "metadata" or "ignorable", then it wouldn't seem too out of place to have the core wasm spec define a metadata/ignorable section.

@titzer
Copy link
Author

titzer commented Aug 1, 2016

I screwed up the PR again by targeting master. Closing in favor of #739

@titzer titzer closed this Aug 1, 2016
@titzer
Copy link
Author

titzer commented Aug 1, 2016

Make that #740

@titzer titzer deleted the binary_0xc_section_codes branch August 2, 2016 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants