
Angular Announces AngularDart - mushishi
http://news.dartlang.org/2013/11/angular-announces-angulardart.html
======
WoodenChair
If you don't like Dart, don't use it. Nobody is taking away your AngularJS.
Google has a right to promote whatever language it thinks will give it a
competitive advantage. You have a right to be revolted by it.

However, the hyperbole surrounding anything that even remotely, several years
down the line, may threaten the monopoly of JavaScript on the client side web
is ridiculous. Language competition is good - it ultimately will make for a
better JavaScript.

Personally, I think there are a lot of people deeply invested in Javascript
who fear anything that even remotely, one day in the super future, may
threaten their skill set. That's understandable - it's the same way MS
developers scoffed at learning Objective-C when the iOS ecosystem blew up and
the Windows monopoly didn't matter as much.

Let's inject some reality - Dart is no threat to JavaScript for the
foreseeable future. AngularJS is not going anywhere. Dart can't be forced down
your throat, because no consumer browser even supports it natively yet. You
don't need to use it, you don't even need to think about it. Let the people
that like it be.

~~~
Helianthus
Just because it can't be forced down our throat doesn't mean it's not
uncomfortable that Google's trying.

~~~
btian
When did Google try to force Dart down your throat? Just because Angular is
being ported to Dart? Seriously? Are you saying that Dart developers don't
deserve Angular?

~~~
Helianthus
Way I see it, _no one_ deserves the misfortune of Angular. ;)

------
cpprototypes
When I look at Dart vs JS (JavaScript), I see a lot of parallels to Java/C#.
The Java language stagnated for a long time under Sun. The language was usable
only through the heroic efforts of tool vendors (Eclipse, IntelliJ, etc.) Even
with these tools, Java is just barely good enough.

C# is technically a superior language to Java. Combined with an excellent IDE
(VS), the .NET platform is probably technically superior to the Java platform.
However, .NET did not destroy Java. And it's because Java is superior to .NET
in many non-technical areas (such as a better open source community). And
other solutions appeared to help the Java platform with the language
stagnation issue (Scala, Clojure, Groovy, etc.). Now Java itself is somewhat
catching up (Java 8) and the JVM platform remains a powerful and thriving
community.

The situation with Dart and JS seems to be similar. The JS language has
stagnated for a long time. Google is trying to be like MS with C# and created
Dart to fully replace JS. And Dart is probably technically superior to JS. But
just like Java vs C#, I don't think technical superiority will be enough.

The JS platform is addressing the language issue with CoffeeScript,
TypeScript, and others, just like Scala and Clojure appeared for the JVM. And
JS itself is improving slowly (ECMAScript 6) just like Java 8. And the JS open
source community is very very strong (all the web related libraries and
frameworks and now additional strength from Node.JS) and it's unlikely Dart
will have a comparable community. I think that Dart may achieve some success
like .NET/C# did. However, I don't think it will destroy JS like Google hopes
it will. The JS platform is just like the JVM platform. Has so many flaws, but
is good enough.

~~~
sek
Not a good comparison.

Java and C# are both well designed server side languages. C# has the simple
advantage of being younger and learn from Java in the real world.

JavaScript in the real world is not even close to Dart. JavaScript is
currently trying to solve problems Java never had to begin with.

In almost every category Dart is technically superior. Shouldn't be a
surprise, they took their time and learned from more than a decade of dealing
with JavaScript. They are also not done yet, they are planning to inject
binary code directly into memory.

Just look at Lars Bak's history, he is the right guy to create the
Java/JavaScript successor for the web.

------
nateabele
_Sigh_... I knew this was going to happen. :-/ This is part of Google's
strategy to push Dart in the browser. Soon they're going to start developing
Angular primarily in Dart, and 'back-porting' features to JavaScript.

Sadly, this is the nature of so-called "Open Source" at Google.

~~~
recuter
First of all, this was already announced months ago, so it already happened.

Secondly, Google is a big company and some teams within it wanted to use Dart,
whereas otheres want to use vanila javascript and Angular, so now you have
both.

Thirdly, Angular is in the process of being broken apart to modular components
for 2.0, it also now cross-pollinates with another Google-y called Web
Components.

In future, the equivelent of directives (Your own <x-thingy> tags) will be a
native web standard, Mozilla is also working on it.

This all amounts to a sort of polyfill to the future and most of the core of
Angular will be thrown away if things work out. You won't need it.

These are all good things. I don't understand your need for FUD.

~~~
nateabele
You're able to regurgitate bullet points off a slide deck. Good job.

Edit: [source & details redacted]

This 'FUD' comes directly from the Angular core team.

~~~
pygy_
You just outed your source.

Edit: still too many details.

