-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[Proposal] Coroutines (async/await) #815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
The most commonly cited alternative design is to follow the model of (e.g.) C#, where calls to async functions return a future (aka `Task` in C#), instead of futures being a library feature separable from the core language. Going this direction adds async/await to the language instead of adding a more general coroutine feature. | ||
|
||
Despite this model being widely know, we believe that the proposed design is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo know
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be known
, thanks.
@igor9silva Did you contact either of this draft proposal’s authors to obtain their consent before publishing it here? |
Not exactly. I've just expressed the will to go forward with it, but I did not receive any permission. As it was publicly available, and I'm willing to work on an implementation, I thought it was ok to proceed with the pull request. If it's not or any of the authors are against it, I intend to withdraw and work on a proposal myself. |
From a process perspective we can't run a review on this without an implementation. @lattner has a prototype over at swiftlang/swift#11501 that could provide a starting point, and @rjmccall has made a bunch of progress on coroutine support within the compiler itself. If your goal it to iterate on the design itself, reviving the pitch on the evolution forums is the best approach. If you're interested in pushing the implementation forward, we can talk about that on the compiler-implementation part of the forums. So, I'm going to close this pull request because it's not actionable from a review standpoint. Let's keep working toward this feature via forum discussion and the Swift compiler implementation itself. |
@DougGregor thanks for pointing out. I'll send a new PR as soon as I have a working implementation. |
This proposal suggests an implementation for a widely known discussion regarding coroutines support, which is the base a for a modern asynchronous model (async/await, generators, ...).
cc @lattner @jckarter