Skip to content

Commit 331092b

Browse files
sunfishcodelukewagnerlann
authored
Reorganize the "Canonical Built-ins" section of Explainer.md. (#413)
* Reorganize the "Canonical Built-ins" section of Explainer.md. This moves the signatures for the canonical builtins out of prose paragraphs and into tables, which highlights them and simplifies the prose. This also adds "approximate signatures". The canonical ABI signatures are useful when one is writing compilers or bindings generators or other tools, while the approximate signatures are useful for people seeking to understand what these builtins do at a conceptual level, before thinking about how all the various values are lowered into `i32`s. And, the approximate signatures in theory are independent of the ABI, so they could be reused when new ABIs are added. * Refactor event.poll and event.wait and types. * Add documentation about the `repr<T>` type in the Canonical ABI. * Split `stream.read` and `stream.write` into separate sections. * Add the error-context to the Canonical ABI return type for `close-write`. * Document `resource.new`/`.drop` validation. * Change `complete`'s payload to `u32`. * Document that stream.new returns a writable-stream. * Desecribe how status values are lowered into the canonical abi. * Describe status ABIs, merge read/write again. * Document the `..1` and the "at most" behavior. * Document the `option<error-context>` in the Canonical ABI. * Document that `future.cancel-*` report at most 1 element. --------- Co-authored-by: Luke Wagner <mail@lukewagner.name> Co-authored-by: Lann <github-lann@lannbox.com>
1 parent d63f617 commit 331092b

File tree

2 files changed

+397
-91
lines changed

2 files changed

+397
-91
lines changed

design/mvp/Async.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,9 @@ comes after:
550550
[Lift and Lower Definitions]: Explainer.md#canonical-definitions
551551
[Lifted]: Explainer.md#canonical-definitions
552552
[Canonical Built-in]: Explainer.md#canonical-built-ins
553-
[`task.return`]: Explainer.md#-async-built-ins
554-
[`task.wait`]: Explainer.md#-async-built-ins
555-
[`thread.spawn`]: Explainer.md#-threading-built-ins
553+
[`task.return`]: Explainer.md#-taskreturn
554+
[`task.wait`]: Explainer.md#-taskwait
555+
[`thread.spawn`]: Explainer.md#-threadspawn
556556
[ESM-integration]: Explainer.md#ESM-integration
557557

558558
[Canonical ABI Explainer]: CanonicalABI.md

0 commit comments

Comments
 (0)