~~~
nateabele
Better now? ;-)

~~~
pygy_
Yup. I improved mine as well.

------
jimrhoskins
I'm so confused by the comments here. Did I miss a line where they say
AngularJS is being discontinued for AngularDart?

~~~
dchest
It's normal; wait until you see something about Google Reader.

------
mjibson
I'm excited for this. I have a fair sized angularjs app that is getting
unwieldy, and having a compiler that yells at me about type problems sounds
great. Even if dart doesn't get supported by non-Chrome browsers, I think it
could still provide lots of value to developers: it has the same useful type
checking as typescript, with some other needed features. It is possible that
the transpilation to JS will cause problems, but overall I think it'll be a
better dev experience producing better software.

~~~
srin
Yeah I started making a chrome app for my own use and it's starting to get to
a point where if I don't work on it for a while, I spend a bit too much time
making sure I'm not creating bugs interacting with old code

Also, Chrome apps seem to be a great use for this even if no other browsers
embed a dart VM (if it gets to that). I'm just not seeing why this is so bad

------
Max_Horstmann
I like both Angular and Dart, so that's good news.

One thing I noticed though: transpiling a .dart file with just the import
statement for AngularDart (import 'package:angular/angular.dart') generates a
non-minified 5MB .js file with almost 150 kloc. Every code change will create
a new version of it, invalidating previously cached versions. :/

~~~
floitsch
Are you sure you are using the latest version? Angular was an early user of
mirrors (reflection) which (more or less) disabled the tree-shaking of
dart2js. This was recently improved.

