Skip to content

[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

Closed
wants to merge 2 commits into from
Closed

[Proposal] Coroutines (async/await) #815

wants to merge 2 commits into from

Conversation

igor9silva
Copy link

@igor9silva igor9silva commented Mar 22, 2018

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


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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo know?

Copy link
Author

@igor9silva igor9silva Mar 23, 2018

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 igor9silva changed the title Added async_swift_proposal [Proposal] Coroutines Mar 23, 2018
@igor9silva igor9silva changed the title [Proposal] Coroutines [Proposal] Coroutines (async/await) Mar 23, 2018
@CodaFi
Copy link
Contributor

CodaFi commented Mar 23, 2018

@igor9silva Did you contact either of this draft proposal’s authors to obtain their consent before publishing it here?

@igor9silva
Copy link
Author

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.

@DougGregor
Copy link
Member

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 DougGregor closed this Mar 23, 2018
@igor9silva
Copy link
Author

@DougGregor thanks for pointing out. I'll send a new PR as soon as I have a working implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants