CS2 Discussion: Project: Progress as of December 2016 #56
Description
We’re getting close. Since the last update, as of 2016-12-01 the following has been merged into the jashkenas/coffeescript 2
branch:
- Tagged template literals, thanks to @greghuc.
- Interpolated strings are now output as template literals (ES backtick syntax), thanks to @greghuc.
- Triple-backtick operator and escaped backticks in embedded JavaScript, thanks to @GeoffreyBooth.
- The browser tests work again, thanks to @GeoffreyBooth.
And as of November, we had accomplished:
- Async/await, thanks to @GabrielRatener.
- Arrow functions, function default parameters and function rest parameters, thanks to @GeoffreyBooth.
- Splats in arrays and function calls are output using ES2015 syntax, thanks to @connec.
- Computed properties are output using ES2015 syntax, thanks to @connec.
- Octal and binary literals are output as-is, thanks to @JimPanic.
- CoffeeScript is stricter about whitespace thanks to @eelco, and Literate CoffeeScript now understands Markdown thanks to @billymoon.
- Support for ES2015
for...of
is implemented, thanks to @atg. - Bugs were fixed by @alangpierce, @shreeve, @JimPanic, @GeoffreyBooth and others. Also thanks for feedback from @lydell and @jashkenas.
We’re closer than ever on classes. jashkenas/coffeescript#4354, by @connec, implements CoffeeScript classes compiled into ES classes, preserving just about all backward compatibility and outputting via the class
keyword, allowing CS classes to extend ES classes. All tests pass.
The PR is a hybrid, though, between the old 1.x output and idiomatic ES output. Classes to be extended are passed in via a wrapper and superClass
; super
is implemented via statements like a.__super__ = superClass.prototype
, etc. @connec’s current plan is to finish reorganizing the code in the current PR, then use a separate PR for cleaning up super
. Assistance with this effort is welcome. Once the current classes PR and follow-on super
PR are merged in, we can release the first alpha of CoffeeScript 2.0.0. We shouldn’t release 2.0.0-alpha1 any sooner, though, in case the current approaches to classes need reworking that might break backward compatibility more than the current PR does (for example, if super
ultimately can’t be used as is without changes).
Aside from that, we’ve crossed off most of the items on our features list. The only other item remaining is outputting ES2015 destructuring syntax, which should be along the lines of the already-completed ES2015 computed properties. Anyone up for this one?
Any day now CoffeeScript 1.12.0 will be released, which will bring tagged template literals, for…from
and the triple-backtick operator to the 1.x branch. Let’s follow it up with 2.0.0-alpha1!