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

Suggestion: implement async / await #5

Closed
RyanCavanaugh opened this issue Jul 15, 2014 · 6 comments
Closed

Suggestion: implement async / await #5

RyanCavanaugh opened this issue Jul 15, 2014 · 6 comments
Assignees
Labels
Suggestion An idea for TypeScript

Comments

@RyanCavanaugh
Copy link
Member

Implement TypeScript support for the proposed ES7 functionality for async functions

See http://wiki.ecmascript.org/doku.php?id=strawman:async_functions

@jamesmanning
Copy link

Just as a reference point for any others interested in async/await, experimental async/await support is available in traceur.

See https://github.com/google/traceur-compiler/wiki/LanguageFeatures#async-functions-experimental

It works well in my experience, and having it in TypeScript would make it a joy to use, in node especially. 😄

I put up a simple repo that shows using async/await with traceur and node at https://github.com/jamesmanning/node-traceur-asyncawait

@Diullei
Copy link

Diullei commented Jul 24, 2014

👍 👍 👍

@dthorpe
Copy link

dthorpe commented Aug 19, 2014

👍

@leidegre
Copy link

There was a lengthy discussion about this back in 2012 prominent also on the CodePlex site. One of the problems described there (by Mads Torgersen amongst others) was the lack of something to build it on top of. Like the Task abstraction in the .NET Framework.

Promises to me looks awfully a lot like that and what the TypeScript compiler will have to support is the rewiring of the program flow to use promises (specifically there seems to be a spec called Promises/A+ (http://promisesaplus.com/) that is exactly this glue).

I also find that there's a lesson here to be learned from the .NET Framework. For example, the AggregateException. Such a mechanism can be implemented in library alone and TypeScript does not have to offer a companion library for a feature which is largely source work.

What I'm trying to get at is that the way that async/await changes how you write code for the better. I'd rather see a TypeScript implementation of async/await on top of promises today (that will at least run in Chrome) than wait another two or three years for ES7 async to be wide spread.

@eggers
Copy link

eggers commented Nov 12, 2014

👍

@RyanCavanaugh RyanCavanaugh added Ready to Implement and removed Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. labels Dec 1, 2014
@mhegazy
Copy link
Contributor

mhegazy commented Jan 14, 2015

A more detailed proposal available in #1664.

@mhegazy mhegazy closed this as completed Jan 14, 2015
mhegazy pushed a commit that referenced this issue Mar 31, 2015
New TextStreamWriter interface with JSDoc and additional members
mhegazy pushed a commit that referenced this issue Feb 3, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

9 participants