Hacker News new | ask | show | jobs
by adrianlmm 4371 days ago
I use Dart in production, it has its advatages like:

1.- It is better than JavaScript, is like using C# with a litle mix of Java.

2.- It comes with its own libraries, no more underscore.js or other patch libraries that JS needs, it is already in the toolkit.

3.- It comes with the Dart Editor, where you can debug your code easily, for scalable projects I find this to be invaluable.

4.- It will run in all your browsers, because it will export your code to JavaScript, but not only export it, it will optimize it and will run really fast.

5.- The pub library, go to pub.dartlang.org and you will find lots of packages that you can install and use, like a bootjack, a bootstrap port in Dart.

There are prolly many more, but these are the ones that come to my head right now.

But it also has its own problems like:

1.- No Dart support for Chrome yet and we don't know if there will ever be at this point.

2.- The generated JavaScript will be huge, and I mean huge, mine is like 460k per file and I'm not using polymer, when I used polymer the generated JavaScript was over one megabyte, just insane in the cloud.

3.- Get use to regressions, with every point update I've have issues, I upgraded from 1.4 to 1.5 two days ago, now my code is broken It runs, but it will for example run futures twice, So I went back to 1.4 for now, I had some other issues with UTF when migrating from 1.3 to 1.4 so, get use to.

4.- They are slow fixing bugs, looks like polymer and speed are their priorities, but when you need something trivial that other languajes have had for years and you report a bug it will get ignored, I've waited for 18 months and my open bugs are not fixed yet.

I would say that Dart is nice and you should give it a chance.

4 comments

> 2.- The generated JavaScript will be huge, and I mean huge, mine is like 460k per file and I'm not using polymer, when I used polymer the generated JavaScript was over one megabyte, just insane in the cloud.

If you include all of your 'standard' libraries in a JS app, it can be pretty big. I basically pull everything together for an Ember app I work on, and all-told it's ~3MB prior to minification. Minification takes it down to ~1.5MB, and Gzip-compression on the server takes it sub-1MB (can't recall the number off-hand). It's not that far off from what you might have in a JS-heavy app.

Tree shaking is what you lack (yes I know Dart has tree shaking but its cross compilation has a big result)! I love the closure compiler in advanced mode for this reason.
Thanks for the helpful feedback! The latest version of Polymer.dart removes the need for reflection at compile time, and our output is much smaller today. Curious when you last tried compiling a Polymer Dart app?

[disclaimer: I work for the Dart team.]

The last time I used polymer was in Dart 1.3 I believe, then I migrated all to "dart:html" and started managing all the DOM events my self, so, I'm afraid I can't give you that information. Btw, thanks for your hard work, I really apreciate it.
Our pleasure. If you're curious, I'd recommend trying Polymer.dart again. The latest version (0.11) has a transformer that replaces the reflection code with static code. The resulting output is much smaller. :)
Given the size of the generated JS file, do you find it is an issue?
When you host your Project in the cloud and you pay for the bandwidth quota then you learn the value of small generated JavaScript, but if it is a Project where bandwidth does not generate a cost like an intranet or VPN, then it doesn't really matter.
Does it have anything like AngularJS?
As mentioned already, there is AngularDart, but we also have a full port of Polymer to Dart, so you can write web components in Dart.

https://www.dartlang.org/polymer-dart/

We also have Dart packages for the Polymer project's core-elements and paper-elements (Material Design, nee Quantum Paper) that were announced at I/O.

http://pub.dartlang.org/packages/paper_elements

Web components and Dart is a really powerful combination for apps.

It has AngularDart, an official port of AngularJS to Dart. Seems promising, will try it if and only if Dart gets native support in Chrome.
Yes, it has AngulartDart.