Skip to content
Closed
Show file tree
Hide file tree
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
16 changes: 5 additions & 11 deletions design/mvp/Binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ Notes:
import or export, respectively, in the same scope (component, component type
or instance type).
* Validation of `[constructor]` names requires that the `func` returns a
`(result (own $R))`, where `$R` is the resource labeled `r`.
`(result (rc $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`.
to be `(param "self" (rc $R))`, where `$R` is the resource labeled `r`.
* Validation of `[method]` and `[static]` names ensures that all field names
are disjoint.

Expand Down Expand Up @@ -203,8 +203,7 @@ defvaltype ::= pvt:<primvaltype> => pvt
| 0x6c t*:vec(<valtype>) => (union t*)
| 0x6b t:<valtype> => (option t)
| 0x6a t?:<valtype>? u?:<valtype>? => (result t? (error u)?)
| 0x69 i:<typeidx> => (own i)
| 0x68 i:<typeidx> => (borrow i)
| 0x69 i:<typeidx> => (rc i)
labelvaltype ::= l:<label> t:<valtype> => l t
case ::= l:<label> t?:<valtype>? r?:<u32>? => (case l t? (refines case-label[r])?)
<T>? ::= 0x00 =>
Expand Down Expand Up @@ -240,12 +239,7 @@ Notes:
with type opcodes starting at SLEB128(-1) (`0x7f`) and going down,
reserving the nonnegative SLEB128s for type indices.
* Validation of `valtype` requires the `typeidx` to refer to a `defvaltype`.
* Validation of `own` and `borrow` requires the `typeidx` to refer to a
resource type.
* Validation only allows `borrow` to be used inside the `param` of a `functype`.
(This is likely to change in a future PR, converting `functype` into a
compound type constructor analogous to `moduletype` and `componenttype` and
using scoping to enforce this constraint instead.)
* Validation of `rc` requires that `typeidx` refer to a resource type.
* Validation of `resourcetype` requires the destructor (if present) to have
type `[i32] -> []`.
* Validation of `instancedecl` (currently) only allows the `type` and
Expand Down Expand Up @@ -281,7 +275,7 @@ Notes:
canon ::= 0x00 0x00 f:<core:funcidx> opts:<opts> ft:<typeidx> => (canon lift f opts type-index-space[ft])
| 0x01 0x00 f:<funcidx> opts:<opts> => (canon lower f opts (core func))
| 0x02 t:<typeidx> => (canon resource.new t (core func))
| 0x03 t:<valtype> => (canon resource.drop t (core func))
| 0x03 t:<typeidx> => (canon resource.drop t (core func))
| 0x04 t:<typeidx> => (canon resource.rep t (core func))
opts ::= opt*:vec(<canonopt>) => opt*
canonopt ::= 0x00 => string-encoding=utf8
Expand Down
Loading