diff --git a/design/mvp/Binary.md b/design/mvp/Binary.md index b8966e0d..edc42e50 100644 --- a/design/mvp/Binary.md +++ b/design/mvp/Binary.md @@ -371,10 +371,13 @@ flags are set. (See [Import and Export Definitions](Explainer.md#import-and-export-definitions) in the explainer.) ```ebnf -import ::= in: ed: => (import in ed) -export ::= en: si: ed?:? => (export en si ed?) -importname' ::= 0x00 len: in: => in (if len = |in|) -exportname' ::= 0x00 len: en: => en (if len = |en|) +import ::= in: ed: => (import in ed) +export ::= en: si: ed?:? => (export en si ed?) +importname' ::= 0x00 len: in: => in (if len = |in|) + | 0x01 len: in: vs: => in vs (if len = |in|) +exportname' ::= 0x00 len: en: => en (if len = |en|) + | 0x01 len: en: vs: => in vs (if len = |in|) +versionsuffix' ::= len: vs: => (versionsuffix vs) (if len = |vs|) ``` Notes: @@ -399,7 +402,10 @@ Notes: `(result (own $R))`, where `$R` is the resource labeled `r`. * Validation of `[method]` names requires the first parameter of the function to be `(param "self" (borrow $R))`, where `$R` is the resource labeled `r`. -* `` is as defined by [https://semver.org](https://semver.org/) +* Validation requires that `versionsuffix` is preceded by an `interfaceversion` + with a `canonversion` and that the concatenation of the `canonversion` and the + `versionsuffix` results in a `valid semver` as defined by + [https://semver.org](https://semver.org/) * `` is as defined by the [SRI](https://www.w3.org/TR/SRI/#dfn-integrity-metadata) spec. @@ -494,7 +500,9 @@ named once. * The opcodes (for types, canon built-ins, etc) should be re-sorted * The two `list` type codes should be merged into one with an optional immediate. -* The `0x00` prefix byte of `importname'` and `exportname'` will be removed or repurposed. +* 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. [`core:byte`]: https://webassembly.github.io/spec/core/binary/values.html#binary-byte diff --git a/design/mvp/Explainer.md b/design/mvp/Explainer.md index 51f30def..180106e7 100644 --- a/design/mvp/Explainer.md +++ b/design/mvp/Explainer.md @@ -33,6 +33,7 @@ more user-focused explanation, take a look at the * [Start definitions](#-start-definitions) * [Import and export definitions](#import-and-export-definitions) * [Name uniqueness](#name-uniqueness) + * [Canonical interface name](#canonical-interface-name) * [Component invariants](#component-invariants) * [JavaScript embedding](#JavaScript-embedding) * [JS API](#JS-API) @@ -294,7 +295,7 @@ sort ::= core | type | component | instance -inlineexport ::= (export ) +inlineexport ::= (export "" ? ) ``` Because component-level function, type and instance definitions are different than core-level function, type and instance definitions, they are put into @@ -574,8 +575,8 @@ instancedecl ::= core-prefix() | | | 🪙 -importdecl ::= (import bind-id()) -exportdecl ::= (export bind-id()) +importdecl ::= (import "" ? bind-id()) +exportdecl ::= (export "" ? bind-id()) externdesc ::= ( (type ) ) | core-prefix() | @@ -2242,8 +2243,9 @@ the identifier `$x`). In the case of exports, the `?` right after the preceding definition being exported (e.g., `(export $x "x" (func $f))` binds a new identifier `$x`). ```ebnf -import ::= (import "" bind-id()) -export ::= (export ? "" ?) +import ::= (import "" ? bind-id()) +export ::= (export ? "" ? ?) +versionsuffix ::= (versionsuffix "") ``` All import names are required to be [strongly-unique]. Separately, all export names are also required to be [strongly-unique]. The rest of the grammar for @@ -2276,17 +2278,23 @@ fragment ::= | word ::= [a-z] [0-9a-z]* acronym ::= [A-Z] [0-9A-Z]* -interfacename ::=