-
Notifications
You must be signed in to change notification settings - Fork 4
CS2 Discussion: Project: Core Features #8
Comments
Using the ECMAScript 6 compatibility list as a reference for prioritizing is probably a good idea. That said, I think fat-arrow functions, I second prioritizing async/await rather low compared to the rest. I'm not even sure how far this is standardized already anyways? |
Why do we need fat arrow functions? Or special sugar for decorators? We don't have function or class statements, so we can apply decorators by just putting them in front of the function or class we're decorating. Say you have a decorator called f = memo (args...) -> console.log args
j = (memo 10) (args...) -> console.log args That syntax works fine.
I think we should prioritise classes and modules way above that other stuff personally. We can't use CoffeeScript with a growing chunk of the JS ecosystem because we can't import a module or extend a class, making CoffeeScript partially obsolete. The other stuff is just nice to have.
|
Well, we don't. But:
Ultimately I agree that it shouldn't be a Top Priority, but would definitely like to see it in V1. |
ES6 has it, so we should too 😉 Of course, that doesn't mean it should be a Top Priority. However, I'm not sure the workaround you suggested would work with classes? pureRender
class MyComponent extends React.Component Or methods, for that matter – in ES6, you can do: const myObj = {
@someDecorator
method() {
return 1;
}
} I'm not sure how that would look in Coffee? |
While I don't think async/await is as important as classes, modules, and possibly a few others, I definitely don't think we should wait that long – by then, it'll be too late. People are already using the feature in Babel and TypeScript, and have been for a while – and experimental support landed in Chrome several weeks ago. Not only that, but it may be tricky to do (thus requiring a lead time) and is a feature designed to fix one of the most bothersome parts of JavaScript programming (node especially) – callback hell and neverending promises. |
Hmm, fair. I'd rather not force hacks, though, when we can build a feature people seem to want. |
Let's move the decorators and async/await convo's to separate threads and keep this thread centered around prioritization. @carlsmith would you mind moving your comments there to keep this thread clean? I'll do the same. |
Closing as this has been "officially" (if tentatively) decided in the Features.md file. Further discussion can happen around Pull Requests seeking to modify that file. |
This issue was moved to jashkenas/coffeescript#4906 |
EDIT: this is now better-documented in the Features.md file. Leaving the below for posterity.
@DomVinyard proposed these as the "core four" for this effort:
These are things that we "absolutely, definitely need", and will take priority over other changes.
However, this list may be too short. Other possibilities:
In particular, Async/Await, being less widely supported and used at this point, may not make sense to take priority over more widely used features like decorators, or more core-to-the-language features like
const
andfor
.Thoughts?
EDIT: I'll keep this bit as an evolving understanding:
Tier 1
(features essential for JavaScript interop):
Tier 1A
(breaking changes that catch CS up with ES6)
Tier 2
(non-essential, popular ES6 Good Parts)
Tier 3
(non-essential ES6 features and new features)
The text was updated successfully, but these errors were encountered: