Skip to content

Commit 5f1ee60

Browse files
authored
Merge pull request #70 from WebAssembly/add-wit
Add WIT.md and link into existing docs
2 parents c23e1f4 + 922436b commit 5f1ee60

File tree

3 files changed

+569
-7
lines changed

3 files changed

+569
-7
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Component Model design and specification
22

33
This repository describes the high-level [goals], [use cases], [design choices]
4-
and [FAQ] of the component model as well as a more-detailed [explainer],
4+
and [FAQ] of the component model as well as a more-detailed [explainer], [IDL],
55
[binary format] and [ABI] covering the initial Minimum Viable Product (MVP)
66
release.
77

@@ -20,6 +20,7 @@ To contribute to any of these repositories, see the Community Group's
2020
[design choices]: design/high-level/Choices.md
2121
[FAQ]: design/high-level/FAQ.md
2222
[explainer]: design/mvp/Explainer.md
23+
[IDL]: design/mvp/WIT.md
2324
[binary format]: design/mvp/Binary.md
2425
[ABI]: design/mvp/CanonicalABI.md
2526
[formal spec]: spec/

design/mvp/Explainer.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -539,14 +539,24 @@ variety of source languages. As syntactic sugar, the text format of `functype`
539539
additionally allows `result` to be absent, interpreting this as `(result
540540
unit)`.
541541

542-
The `instance` type constructor represents the result of instantiating a
543-
component and thus is the same as a `component` type minus the description
544-
of imports.
542+
The `instance` type constructor describes a list of named, typed definitions
543+
that can be imported or exported by a component. Informally, instance types
544+
correspond to the usual concept of an "interface" and instance types thus serve
545+
as static interface descriptions. In addition to the S-Expression text format
546+
defined here, which is meant to go inside component definitions, interfaces can
547+
also be defined as standalone, human-friendly text files in the [`wit`](WIT.md)
548+
[Interface Definition Language].
545549

546550
The `component` type constructor is symmetric to the core `module` type
547-
constructor and is built from a sequence of "declarators" which are used to
548-
describe the imports and exports of the component. There are four kinds of
549-
declarators:
551+
constructor and contains *two* lists of named definitions for the imports
552+
and exports of a component, respectively. As suggested above, instance types
553+
can show up in *both* the import and export types of a component type.
554+
555+
Both `instance` and `component` type constructors are built from a sequence of
556+
"declarators", of which there are four kinds—`type`, `alias`, `import` and
557+
`export`—where only `component` type constructors can contain `import`
558+
declarators. The meanings of these declarators is basically the same as the
559+
core module declarators introduced above.
550560

551561
As with core modules, `importdecl` and `exportdecl` classify component `import`
552562
and `export` definitions, with `importdecl` allowing an identifier to be
@@ -1103,6 +1113,7 @@ and will be added over the coming months to complete the MVP proposal:
11031113
[ABI]: https://en.wikipedia.org/wiki/Application_binary_interface
11041114
[Environment Variables]: https://en.wikipedia.org/wiki/Environment_variable
11051115
[Linear]: https://en.wikipedia.org/wiki/Substructural_type_system#Linear_type_systems
1116+
[Interface Definition Language]: https://en.wikipedia.org/wiki/Interface_description_language
11061117

11071118
[module-linking]: https://github.com/WebAssembly/module-linking/blob/main/design/proposals/module-linking/Explainer.md
11081119
[interface-types]: https://github.com/WebAssembly/interface-types/blob/main/proposals/interface-types/Explainer.md

0 commit comments

Comments
 (0)