[Concurrency] Structured concurrency

Scopes are typically implicit (i.e. usually there's no handle to them) so if the nursery wasn't passed as an argument I would agree that "task scope" would be the best name for the concept.

As it is though, inner closures can reference the nursery and add tasks to it, so I think nurseries are "task groups" really. It also feels like groups carry a lot less cognitive weight than scopes and most Swift programmers are already familiar with groups from libdispatch, which could help with adoption.

The distinction is minor and I guess I'm fine either way, but thought I'd throw this in for consideration.

1 Like