google / traceur-compiler

Traceur is a JavaScript.next-to-JavaScript-of-today compiler
Apache License 2.0
8.18k stars 580 forks source link

Traceur/AtScript Discussion Question: Decorators vs Annotations? (or both?) #1644

Open JeroMiya opened 9 years ago

JeroMiya commented 9 years ago

Crossing the streams a bit - the TypeScript proposal here (which is based on the Traceur/AtScript specification for annotations): https://github.com/Microsoft/TypeScript/issues/1557#issuecomment-70526879

Brought up some interesting discussion on the merits of annotations vs decorators. The discussion on the TypeScript issue seems to be leaning towards decorators, as envisioned in the TC-39 meeting notes:

https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-04/apr-10.md#decorators-for-es7 Tagging @wycats whom I believe is championing this feature for ES7, correct?

I think this might be an important discussion to have on the Traceur side as well. Is it feasible or desirable to have both annotations and decorators in the same language? Should Traceur be experimenting with decorators? Why or why not? I'd love to hear the Traceur/AtScript's take.

arv commented 9 years ago

Is it feasible or desirable to have both annotations and decorators in the same language?

No. We should pick one.

JeroMiya commented 9 years ago

What if decorators make it into the ES7 standard? As @EisenbergEffect has pointed out here (https://github.com/6to5/6to5/issues/559#issuecomment-72577187), decorators are being actively discussed for inclusion in the standard and AtScript style annotations are not (yet?).

arv commented 9 years ago

For Traceur we could do both until we pick one in TC39.

zdychacek commented 9 years ago

Decorators are already implemented in Babel. Is Traceur going to support them too?

https://github.com/wycats/javascript-decorators

arv commented 9 years ago

That was the plan. I don't have time to work on it... patches welcome.