Skip to content
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

Add async/await sugar on top of generators/yield #3747

Closed
GabrielRatener opened this issue Dec 1, 2014 · 11 comments
Closed

Add async/await sugar on top of generators/yield #3747

GabrielRatener opened this issue Dec 1, 2014 · 11 comments
Labels

Comments

@GabrielRatener
Copy link
Contributor

Should CS support async/await sugar on top of generators and yield?

This can be done with little overhead, and seems like sensible sugar to add to the language, since generators and yield are used largely to pause function execution and resolve promises.

@vendethiel
Copy link
Collaborator

I don't think we're going to support es7 features before any environment supports it. Wontfix for now.

@GabrielRatener
Copy link
Contributor Author

What do you mean by environment?

@vendethiel
Copy link
Collaborator

Browsers, node, etc.

@GabrielRatener
Copy link
Contributor Author

I see, what is the motivation for doing this?

@snowyu
Copy link

snowyu commented Dec 2, 2014

this(Browser and below node 0.11.2) can be supported via regenerator.

So we need async/await now.

@vendethiel
Copy link
Collaborator

@jashkenas expressed his intent here: #3073 (comment)

@GabrielRatener
Copy link
Contributor Author

@vendethiel CS has always implemented features that were not, and still are not in JS. That is the whole point of CS. How would this be any different?

@vendethiel
Copy link
Collaborator

No, that's not the case. Features added were not "as ES6" (because those weren't pinned at the time). class, super, do (our let) have different semantics compared to ES6's.

@GabrielRatener
Copy link
Contributor Author

I am not talking about ES6 features speifically. In general CS has added sugar over JS. Is the only reason to not implement async/await, the fact that a similar feature is in the proposal phase fo ES7?

@jashkenas
Copy link
Owner

@GabrielRatener If you'd like to see a more serious discussion of this idea happen, please open a pull request with a sketch of how you'd propose to implement async and await on top of generators. Then we can actually talk about it.

@GabrielRatener
Copy link
Contributor Author

@jashkenas Just opened PR #3757, full proposal, tested and ready to be tried.

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

No branches or pull requests

4 participants