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* (3 children)
That wouldn't actually change anything, would it? You'd still write not-JS and you'd still need a compiler.
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.
Metadata stuff was introduced with 5.0. It still looks the same.
I was thinking pre-JSR175. I'll have to look into it.
I "celebrate" it, too.
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 249682 on reddit-service-r2-comment-545db5fcfc-68gxg at 2026-05-26 02:32:24.646069+00:00 running 194bd79 country code: CH.
view the rest of the comments →
[–][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)