Repository navigation
Suggestion: implement async / await #5
Description
Activity
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
👍 👍 👍
👍
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.
👍
- added and removedNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.
on Dec 1, 2014 A more detailed proposal available in #1664.
- added a commit that references this issue
on Mar 31, 2015 - added a commit that references this issue
on Feb 3, 2016 - locked and limited conversation to collaborators
on Jun 18, 2018
Implement TypeScript support for the proposed ES7 functionality for async functions
See http://wiki.ecmascript.org/doku.php?id=strawman:async_functions