# Async/await status?

**URL:** <https://forums.swift.org/t/async-await-status/24026>\
**Category:** Discussion\
**Tags:** concurrency\
**Created:** [May 1, 2019, 7:44pm UTC](https://forums.swift.org/t/async-await-status/24026 "2019-05-01T19:44:25Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Avi](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/avi/32/2962_2.png) [@Avi](https://forums.swift.org/u/Avi)\
**Post date:** [November 27, 2019, 8:28pm UTC](https://forums.swift.org/t/async-await-status/24026/23 "2019-11-27T20:28:18Z")

</div>

Apple is on Holiday shutdown. Please be polite, and realize that they are not being paid to provide instant replies to forum posts.

---

<div class="post-metadata">

**Author:** ![Jean-Daniel](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@Jean-Daniel](https://forums.swift.org/u/Jean-Daniel)\
**Post date:** [November 27, 2019, 11:39pm UTC](https://forums.swift.org/t/async-await-status/24026/24 "2019-11-27T23:39:53Z")

</div>

And as already said, async/await requires other features that have to be implemented first (like ownership manifesto).

And even with that, there is a lot of discussion to have (concurrency model, actors, …) before working on async/await which is just a syntactic sugar above what will be designed first.

---

<div class="post-metadata">

**Author:** ![reysabs](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@reysabs](https://forums.swift.org/u/reysabs)\
**Post date:** [November 28, 2019, 3:30am UTC](https://forums.swift.org/t/async-await-status/24026/25 "2019-11-28T03:30:17Z")

</div>

Callback is pretty messy in Asynchronous.  
I guess Callback Chris Lattner will do the job... eh?

---

<div class="post-metadata">

**Author:** ![tera](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tera/32/38201_2.png) [@tera](https://forums.swift.org/u/tera)\
**Post date:** [December 3, 2019, 6:48am UTC](https://forums.swift.org/t/async-await-status/24026/26 "2019-12-03T06:48:18Z")

</div>

is this the only place where concurrency topics are discussed? IIRC the kickoff for async/await, etc discussions was in 2017 and now is almost 2020, and it doesn't look heavily discussed here (unless there is a secret channel of course) and languages like kotlin that started later already have it but not us, and languages that started earlier can give us some great kickstarter ideas so we don't have to do everything from scratch?

until it is in the language, can anyone explain me in one or few lines from a bird view perspective, and from a user point of view -- what will be the massive benefits of this language feature compared to using one of the libraries in the wild that claim to provide coroutines / async/await today (i will not name them but there are a few). is that the quantity aspect, for example with those libraries i can create, say 100K coroutines while with the language ones I can have 1M or what?

---

<div class="post-metadata">

**Author:** ![sjavora](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/sjavora/32/9323_2.png) [@sjavora](https://forums.swift.org/u/sjavora)\
**Post date:** [December 3, 2019, 7:50am UTC](https://forums.swift.org/t/async-await-status/24026/27 "2019-12-03T07:50:54Z")

</div>

I tend to agree with some of this. It may just be a lack of effort on my part, but I find that I have no idea about what is planned/being implemented. Sure, there are manifestos and sometimes a person pops up saying that the core team is currently focused on the ownership model, but that’s about it. Is there a way to find the current state of these efforts? The development of Swift is largely guided (controlled even) by the core team, but we have little insight into what is actually happening. It is quite frustrating to be left in the dark like this. Or am I missing something? Is there a page similar to the [evolution proposal status](https://apple.github.io/swift-evolution/) for more long-term goals?

---

<div class="post-metadata">

**Author:** ![elhoov](https://avatars.discourse-cdn.com/v4/letter/e/47e85d/32.png) [@elhoov](https://forums.swift.org/u/elhoov)\
**Post date:** [December 3, 2019, 9:09am UTC](https://forums.swift.org/t/async-await-status/24026/28 "2019-12-03T09:09:03Z")

</div>

True but that requires the core team to focus some mental energy and effort into keeping us updated. I've been wondering if there's a niche opportunity for someone interested in journalism and technology to just be able to poke their mind and release weekly or even monthly news/interviews. It's a way for that person to gain visibility if they're able to make quality content and for the team to be able to keep us updated without expending much mental energy on it.

Disclaimer: I'm not interested in journalism myself, it's just an idea.

---

<div class="post-metadata">

**Author:** ![Avi](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/avi/32/2962_2.png) [@Avi](https://forums.swift.org/u/Avi)\
**Post date:** [December 3, 2019, 9:17am UTC](https://forums.swift.org/t/async-await-status/24026/29 "2019-12-03T09:17:29Z")

</div>

You can see what's being implemented by tracking commits to the github repo. Organizing the info by canvassing commit messages is left as an exercise for the reader.

---

<div class="post-metadata">

**Author:** ![tera](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tera/32/38201_2.png) [@tera](https://forums.swift.org/u/tera)\
**Post date:** [December 3, 2019, 3:12pm UTC](https://forums.swift.org/t/async-await-status/24026/30 "2019-12-03T15:12:01Z")

</div>

> [@](#):
>
> You can see what's being implemented by tracking commits to the github repo. Organizing the info by canvassing commit messages is left as an exercise for the reader.

all right, now i know what to answer my stakeholders when asked about the progress! 🙂

on a serious note, can anyone answer the second half:

> [@](#):
>
> until it is in the language, can anyone explain me in one or few lines from a bird view perspective, and from a user point of view -- what will be the massive benefits of this language feature compared to using one of the libraries in the wild that claim to provide coroutines / async/await today (i will not name them but there are a few). is that the quantity aspect, for example with those libraries i can create, say 100K coroutines while with the language ones I can have 1M or what?

i am all for the language feature (e.g. because there is no question which third party library to choose from, which is a big win to me), just want to understand the pros and cons better.

---

<div class="post-metadata">

**Author:** ![tera](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tera/32/38201_2.png) [@tera](https://forums.swift.org/u/tera)\
**Post date:** [December 3, 2019, 3:19pm UTC](https://forums.swift.org/t/async-await-status/24026/31 "2019-12-03T15:19:31Z")

</div>

agree. we need a guy like that:

> **[Rust's Journey to Async/await](https://www.infoq.com/presentations/rust-2019/)**
>
> Steve Klabnik gives an overview of Rust’s history, diving into the technical details of how the design has changed, and talks about the difficulties of adding a major new feature to a programming language.

---

<div class="post-metadata">

**Author:** ![elhoov](https://avatars.discourse-cdn.com/v4/letter/e/47e85d/32.png) [@elhoov](https://forums.swift.org/u/elhoov)\
**Post date:** [December 3, 2019, 5:25pm UTC](https://forums.swift.org/t/async-await-status/24026/32 "2019-12-03T17:25:37Z")

</div>

That's fine and could even be automated to be turned into a feed on a website, but that's assuming no one is working on features in a local branch in their PC that don't get pushed into the repo for a long time(or using other remotes). Is that the case?

---

<div class="post-metadata">

**Author:** ![gwendal.roue](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/gwendal.roue/32/13992_2.png) [@gwendal.roue](https://forums.swift.org/u/gwendal.roue)\
**Post date:** [December 3, 2019, 6:03pm UTC](https://forums.swift.org/t/async-await-status/24026/33 "2019-12-03T18:03:35Z")

</div>

Thanks, that's a good read!

---

<div class="post-metadata">

**Author:** ![Avi](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/avi/32/2962_2.png) [@Avi](https://forums.swift.org/u/Avi)\
**Post date:** [December 3, 2019, 6:30pm UTC](https://forums.swift.org/t/async-await-status/24026/34 "2019-12-03T18:30:19Z")

</div>

If you can't see the commits for any reason, they may as well not exist. There's no point at all in worrying about them, and there's no reason to expect to get any kind of regular updates about the status of such forks.

---

<div class="post-metadata">

**Author:** ![dwaite](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dwaite/32/1200_2.png) [@dwaite](https://forums.swift.org/u/dwaite)\
**Post date:** [December 3, 2019, 11:35pm UTC](https://forums.swift.org/t/async-await-status/24026/35 "2019-12-03T23:35:17Z")

</div>

> [@tera](#):
>
> is this the only place where concurrency topics are discussed? IIRC the kickoff for async/await, etc discussions was in 2017 and now is almost 2020, and it doesn't look heavily discussed here

I don't believe there have been any substantial additional discussions - there have been some underlying changes, and more are obviously needed. The focus for 5.x so far has been API stability, binary compatibility and module stability. 6.0 has not yet been started, so there is not yet a stated focus.

I would more items from the ownership manifesto, especially coroutines, to be added before async/await.

> [@](#):
>
> [Could other languages] give us some great kickstarter ideas so we don't have to do everything from scratch?

I expect there to be influences from LLVM's support for coroutines, C++ coroutines, Rust's async/await, and Objective-C callbacks as well as Actors from languages like Erlang.

> [@](#):
>
> until it is in the language, can anyone explain me in one or few lines from a bird view perspective, and from a user point of view -- what will be the massive benefits of this language feature compared to using one of the libraries in the wild that claim to provide coroutines / async/await today

Coroutine support in the compiler will likely enable optimizations including inlining coroutine code and reducing copying/reference counting. Coroutine libraries today likely all use thread pools (such as via lib dispatch), spinning the task off to another thread. This adds additional concurrency overhead and concurrency-related issues - coroutines themselves as a language feature will likely not rely on threading themselves at all, and may behave as value types. The scalability will be far better.

Also, first-class language support will likely have better syntax.

Longer term, it is possible features like actors might provide isolation, such that things like a precondition failure terminates an actor rather than the entire process.

---

<div class="post-metadata">

**Author:** ![tera](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tera/32/38201_2.png) [@tera](https://forums.swift.org/u/tera)\
**Post date:** [December 18, 2019, 12:04pm UTC](https://forums.swift.org/t/async-await-status/24026/36 "2019-12-18T12:04:49Z")

</div>

David, thanks for your thoughts.

do you think solutions based on green threads (like in Go) can give reasonable overhead and scaleability, on par with what we can achieve at the end of the day inside the language?

---

<div class="post-metadata">

**Author:** ![dwaite](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dwaite/32/1200_2.png) [@dwaite](https://forums.swift.org/u/dwaite)\
**Post date:** [December 18, 2019, 5:17pm UTC](https://forums.swift.org/t/async-await-status/24026/37 "2019-12-18T17:17:11Z")

</div>

> [@tera](#):
>
> do you think solutions based on green threads (like in Go) can give reasonable overhead and scaleability, on par with what we can achieve at the end of the day inside the language?

Oof 😅 I could write ten pages on that question easily.

Since you asked what I think personally, I think green threads are generally a bad idea. They are often a portability play in language runtimes/VMs, like Java (which long ago moved from green threads).they make ports an order of magnitude harder as well.

Async/await is easier to implement. IMHO, Golang’s use of green thread techniques came from a feature requirement on how parallelism is represented to the developer.

To the main question - I think emulating coroutines using native threads can provide “acceptable” performance for a lot of applications, but it will hardly be worth comparing to a mechanism handled by the compiler.

---

<div class="post-metadata">

**Author:** ![tera](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tera/32/38201_2.png) [@tera](https://forums.swift.org/u/tera)\
**Post date:** [December 18, 2019, 10:18pm UTC](https://forums.swift.org/t/async-await-status/24026/38 "2019-12-18T22:18:24Z")

</div>

> [@](#):
>
> Async/await is easier to implement.

it is hard to believe that, given how many years it took for C++/Rust/etc to do coroutines. looking at Gor Nishanov's C++ presentations on coroutines gives you an impression it was anything but easy to implement.

did anyone here try to use C/C++ coroutines from swift? e.g. wrap those inside Obj-C wrapper class and call that from swift, would that fly?

---

<div class="post-metadata">

**Author:** ![dwaite](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dwaite/32/1200_2.png) [@dwaite](https://forums.swift.org/u/dwaite)\
**Post date:** [December 18, 2019, 10:31pm UTC](https://forums.swift.org/t/async-await-status/24026/39 "2019-12-18T22:31:15Z")

</div>

> [@tera](#):
>
> it is hard to believe that, given how many years it took for C++/Rust/etc to do coroutines.

Yes, I'll fully admit I took the existing work out there to build upon into account when formulating my opinion.

---

<div class="post-metadata">

**Author:** ![nonameplum](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nonameplum/32/6450_2.png) [@nonameplum](https://forums.swift.org/u/nonameplum)\
**Post date:** [December 19, 2019, 7:18am UTC](https://forums.swift.org/t/async-await-status/24026/40 "2019-12-19T07:18:22Z")

</div>

> [@tera](#):
>
> did anyone here try to use C/C++ coroutines from swift? e.g. wrap those inside Obj-C wrapper class and call that from swift, would that fly?

I have found this [GitHub - belozierov/SwiftCoroutine: Swift coroutines for iOS, macOS and Linux.](https://github.com/belozierov/SwiftCoroutine)

---

<div class="post-metadata">

**Author:** ![tera](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tera/32/38201_2.png) [@tera](https://forums.swift.org/u/tera)\
**Post date:** [December 19, 2019, 12:18pm UTC](https://forums.swift.org/t/async-await-status/24026/41 "2019-12-19T12:18:22Z")

</div>

that one is "green threads" based (setjump/longjump)

it would be interesting to see the (upcoming) C++ coroutines (AFAIK available now in clang) used from within swift... they claim to be "the best coroutines ever" and claim to be interoperable with pretty much everything.

---

<div class="post-metadata">

**Author:** ![tera](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tera/32/38201_2.png) [@tera](https://forums.swift.org/u/tera)\
**Post date:** [December 20, 2019, 12:46am UTC](https://forums.swift.org/t/async-await-status/24026/42 "2019-12-20T00:46:03Z")

</div>

interesting article that favours the (green) thread approach (as in goroutines):  
[http://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/](http://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/)

[Previous page](https://forums.swift.org/t/async-await-status/24026.md?page=1)

[Next page](https://forums.swift.org/t/async-await-status/24026.md?page=3)
