-
Notifications
You must be signed in to change notification settings - Fork 112
Adjust binary encoding of import/export names #623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alexcrichton
wants to merge
1
commit into
WebAssembly:main
Choose a base branch
from
alexcrichton:fix-binary-format
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -228,8 +228,8 @@ instancedecl ::= 0x00 t:<core:type> => t | |||||||||||||
| | 0x01 t:<type> => t | ||||||||||||||
| | 0x02 a:<alias> => a | ||||||||||||||
| | 0x04 ed:<exportdecl> => ed | ||||||||||||||
| importdecl ::= in:<importname'> ed:<externdesc> => (import in ed) | ||||||||||||||
| exportdecl ::= en:<exportname'> ed:<externdesc> => (export en ed) | ||||||||||||||
| importdecl ::= in:<importname> ed:<externdesc> => (import in ed) | ||||||||||||||
| exportdecl ::= en:<exportname> ed:<externdesc> => (export en ed) | ||||||||||||||
| externdesc ::= 0x00 0x11 i:<core:typeidx> => (core module (type i)) | ||||||||||||||
| | 0x01 i:<typeidx> => (func (type i)) | ||||||||||||||
| | 0x02 b:<valuebound> => (value b) 🪙 | ||||||||||||||
|
|
@@ -386,13 +386,15 @@ flags are set. | |||||||||||||
| (See [Import and Export Definitions](Explainer.md#import-and-export-definitions) | ||||||||||||||
| in the explainer.) | ||||||||||||||
| ```ebnf | ||||||||||||||
| import ::= in:<importname'> ed:<externdesc> => (import in ed) | ||||||||||||||
| export ::= en:<exportname'> si:<sortidx> ed?:<externdesc>? => (export en si ed?) | ||||||||||||||
| importname' ::= 0x00 len:<u32> in:<importname> => in (if len = |in|) | ||||||||||||||
| | 0x01 len:<u32> in:<importname> vs:<versionsuffix'> => in vs (if len = |in|) 🔗 | ||||||||||||||
| exportname' ::= 0x00 len:<u32> en:<exportname> => en (if len = |en|) | ||||||||||||||
| | 0x01 len:<u32> en:<exportname> vs:<versionsuffix'> => in vs (if len = |in|) 🔗 | ||||||||||||||
| versionsuffix' ::= len:<u32> vs:<semversuffix> => (versionsuffix vs) (if len = |vs|) 🔗 | ||||||||||||||
| import ::= in:<importname> ed:<externdesc> => (import in ed) | ||||||||||||||
| export ::= en:<exportname> si:<sortidx> ed?:<externdesc>? => (export en si ed?) | ||||||||||||||
| importname ::= 0x00 len:<u32> in:<importname> => in (if len = |in|) | ||||||||||||||
| | 0x01 len:<u32> in:<importname> => in (if len = |in|) | ||||||||||||||
| | 0x02 len:<u32> in:<importname> vs:<versionsuffix> => in vs (if len = |in|) 🔗 | ||||||||||||||
| exoprtname ::= 0x00 len:<u32> in:<exoprtname> => in (if len = |in|) | ||||||||||||||
| | 0x01 len:<u32> in:<exoprtname> => in (if len = |in|) | ||||||||||||||
| | 0x02 len:<u32> in:<exoprtname> vs:<versionsuffix> => in vs (if len = |in|) 🔗 | ||||||||||||||
|
Comment on lines
+394
to
+396
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| versionsuffix ::= len:<u32> vs:<semversuffix> => (versionsuffix vs) (if len = |vs|) 🔗 | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| Notes: | ||||||||||||||
|
|
@@ -406,6 +408,8 @@ Notes: | |||||||||||||
| of the inferred `externdesc` of the `sortidx`. | ||||||||||||||
| * `<importname>` and `<exportname>` refer to the productions defined in the | ||||||||||||||
| [text format](Explainer.md#import-and-export-definitions). | ||||||||||||||
| * `<importname>` and `<exportname>` will [be cleaned up for a 1.0 | ||||||||||||||
| release](##binary-format-warts-to-fix-in-a-10-release). | ||||||||||||||
| * The `<importname>`s of a component must all be [strongly-unique]. Separately, | ||||||||||||||
| the `<exportname>`s of a component must also all be [strongly-unique]. | ||||||||||||||
| * Validation requires that annotated `plainname`s only occur on `func` imports | ||||||||||||||
|
|
@@ -519,9 +523,9 @@ named once. | |||||||||||||
| * The two `depname` cases should be merged into one (`dep=<...>`) | ||||||||||||||
| * The two `list` type codes should be merged into one with an optional immediate | ||||||||||||||
| and similarly for `func`. | ||||||||||||||
| * The `0x00` variant of `importname'` and `exportname'` will be removed. Any | ||||||||||||||
| remaining variant(s) will be renumbered or the prefix byte will be removed or | ||||||||||||||
| repurposed. | ||||||||||||||
| * The `0x00` and `0x01` variant of `importname` and `exportname` will be | ||||||||||||||
| removed. Any remaining variant(s) will be renumbered or the prefix byte will | ||||||||||||||
| be removed or repurposed. | ||||||||||||||
| * Most built-ins should have a `<canonopt>*` immediate instead of an ad hoc | ||||||||||||||
| subset of `canonopt`s. | ||||||||||||||
| * Add optional `shared` immediate to all canonical definitions (explicitly or | ||||||||||||||
|
|
||||||||||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal of
importname'/exportname'was avoid the confusion in this line, which otherwise looks recursive. One alternative idea is to say<text:importname>(and then update the bullet below which establishes the link ofimportnameto the text format).