Skip to content

Commit

Permalink
Fix typos found in #276
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewagner committed Apr 11, 2024
1 parent 145752a commit 4bafd01
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions design/mvp/CanonicalABI.md
Original file line number Diff line number Diff line change
Expand Up @@ -1482,10 +1482,10 @@ validation specifies:
* `$f` is given type `$ft`
* a `memory` is present if required by lifting and is a subtype of `(memory 1)`
* a `realloc` is present if required by lifting and has type `(func (param i32 i32 i32 i32) (result i32))`
* if a `post-return` is present, it has type `(func (param flatten_functype($ft)['results']))`
* if a `post-return` is present, it has type `(func (param flatten_functype($ft).results))`

When instantiating component instance `$inst`:
* Define `$f` to be the closure `lambda call, args: canon_lift($opts, $inst, $callee, $ft, args)`
* Define `$f` to be the closure `lambda args: canon_lift($opts, $inst, $callee, $ft, args)`

Thus, `$f` captures `$opts`, `$inst`, `$callee` and `$ft` in a closure which
can be subsequently exported or passed into a child instance (via `with`). If
Expand Down Expand Up @@ -1550,7 +1550,7 @@ where `$callee` has type `$ft`, validation specifies:
* there is no `post-return` in `$opts`

When instantiating component instance `$inst`:
* Define `$f` to be the closure: `lambda call, args: canon_lower($opts, $inst, $callee, $ft, args)`
* Define `$f` to be the closure: `lambda args: canon_lower($opts, $inst, $callee, $ft, args)`

Thus, from the perspective of Core WebAssembly, `$f` is a [function instance]
containing a `hostfunc` that closes over `$opts`, `$inst`, `$callee` and `$ft`
Expand Down
14 changes: 7 additions & 7 deletions design/mvp/Explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ defvaltype ::= bool
| f32 | f64
| char | string
| (record (field "<label>" <valtype>)+)
| (variant (case <id>? "<label>" <valtype>?)+)
| (variant (case "<label>" <valtype>?)+)
| (list <valtype>)
| (tuple <valtype>+)
| (flags "<label>"+)
Expand Down Expand Up @@ -663,7 +663,7 @@ of boolean fields uses a sequence of boolean-valued bytes.

Note that, at least initially, variants are required to have a non-empty list of
cases. This could be relaxed in the future to allow an empty list of cases, with
the empty `(variant)` effectively serving as a [empty type] and indicating
the empty `(variant)` effectively serving as an [empty type] and indicating
unreachability.

#### Definition types
Expand All @@ -688,9 +688,9 @@ canonical built-ins described [below](#canonical-built-ins). The `rep`
immediate of a `resource` type specifies its *core representation type*, which
is currently fixed to `i32`, but will be relaxed in the future (to at least
include `i64`, but also potentially other types). When the last handle to a
resource is dropped, the resource's `dtor` function will be called (if
present), allowing the implementing component to perform clean-up like freeing
linear memory allocations.
resource is dropped, the resource's destructor function specified by the `dtor`
immediate will be called (if present), allowing the implementing component to
perform clean-up like freeing linear memory allocations.

The `instance` type constructor describes a list of named, typed definitions
that can be imported or exported by a component. Informally, instance types
Expand Down Expand Up @@ -1113,7 +1113,7 @@ isolation than otherwise achievable with a shared global namespace.
### Canonical Definitions

From the perspective of Core WebAssembly running inside a component, the
Component Model is an [Embedding]. As such, the Component Model defines the
Component Model is an [embedder]. As such, the Component Model defines the
Core WebAssembly imports passed to [`module_instantiate`] and how Core
WebAssembly exports are called via [`func_invoke`]. This allows the Component
Model to specify how core modules are linked together (as shown above) but it
Expand Down Expand Up @@ -1928,7 +1928,7 @@ and will be added over the coming months to complete the MVP proposal:
[func-import-abbrev]: https://webassembly.github.io/spec/core/text/modules.html#text-func-abbrev
[`core:version`]: https://webassembly.github.io/spec/core/binary/modules.html#binary-version

[Embedding]: https://webassembly.github.io/spec/core/appendix/embedding.html
[Embedder]: https://webassembly.github.io/spec/core/appendix/embedding.html
[`module_instantiate`]: https://webassembly.github.io/spec/core/appendix/embedding.html#mathrm-module-instantiate-xref-exec-runtime-syntax-store-mathit-store-xref-syntax-modules-syntax-module-mathit-module-xref-exec-runtime-syntax-externval-mathit-externval-ast-xref-exec-runtime-syntax-store-mathit-store-xref-exec-runtime-syntax-moduleinst-mathit-moduleinst-xref-appendix-embedding-embed-error-mathit-error
[`func_invoke`]: https://webassembly.github.io/spec/core/appendix/embedding.html#mathrm-func-invoke-xref-exec-runtime-syntax-store-mathit-store-xref-exec-runtime-syntax-funcaddr-mathit-funcaddr-xref-exec-runtime-syntax-val-mathit-val-ast-xref-exec-runtime-syntax-store-mathit-store-xref-exec-runtime-syntax-val-mathit-val-ast-xref-appendix-embedding-embed-error-mathit-error
[`func_alloc`]: https://webassembly.github.io/spec/core/appendix/embedding.html#mathrm-func-alloc-xref-exec-runtime-syntax-store-mathit-store-xref-syntax-types-syntax-functype-mathit-functype-xref-exec-runtime-syntax-hostfunc-mathit-hostfunc-xref-exec-runtime-syntax-store-mathit-store-xref-exec-runtime-syntax-funcaddr-mathit-funcaddr
Expand Down
6 changes: 3 additions & 3 deletions design/mvp/WIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ world your-world {
The plain name of an `import` or `export` statement is used as the plain name
of the final component `import` or `export` definition.

In the component model imports to a component either use an plain or interface
In the component model imports to a component either use a plain or interface
name, and in WIT this is reflected in the syntax:

```wit
Expand Down Expand Up @@ -381,7 +381,7 @@ world invalid-union-world {
```

### A Note on SubTyping
### A Note on Subtyping

In the future, when `optional` export is supported, the world author may explicitly mark exports as optional to make a component targeting an included World a subtype of the union World.

Expand Down Expand Up @@ -1248,7 +1248,7 @@ variant option {
}
variant result {
ok(ok-ty)
ok(ok-ty),
err(err-ty),
}
```
Expand Down

0 comments on commit 4bafd01

Please sign in to comment.