Skip to content

Commit

Permalink
Rename 'error' to 'error-context'
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewagner committed Nov 7, 2024
1 parent f9b341b commit e8d192e
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 192 deletions.
13 changes: 9 additions & 4 deletions design/mvp/Async.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ g: func(s: stream<T>) -> stuff;
```
`g(f(x))` works as you might hope, concurrently streaming `x` into `f` which
concurrently streams its results into `g`. If `f` has an error, it can close
its returned `stream<T>` with an [`error`](Explainer.md#error-type) value
which `g` will receive along with the notification that its readable stream
was closed.
its returned `stream<T>` with an [`error-context`](Explainer.md#error-context-type)
value which `g` will receive along with the notification that its readable
stream was closed.

If a component instance *would* receive the readable end of a stream for which
it already owns the writable end, the readable end disappears and the existing
Expand Down Expand Up @@ -516,7 +516,8 @@ For now, this remains a [TODO](#todo) and validation will reject `async`-lifted

Native async support is being proposed incrementally. The following features
will be added in future chunks roughly in the order list to complete the full
"async" story:
"async" story, with a TBD cutoff between what's in [WASI Preview 3] and what
comes after:
* `nonblocking` function type attribute: allow a function to declare in its
type that it will not transitively do anything blocking
* define what `async` means for `start` functions (top-level await + background
Expand All @@ -529,6 +530,8 @@ will be added in future chunks roughly in the order list to complete the full
* some way to say "no more elements are coming for a while"
* `recursive` function type attribute: allow a function to be reentered
recursively (instead of trapping) and link inner and outer activations
* add `stringstream` specialization of `stream<char>` (just like `string` is
a specialization of `list<char>`)
* allow pipelining multiple `stream.read`/`write` calls
* allow chaining multiple async calls together ("promise pipelining")
* integrate with `shared`: define how to lift and lower functions `async` *and*
Expand Down Expand Up @@ -572,3 +575,5 @@ will be added in future chunks roughly in the order list to complete the full
[stack-switching]: https://github.com/WebAssembly/stack-switching/
[JSPI]: https://github.com/WebAssembly/js-promise-integration/
[shared-everything-threads]: https://github.com/webAssembly/shared-everything-threads

[WASI Preview 3]: https://github.com/WebAssembly/WASI/tree/main/wasip2#looking-forward-to-preview-3
8 changes: 4 additions & 4 deletions design/mvp/Binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ primvaltype ::= 0x7f => bool
| 0x75 => f64
| 0x74 => char
| 0x73 => string
| 0x64 => error
| 0x64 => error-context
defvaltype ::= pvt:<primvaltype> => pvt
| 0x72 lt*:vec(<labelvaltype>) => (record (field lt)*) (if |lt*| > 0)
| 0x71 case*:vec(<case>) => (variant case+) (if |case*| > 0)
Expand Down Expand Up @@ -308,9 +308,9 @@ canon ::= 0x00 0x00 f:<core:funcidx> opts:<opts> ft:<typeidx> => (canon lift
| 0x19 t:<typeidx> async?:<async?> => (canon future.cancel-write async? (core func)) 🔀
| 0x1a t:<typeidx> => (canon future.close-readable t (core func)) 🔀
| 0x1b t:<typeidx> => (canon future.close-writable t (core func)) 🔀
| 0x1c opts:<opts> => (canon error.new opts (core func)) 🔀
| 0x1d opts:<opts> => (canon error.debug-message opts (core func)) 🔀
| 0x1e => (canon error.drop (core func)) 🔀
| 0x1c opts:<opts> => (canon error-context.new opts (core func)) 🔀
| 0x1d opts:<opts> => (canon error-context.debug-message opts (core func)) 🔀
| 0x1e => (canon error-context.drop (core func)) 🔀
async? ::= 0x00 =>
| 0x01 => async
opts ::= opt*:vec(<canonopt>) => opt*
Expand Down
Loading

0 comments on commit e8d192e

Please sign in to comment.