-
Notifications
You must be signed in to change notification settings - Fork 58
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
Making Iced CoffeeScript compatible with ES7 #157
Comments
I prefer our semantics to ES7's, but of course don't want to be in the business of indefinitely rewriting the AST to hack coroutines. My current thought is to reimplement ICS using ES6's yield. That would significantly streamline my fork to CS, and will probably make for better performance and debuggability. More brainstorming here on that. So probably I'll strip out CS's emission of |
I also like your semantics over ES7's. It does not require having to add the "async" keyword before every asynchronous function. Since ES7 has not been finalized yet, have you considered proposing your semantics to the spec writers. It would be super if they opted to go with await/defer instead of await/async. https://esdiscuss.org/ |
I totally understand. I came across this meeting note on async/await got to it's current status: One thing I'm a bit confused about with the async/await pattern is how it deals with pre-existing asynchronous functions. For example a library or module that provides an asynchronous function. Would it require writing your own wrapper around it to add the 'async' keyword so that your wrapper can then be called with the 'await' keyword? The await/defer pattern does not have this issue and can easily handle pre-existing asynchronous functions. |
Any update on this? |
Future versions of JavaScript will be providing the await/async keywords to simplify asynchronous coding.
http://code.tutsplus.com/tutorials/a-primer-on-es7-async-functions--cms-22367
So eventually await/async will be part of coffeescript. Unfortunately all the programs we've written in iced-coffeescript using the await/defer pattern will not be compatible. It would have been nice if iced-coffeescript has used the await/async pattern so that it would eventually be compatible with a future version of coffeescript.
It is possible to use the ES7 await/ascync keywords now using pre-compilers like nodent.
https://www.npmjs.com/package/nodent
So it seems the await/async features can be provided with current versions of JavaScript.
Changing iced-coffeescript to support this pattern would be a breaking change with previous versions of iced-coffeescript. It would probably need to be a top level version change or another fork of coffeescript. Perhaps the new version of iced-coffeescript would serve a very useful function of providing upcoming features of JavaScript before they make it into coffeescript.
The text was updated successfully, but these errors were encountered: