[swift-evolution] [Concurrency] async/await + actors
Chris Lattner
clattner at nondot.org
Fri Aug 18 22:39:47 CDT 2017
> On Aug 18, 2017, at 6:04 PM, Yuta Koshizawa <koher at koherent.org> wrote:
>
> Hi, I have a question about the proposed `async/await`.
>
> Are `throws async` and `await try` allowed? I think we have three options.
>
> 1. allows only `async throws`-`try await`
> 2. allows both `async throws`-`try await` and `throws async`-`await try` and does not distinguish them
> 3. allows both and distinguishes them like `Promise<Result<T>>` and `Result<Promise<T>>`
>
> Although 3 is the most expressive, I think it is too complicated. In most cases we need only something similar to `Promise<Result<T>>`. To select 1 also makes it possible to support 3 in the future. So 1 seems a good choice to me.
I agree. If we are going to keep “async” and “throws” as unrelated axes on a matrix, then there cannot be a relationship implied by the ordering. “throws async” and “async throws” need to mean the same thing.
-Chris
More information about the swift-evolution
mailing list