[Concurrency] Add `async` to the Swift type system.

Modern development involves a lot of asynchronous programming, implemented in Swift using closures and completion handlers. However, implementing asynchronous operations using closures can quickly become problematic, and tasks such as error handling and conditional execution become harder to do correctly. Coroutines are a specialized type of subroutine/function which allows for execution to be suspended and resumed, and the coroutine model has long been proposed as a Swift language extension to make asynchronous programming more natural and less error-prone. In this pull request, Doug Gregor begins the introduction of coroutines to Swift, adding async to the Swift type system. A good first step towards a better asynchronous future.

Why Coroutines

Coroutines are a general form of subroutine (function) that don’t follow normal subroutine rules. Coroutines can exit (return) whenever they call other coroutines, and can pick up where they left off when called again. In this post, Joshua Emmons explains why coroutines are becoming extremely relevant in Swift, particularly so when we consider the async/await proposal being discussed in Swift evolution. This is a great explanation for anyone unsure of what a coroutine is and how they might be used in Swift.