# SE-0296: async/await

**URL:** <https://forums.swift.org/t/se-0296-async-await/42605>\
**Category:** Proposal Reviews\
**Created:** [December 8, 2020, 6:23pm UTC](https://forums.swift.org/t/se-0296-async-await/42605 "2020-12-08T18:23:26Z")\
**Posts on this page:** 7\
**Page:** 11

<div class="post-metadata">

**Author:** ![Douglas\_Gregor](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/douglas_gregor/32/1362_2.png) [@Douglas\_Gregor](https://forums.swift.org/u/Douglas_Gregor)\
**Post date:** [December 23, 2020, 7:11pm UTC](https://forums.swift.org/t/se-0296-async-await/42605/205 "2020-12-23T19:11:53Z")

</div>

> [@xwu](#):
>
> This is a great point; it makes lots of sense and is explained very clearly. Can it be recorded for posterity in the proposal text?

Sure, I stubbed out some wording here: [[SE-0296] Add Alternative Considered for async/await as Futures sugar · DougGregor/swift-evolution@0c1d578 · GitHub](https://github.com/DougGregor/swift-evolution/commit/0c1d578e9ccbf778ad544ca7a4f955bee6511bf2)

> [@Nevin](#):
>
> You were able to quickly summarize why you see async / await as a better fit for Swift than basing everything on futures. That shows you have already thought about the matter.
> 
> In other words, you have already considered a futures-based concurrency system, and you have determined that async / await is preferable. That is the type of information which should be documented in the “alternatives considered” section.

Yes, we had considered it. It's not a good match for Swift. I've now documented why it in Alternatives Considered for posterity.

There is no way for authors to predict what people in a review will think is an idea that "must" be considered as an alternative or else the proposal is incomplete. That's what discussion is for, and some things that come up in discussion get promoted to "Alternatives Considered."

Doug

---

<div class="post-metadata">

**Author:** ![Douglas\_Gregor](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/douglas_gregor/32/1362_2.png) [@Douglas\_Gregor](https://forums.swift.org/u/Douglas_Gregor)\
**Post date:** [December 23, 2020, 7:22pm UTC](https://forums.swift.org/t/se-0296-async-await/42605/206 "2020-12-23T19:22:02Z")

</div>

> [@Mordil](#):
>
> @davedelong as a side-note, it was explicitly mentioned through the [`Result` proposal review](https://forums.swift.org/t/revised-se-0235-add-result-to-the-standard-library/18371) that the intention is that the type might end up deprecated and was a stop-gap for when we had a first-class concurrency model so that you just annotate `async throws` on a method and never deal with `Result` again.

Part of the reason that `Result` was kept out of the standard library so long is because it's duplicative of `throws`, which causes confusion. `Result` was also [primarily motivated by asynchronous code patterns](https://github.com/apple/swift-evolution/blob/main/proposals/0235-add-result.md#asynchronous-apis) that we knew could be subsumed by an `async` analogue to `throws` in time. But we also knew that "in time" was going to be several years, and having numerous `Result` re-implementations in the ecosystem.

`async`/`await` may only have come up for formal review two weeks ago, but this approach to solving the problem has been around in the Swift community for ~4 years.

Doug

---

<div class="post-metadata">

**Author:** ![Nevin](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nevin/32/617_2.png) [@Nevin](https://forums.swift.org/u/Nevin)\
**Post date:** [December 23, 2020, 7:50pm UTC](https://forums.swift.org/t/se-0296-async-await/42605/207 "2020-12-23T19:50:55Z")

</div>

> [@Douglas\_Gregor](#):
>
> There is no way for authors to predict what people in a review will think is an idea that "must" be considered as an alternative

But there is a way for the authors to list the alternatives they actually _did_ consider.

---

<div class="post-metadata">

**Author:** ![Nevin](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nevin/32/617_2.png) [@Nevin](https://forums.swift.org/u/Nevin)\
**Post date:** [December 23, 2020, 7:51pm UTC](https://forums.swift.org/t/se-0296-async-await/42605/208 "2020-12-23T19:51:57Z")

</div>

> [@Nevin](#):
>
> The proposal includes these lines:
> 
> > Instead, think of an asynchronous function as an ordinary function that has the special power to give up its thread. Asynchronous functions don’t typically use this power directly; instead, they make calls, and sometimes these calls will require them to give up their thread and wait for something to happen. When that thing is complete, the function will resume executing again.
> 
> It says that an async function doesn’t _typically_ give up its thread directly. This implies that an async function _can_ give up its thread directly.
> 
> Is that capability in fact being proposed?
> 
> If so, what is the proposed spelling?
> 
> When an async function directly gives up its thread, how can it specify when to resume execution?

I still have not seen a response to this. Perhaps I missed it?

---

<div class="post-metadata">

**Author:** ![Lantua](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lantua/32/8868_2.png) [@Lantua](https://forums.swift.org/u/Lantua)\
**Post date:** [December 23, 2020, 10:51pm UTC](https://forums.swift.org/t/se-0296-async-await/42605/209 "2020-12-23T22:51:34Z")

</div>

> [@kavon](#):
>
> Use `suspends` (or something other than `async` ) in the function type, and keep `async let` to mean spawning a new task and binding an opaque promise / future, etc.

`suspend` is a little long. Maybe we could shorten it to `sus`...

I’ll see myself out...

---

<div class="post-metadata">

**Author:** ![ben-cohen](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ben-cohen/32/296_2.png) [@ben-cohen](https://forums.swift.org/u/ben-cohen)\
**Post date:** [December 24, 2020, 12:08am UTC](https://forums.swift.org/t/se-0296-async-await/42605/210 "2020-12-24T00:08:01Z")

</div>

The review period has now ended and the proposal has been [accepted](https://forums.swift.org/t/accepted-with-modification-se-0296-async-await/43318).

Thanks to everyone who participated!

---

<div class="post-metadata">

**Author:** ![ben-cohen](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ben-cohen/32/296_2.png) [@ben-cohen](https://forums.swift.org/u/ben-cohen)\
**Post date:** [December 24, 2020, 12:13am UTC](https://forums.swift.org/t/se-0296-async-await/42605/211 "2020-12-24T00:13:49Z")

</div>

Closed on December 24, 2020, 12:13am UTC



[Previous page](https://forums.swift.org/t/se-0296-async-await/42605.md?page=10)
