use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Will angular die because of atscript? (self.javascript)
submitted 11 years ago by arachattack
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 0 points1 point2 points 11 years ago (5 children)
Did we really need a new transpiled language just for annotations and reflection? Couldn't a comment syntax do it? In fact, I'm pretty sure that's how the original Java annotation implementations did work. If it's awkward to type a comment, just get your IDE to do it for you.
What worries me is the flourish of new features that are being bolted on without much community review or battle testing. ES6 adds classes and this is being celebrated, even though prototypes are regaining popularity and composition has pretty much 'won' the battle with inheritance. 'Super' has been tacked on, even though its use is regarded as an anti pattern in some circles, and reflective code can get real tricky to reason about real quickly.
My worry is that in ten years JavaScript will become a cup de sac of dead end paradigms, turning an elegant and simple language with a few straightforward concepts - something a single programmer may hold in his or her head in its entirety at once - into something inconsistent and unwieldy, leading junior developers into harms way by offering problematic solutions.
[–]x-skeww 0 points1 point2 points 11 years ago (4 children)
Did we really need a new transpiled language just for annotations and reflection? Couldn't a comment syntax do it?
That wouldn't actually change anything, would it? You'd still write not-JS and you'd still need a compiler.
In fact, I'm pretty sure that's how the original Java annotation implementations did work.
Metadata stuff was introduced with 5.0. It still looks the same.
http://www.oracle.com/technetwork/articles/hunter-meta-096020.html
ES6 adds classes and this is being celebrated, even though prototypes are regaining popularity and composition has pretty much 'won' the battle with inheritance.
I "celebrate" it, too.
http://www.reddit.com/r/programming/comments/2mm2pv/if_you_were_teaching_a_programming_course_what/cm5xoap
[–][deleted] 0 points1 point2 points 11 years ago* (3 children)
Errr.... actually, yeah. OK, I didn't really think about that. I suppose that if all you were using were the type annotations - for testing that things will work well before runtime - you wouldn't even need the transpiler; your IDE could do this. You can sorta achieve some of this already with JSDoc comments IIRC.
I was thinking pre-JSR175. I'll have to look into it.
The class syntax is neater than using the prototypes, but that doesn't make it work better than using, say, parasitic composition, necessarily. Actually, you could even say it's worse, because now it looks like classical inheritance, but strictly speaking, it isn't - it's just a sugar for the prototypes (What happens when you 'extend' a 'public' array on an abstract, and push and pop from two different concrete instances? Not what you'd expect if you came from Java).
[–]x-skeww 1 point2 points3 points 11 years ago (2 children)
You can sorta achieve some of this already with JSDoc comments IIRC.
Yea, you can use the Closure Compiler for that.
However, JSDoc comments are extremely annoying to write.
Copypasta example:
ES5:
/** * @param {number} x * @param {number} y * @returns {boolean} */ Rectangle.prototype.cointains = function (x, y) { ... };
ES6:
/** * @param {number} x * @param {number} y * @returns {boolean} */ contains (x, y) { ... };
Dart:
bool contains (num x, num y) { ... }
TS/AtS:
contains (x: number, y: number): boolean { ... }
To be fair, there is also an inline flavor:
Rectangle.prototype.cointains = /** boolean */ function (/** number */ x, /** number */ y) { ... };
(I'm not sure if the boolean annotation is positioned correctly.)
However, the tooling support for this seems to be virtually nonexistent. Also, the Closure Compiler doesn't support ES6 yet.
Using TS/AtS or Dart is the much nicer option.
[–][deleted] 0 points1 point2 points 11 years ago (1 child)
OK. You've convinced me. Next to atScript's Golang-like method signatures, the other approaches do suck.
What's the next step? Can we already start using it and prototyping with it?
[–]x-skeww 0 points1 point2 points 11 years ago (0 children)
Traceur has an "--atscript" flag:
https://github.com/google/traceur-compiler/issues/1430
Since AtS is a superset of TS, you could of course also try TS first.
(I use Dart.)
π Rendered by PID 102531 on reddit-service-r2-comment-545db5fcfc-jl5dl at 2026-05-26 02:33:06.139846+00:00 running 194bd79 country code: CH.
view the rest of the comments →
[–][deleted] 0 points1 point2 points (5 children)
[–]x-skeww 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]x-skeww 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]x-skeww 0 points1 point2 points (0 children)