Hi all,
We've been revising the Structured Concurrency pitch document a bit to try to explain more about the design goals and fill in some gaps based on the discussion in the first pitch thread. Here's a list of the changes in this second pitch document:
- Added a "desugaring" of
async let
to task groups and more motivation for the structured-concurrency parts of the design. - Reflowed the entire proposal to focus on the general description of structured concurrency first, the programming model with syntax next, and then details of the language features and API design last.
- Reworked the presentation of the Task APIs with more rationale for the design.
- Added more discussion of why futures aren't more prominent.
- "Task nursery" has been replaced with "task group".
- Added support for asynchronous
@main
and top-level code. - Specify that
try
is not required in the initializer of anasync let
, because the thrown error is only observable when reading from one of the variables. -
withUnsafe(Throwing)Continuation
functions have been moved out of theTask
type. - Note that an
async let
variable can only be captured by a non-escaping closure. - Removed the requirement that an
async let
variable be awaited on all paths.
The latest draft is available here.
Comments welcome!
Doug