Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first batch of async support #363

Merged
merged 15 commits into from
Jul 3, 2024
Merged
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
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This repository is where the component model is being standardized. For a more user-focused explanation, take a look at the **[Component Model Documentation]**.

This repository describes the high-level [goals], [use cases], [design choices]
and [FAQ] of the component model as well as a more-detailed [assembly-level explainer], [IDL],
[binary format] and [ABI] covering the initial Minimum Viable Product (MVP)
release.
This repository contains the high-level [goals], [use cases], [design choices]
and [FAQ] of the component model as well as a more-detailed, low-level
[AST explainer], [async explainer], [IDL], [binary format] and [ABI] covering
the initial Minimum Viable Product (MVP) release.

In the future, this repository will additionally contain a [formal spec],
reference interpreter and test suite.
Expand All @@ -27,7 +27,8 @@ To contribute to any of these repositories, see the Community Group's
[use cases]: design/high-level/UseCases.md
[design choices]: design/high-level/Choices.md
[FAQ]: design/high-level/FAQ.md
[assembly-level explainer]: design/mvp/Explainer.md
[AST explainer]: design/mvp/Explainer.md
[async explainer]: design/mvp/Async.md
[IDL]: design/mvp/WIT.md
[binary format]: design/mvp/Binary.md
[ABI]: design/mvp/CanonicalABI.md
Expand Down
485 changes: 485 additions & 0 deletions design/mvp/Async.md

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions design/mvp/Binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ label' ::= len:<u32> l:<label> => l (if len = |l|)
valtype ::= i:<typeidx> => i
| pvt:<primvaltype> => pvt
resourcetype ::= 0x3f 0x7f f?:<funcidx>? => (resource (rep i32) (dtor f)?)
| 0x3e 0x7f f:<funcidx> cb?:<funcidx>? => (resource (rep i32) (dtor async f (callback cb)?))
functype ::= 0x40 ps:<paramlist> rs:<resultlist> => (func ps rs)
paramlist ::= lt*:vec(<labelvaltype>) => (param lt)*
resultlist ::= 0x00 t:<valtype> => (result t)
Expand Down Expand Up @@ -270,16 +271,24 @@ canon ::= 0x00 0x00 f:<core:funcidx> opts:<opts> ft:<typeidx> => (canon lift
| 0x01 0x00 f:<funcidx> opts:<opts> => (canon lower f opts (core func))
| 0x02 rt:<typeidx> => (canon resource.new rt (core func))
| 0x03 rt:<typeidx> => (canon resource.drop rt (core func))
| 0x07 rt:<typdidx> => (canon resource.drop rt async (core func))
| 0x04 rt:<typeidx> => (canon resource.rep rt (core func))
| 0x05 ft:<typeidx> => (canon thread.spawn ft (core func))
| 0x06 => (canon thread.hw_concurrency (core func))
| 0x08 ft:<core:typeidx> => (canon task.start ft (core func))
| 0x09 ft:<core:typeidx> => (canon task.return ft (core func))
| 0x0a => (canon task.wait (core func))
| 0x0b => (canon task.poll (core func))
| 0x0c => (canon task.yield (core func))
opts ::= opt*:vec(<canonopt>) => opt*
canonopt ::= 0x00 => string-encoding=utf8
| 0x01 => string-encoding=utf16
| 0x02 => string-encoding=latin1+utf16
| 0x03 m:<core:memidx> => (memory m)
| 0x04 f:<core:funcidx> => (realloc f)
| 0x05 f:<core:funcidx> => (post-return f)
| 0x06 => async
| 0x07 f:<core:funcidx> => (callback f)
```
Notes:
* The second `0x00` byte in `canon` stands for the `func` sort and thus the
Expand Down
Loading
Loading