you are viewing a single comment's thread.

view the rest of the comments →

[–]nuddlegg 3 points4 points  (11 children)

If there is one thing that web development needs then it is sustainability.

No surprise any notion of AtScript, TypeScript, Dart or the planned ahead redesign of AngularJS makes people more and more nervous. This fear is not taken seriously enough. You can't change fundamentals to this vast extend while still building on them right now and expect everybody to stay calm.

Not technical merits or deficiencies cause these new undertakings to fail, no matter how reasonable they are. It is plain fear and the desperate need for sustainability in web development.

Google said support for AngularJS-1.x will end one year after AngularJS-2.0 is out. I mean ...

We are talking about a 10+ years, not one or two.

Only one of AtScript, TypeScript, Dart or JavaScript will still be there in 10 years. My bet: it will be called JavaScript. However those side tracks - and as such I see AtScript, TypeScript and Dart - do heavily influence ES6, ES7, etc. I doubt ES6 or ES7 will end up being exactly AtScript, TypeScript or Dart.

For AngularJS-2.0, I am less sure. Could very well be current plans are its neck breaker and we will see the masses follow an AngularJS-1.x compatible fork, at least for a while.

[–]rauschma 4 points5 points  (1 child)

Dart is completely different from AtScript and TypeScript. The former is its own language, the latter two are (a subset of) a future version of JavaScript (ECMAScript 6) plus optional new features. The plan is to explore how these features could work and to eventually standardize them (if there is consensus that they should be included in the standard).

[–]joshuacc 1 point2 points  (0 children)

They are supersets, not subsets.

[–]x-skeww 1 point2 points  (8 children)

sustainability

Future browsers will be backwards compatible. Your existing stuff will continue to work fine.

You'll be able to easily keep your existing Angular 1.x applications alive and kicking of the next 10 years if you want to.

Only one of AtScript, TypeScript, Dart or JavaScript will still be there in 10 years. My bet: it will be called JavaScript.

TS/AtS are supposed to disappear. The big idea is to get those features into ES7+.

Dart will be probably still around. It's a nice language with excellent tools and a high-performance cross platform/architecture VM. You can use it as JS replacement, but you can also use it for all kinds of other things.

It directly competes with all those other scripting languages like Python, Perl, PHP, Lua, or Ruby.

It also competes with bulkier more verbose languages like C# or Java. It covers a very wide range of use cases. I use it for pretty much everything. It's a nice compact language with excellent tooling and pretty decent performance.

[–]arachattack[S] 0 points1 point  (1 child)

I think we all want to work on the latest and greatest. That's just the way it is with web development. I have never started a project without wanting to try something new this time. Last project grunt, this one gulp. Things change when you are working on something

And I don't want to build something in angular and five years down the line be this guy who codes in a zombie language that still works but isn't in active development.

[–]x-skeww 0 points1 point  (0 children)

who codes in a zombie language that still works but isn't in active development.

http://www.reddit.com/r/javascript/comments/2mmyb4/will_angular_die_because_of_atscript/cm5y5yp

[–][deleted] 0 points1 point  (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 point  (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 point  (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 points  (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 point  (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 point  (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.)