Hacker News new | ask | show | jobs
by ben336 4371 days ago
Is anybody using Dart for significant production code outside of Google? (Not mocking, genuinely curious to hear whats being done with it)
4 comments

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.

> 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.
I think Blossom [1] switched to it. They had some articles on their blog about the switch [2].

[1] https://www.blossom.io/ [2] http://www.ramen.io/post/46936028144/we-are-switching-to-dar...

Thanks for the mention (CEO here).

We're super happy with Dart & really excited about polymer. Love the language & platform in general.

We'll put out some essays, code snippets & lessons learned in the next few days :)

Stay tuned.

Yup. At Sendbloom.co we have used Dart to build a tool that is used by sales people to send out email campaigns. The tool is inspired by quartz composer/Max MSP's interaction paradigms (drag-and-drop visual programming). As someone else mentioned, Dart code can be fairly verbose, but it is very readable and programming with it is a joy when compared to writing vanilla javascript/jquery. I'd be happy to answer if you have any other questions about Dart.
I would love to see a demo of that!

And how are you finding Dart to be verbose? In my experience it can be more concise than JS because of short lambdas, no function keyword, method cascades, real classes, the fluent Iterable and Stream interfaces.

On the other hand, I see some Dart programmers use a lot of classes and type all their variables. I'm curious what ended up being verbose for you.

Surprisingly few Google properties on there, I must say. Yes, many most certainly have large existing code-bases, but that it doesn't include things like the new Google Maps (which, AIUI, has relatively little in common with the old version) seems… interesting.
Google Maps was almost certainly started before Dart was released.