Tracking the size of AngularDart: [https://github.com/jbdeboer/angular-dart-
js-size](https://github.com/jbdeboer/angular-dart-js-size)

~~~
Max_Horstmann
Maybe I'm missing something, but yes, I think so. Dart version
0.8.10.3_r29803.

pubspec.yaml:

name: test1 dependencies: browser: any angular: git:
[https://github.com/angular/angular.dart.git](https://github.com/angular/angular.dart.git)

test1.dart:

import 'package:angular/angular.dart'; main() => ngBootstrap();

dart2js launch => builds test1.dart.js, about 5MB, 142,749 loc.

~~~
jbdeboer
Yes. You need to add a @MirrorsUsed annotation in your main.dart file. See
[https://github.com/jbdeboer/angular-dart-js-
size/blob/master...](https://github.com/jbdeboer/angular-dart-js-
size/blob/master/main.dart) for our current best practices.

You should get ~173KB gzipped, minified dart2js output.

~~~
Max_Horstmann
Beautiful. Thanks!

------
cletus
I'm really starting to get tired of the cynical and snarky negativity on HN.

Whoever thinks this is part of some grand plan to force Dart down our throats
clearly has no clue whatsoever about how Google works.

Standard disclaimer: I'm a Google engineer and these opinions are my own and
don't reflect those of my employer.

Google is a really large company with >10,000 engineers. A lot of what we do
starts as grassroots efforts. Honestly, getting 10,000 engineers to act in a
coordinated fashion is probably like trying to herd 10,000 cats.

AngularJS started as a side project that became Google-sponsored and it grew
organically. Being Google-sponsored simply means some team somewhere has
dedicated some engineers to working on it. That's it.

Likewise a group of engineers separately started Dart due to dissatisfaction
with JavaScript being the lingua franca of the Web. The idea was that Dart can
be implemented as a VM within a browser and get faster performance that way.
Likewise, it should compile to JavaScript for browsers that don't support Dart
in the browser (which is all of them except Chrome). Also, Dart shares a lot
of the philosophies of GWT in sharing code between client and server.

Now my personal view is that I honestly don't see the point of Dart. I mean no
disrespect to the team or their efforts but I don't agree with the premise or
the design philosophy of Dart.

Optional typing seems to me to combine the worst of both worlds. If typing is
useful (as the static typers will argue) then be statically typed. If it's not
be dynamically typed. Dart's type system is basically just the Closure JsDoc
system used by the Closure compiler. That's it. To me, there's no real
innovation there.

Dart is really just another Coffeescript and I don't see the point of
Coffeescript either.

One of the benefits of development in JavaScript is you can simply refresh
your browser and it just works. I'm a huge fan of this fast iteration cycle in
development. It's the same reason I'm a fan of Python, Ruby and even PHP.

Additionally, as soon as you add a translation step from something to
JavaScript, you introduce potential bugs in that translation (eg I've seen
bugs with the Closure compiler incorrectly removed code it thought was dead
and that was JS to JS let alone the issues with, say, GWT's Java to JS). Even
if there aren't bugs, tracing issues back to the source becomes more
difficult.

Rob Pike through Go seems to believe this too (not that I claim to speak for
him) because he's repeatedly mentioned that the simple syntax of Go and fast
compilation is a deliberate feature, a philosophy I agree with 100%. It's also
one reason I detest C++: slow compilation kills productivity (IMHO).

So AngularDart is nothing more than another group of engineers (perhaps
there's a crossover with the Dart folks) wants a modern Web framework for
client-side Dart so they created one.

The idea that this is part of some grand strategy is quite frankly ludicrous.

Google puts their effort behind a lot of experimental projects. Some work out,
many don't. Will Dart succeed? I don't presume to know. But while I don't
agree with the premise/philosophy it makes me happy that the company I work
for is still prepared to experiment with such efforts and devote resources to
them.

If you work at Google you'll often see three teams working on roughly the same
thing, typically without knowing about the existence of the others. They may
consolidate or compete (if they have incompatible philosophies that the teams
feel strongly about) or something in between.

This happens because so many efforts just start out as a single engineer or a
small group of engineers just trying something out or they want to solve a
problem they see (and in an organization this large it's rare you're the only
one who sees a particular problem and wants to do something about it).

So, please, can we discuss this on its merits rather than the new norm of
seeing vast conspiracies or simply seeing things as some collusion with the
NSA. It's really tiresome.

EDIT: added a paragraph about the issues of bugs and translating something to
javaScript.

~~~
Helianthus
There might not be a formalized 'grand plan,' but Dart doesn't have the open,
cheerful intentions of CoffeeScript.

It's being designed as a javascript replacement. Google's overbearing
intention is obvious.

You're right: Dart is, functionally, another CoffeeScript, but that's
_despite_ Google's plan--ok, 'experiment'\--not by design.

>So, please, can we discuss this on its merits

Your criticisms are shared. That's what causes the friction: resentment that a
pretty flawed language is being pushed. Dart _does_ take time away from other
more worthwhile projects.

None of the cynicism is over wishing that Google would stop experimenting with
technology, it's over Google's waste of time.

Edit: Actually, apparently there _might_ be a formalized 'grand plan,' reading
nateabele.

~~~
spankalee
What are "open, cheerful intentions"?

Open? Dart has been open-sourced for 2 years now - only having its proof-of-
concept done in-house before the announcement.

Cheerful? Not sure how one language that compiles to JS is more "cheerful"
than an other, but we're really a cheerful bunch in person. I'm sure you could
have a beer with us if you'd like :)

As to the your and the OP's point about Dart being another CoffeeScript, this
is really far from reality. CoffeeScript is just syntax changes, and that's
not sufficient for fixing JavaScript major problems - which come form its
semantics, not it's syntax.

Dart and CoffeeScript are actually quite far apart on the spectrum of compile-
to-JS languages: Dart tries to keep a similar syntax and fix the semantics,
CoffeeScript tries to keep the semantics and "fix" the syntax (I personally
find CoffeeScript very hard to read). Claiming that Dart is another
CoffeeScript, to me, shows a real lack of knowledge about one or both of the
languages.

~~~
xixixao
There is one major difference between Dart and CoffeeScript: The Angular team
didn't have to take a 3 month holiday to make Angular work with CoffeeScript.
If Dart was just another compile-to-JS language, then they wouldn't have to
bother at all.

Yet, CoffeeScript is not just a different syntax - for one, it changes
declarations and scoping rules. That's a pretty big semantic change
(comparison operators etc. follow).

~~~
btford
Please show me this 3 month break AngularJS took in the Github activity log:
[https://github.com/angular/angular.js/pulse](https://github.com/angular/angular.js/pulse)

------
bovermyer
I like Dart. It's fun to write. I don't understand all the vitriol directed
towards it.

~~~
edtechdev
I don't either, although while I think dart is an improvement over javascript,
it also is basically just like java. I'd prefer a runtime that multiple
languages could easily compile to, but until then there are several languages
that can compile to javascript, treating it like a runtime (including dart
itself): [https://github.com/jashkenas/coffee-script/wiki/List-of-
lang...](https://github.com/jashkenas/coffee-script/wiki/List-of-languages-
that-compile-to-JS)

------
eknkc
Oh got no please no... I use Angular freakin "JS" extensively.

At some point, I believe I will come to a position not to touch anything that
has even a remote connection to Google. Just a couple of years ago I
worshipped Google, now I feel they are always taking my toys away.

~~~
spuz
For those of us who don't have the benefit of your experience, could you
explain why you think Google is doing something wrong here?

------
camus2
Good for Dart users. And competition is healthy.

Javascript needs some challenge, just like Flash forced HTML to evolve.

So this is a good thing. Congratulations. And devs should know this, nothing
is set in stone on the web.

------
guiomie
As if the javascript version was so good that it doesn't require anymore work.

~~~
btford
False dichotomy. Work on the the JavaScript version has actually increased.
Google grew the team, not split it.
[https://github.com/angular/angular.js/pulse](https://github.com/angular/angular.js/pulse)

------
wnevets
How is this anything but a good thing for AngularJS?

------
TheMagicHorsey
Don't know much about Dart. Is there a way for Dart code to call/use
Javascript libraries? Like could I use D3 in Dart?

~~~
spankalee
Yep, we use d3.js on Dart projects internally.

Check out the dart:js library, which is pretty new, and the article that _ak
linked (which needs some updating).

[http://api.dartlang.org/docs/releases/latest/dart_js.html](http://api.dartlang.org/docs/releases/latest/dart_js.html)

------
keda
When is AngularJs 1.2 stable release coming out anyway?

------
nicklovescode
If someone creates egghead.io for Dart, I will pay for it.

------
andyl
I'm using AngularJS. But this Dart news is a dark cloud. I will never use
Dart, or anything that locks me into Google's walled garden. I view Dart as a
major negative.

Hello Ember.

~~~
spuz
"I will never use Dart"

That's quite a sure statement. Why don't you think Dart will ever be natively
adopted by Firefox at some point in the future?

~~~
wamatt
BrendenEich said this of Dart, 2 years ago on HN, and might help explain OP's
sentiment:

 _For the record, I 'm not worried about JS being replaced by a better
language. I am working to do that within Ecma TC39, by evolving JS
aggressively.

The leaked Google doc's assertion that this is impossible and that a "clean
break" is required to make significant improvements is nonsense, a thin
rationale for going it alone rather than cooperating fully.

The big issue I have with Dart, which you seem to consider inconsequential, is
whether Google forks the web developer community, not just its own paid
developers, with Dart, and thereby fragments web content.

A Dart to JS compiler will never be "decent" compared to having the Dart VM in
the browser. Yet I guarantee you that Apple and Microsoft (and Opera and
Mozilla, but the first two are enough) will never embed the Dart VM.

So "Works best in Chrome" and even "Works only in Chrome" are new norms
promulgated intentionally by Google. We see more of this fragmentation every
day. As a user of Chrome and Firefox (and Safari), I find it painful to
experience, never mind the political bad taste.

Ok, counter-arguments. What's wrong with playing hardball to advance the web,
you say? As my blog tries to explain, the standards process requires good
social relations and philosophical balance among the participating
competitors.

Google's approach with Dart is thus pretty much all wrong and doomed to leave
Dart in excellent yet non-standardized and non-interoperable implementation
status. Dart is GBScript to NaCl/Pepper's ActiveG.

Could Google, unlike Microsoft ten or so years ago, prevail? Only by becoming
the new monopoly power on the web. We know how that story ends._

[https://news.ycombinator.com/item?id=2982949](https://news.ycombinator.com/item?id=2982949)

EDIT: updated to the long form quote, for additional context.

~~~
jgon
And here we are 2 years later, TC39 is still nowhere in sight, Javascript is
still, in the eyes of anyone with an ounce of taste, a terrible language for
large scale development and Dart continues to iterate while offering all of
it's advancements as it compiles to JS.

I honestly don't even care if Dart doesn't take off, maybe clojurescript or
something similar will instead. But my god something needs to happen in this
space because the JS standards body has spent almost 2 decades aggresively
doing nothing about the many gaping, egregious flaws in Javascript. Its 2013
and we don't have lexical scoping as standard, but hey let's dick around in
committee for another year packing in generators, etc, etc, etc.

I would honestly put a lot more weight in Brenden Eich's words if the state of
Javascript and web dev wasn't so absolutely dismal and if he wasn't trying to
crap on a project actually working to do something about it.

~~~
steveklabnik
> TC39 is nowhere in sight

Uhhhh TC39 meets bi-monthly. If you meant ECMASCRIPT 6, it's targeting
finalization next month. Furthermore, future releases are set to be much, much
faster than previous ones.

~~~
jgon
Yes I meant the standard produced by TC39, of which Ecmascript 6 is the new
version. My apologies for loose use of terminology.

I would be somewhat happy if ES6 was finalized next month, but if it slipped
(again) I would not be surprised. You'll also have to forgive me if I am
skeptical of claims about the increased speed of future standards. The burden
is on TC39 to prove this to me and I reserve the right be skeptical based on
prior evidence until I see otherwise.

~~~
domenicd
ES6 features are already shipping in many browsers.
[http://kangax.github.io/es5-compat-
table/es6/](http://kangax.github.io/es5-compat-table/es6/)

------
azio_m
"Any intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite
direction." ~ Albert Einstein

