Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions design/mvp/Binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) 🪙
Expand Down Expand Up @@ -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|) 🔗
versionsuffix ::= len:<u32> vs:<semversuffix> => (versionsuffix vs) (if len = |vs|) 🔗
```

Notes:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading