11 comments

[ 2.7 ms ] story [ 35.0 ms ] thread
I don't get this, why would you use something like Dart which is incredibly immature across the full stack?

I would have thought it would be more feasible to create something with already proven technology...is there something in Dart that I am missing which makes it considerably better than languages such as JavaScript etc.?

Dart is at least mature enough to deliver a full, commercial application like ours, and I hope this product can be first shot to put Dart in your proven technology category. IMHO there will be more apps like this.
This is an interesting question. Almost any language is better than JavaScript. JavaScript is fine for small event handlers in a guestbook sized app but for more complex applications it's just a PITA (I didn't say it isn't possible to build more complex apps though).

'Incredible immature' is plain wrong. Dart is quite mature.

The biggest disadvantage is the availability of libraries (packages) but otherwise it is very comfortable to work with. There are already packages for most requirements but the available selection is still small and they often don't have all the features you are looking for.

To your question: A few points are listed here http://stackoverflow.com/questions/7712107 or https://www.dartlang.org/support/faq.html

I'm working on my first Dart web project since february. I'd say that the thing that really makes a difference in Dart compared to javascript is the Dart Analyzer. Thanks to the Analyzer the code is type checked and syntax corrected while you are writing and this prevents 90% of bugs otherwise very common and time consuming in javascript. And this while keeping all the flexibility of a dynamically typed language like javascript. Also a great boost in productivity comes from the fact that the Dart framework already incorporates all features that in javascript require dozens of external libraries like jquery, node.js or modernizr, etc. Porting legacy javascript code in Dart is also very easy, the syntax is almost identical. I think if you do not have to use advanced libraries like Polymer.Dart or Angular.Dart (they are much better than the javascript counterparts, but currently are still very buggy and not production ready), then you can use Dart today and get a boost in productivity. When the DartVM will be incorporated in Chrome (currently its only available in the Chromium/Dartium version of the browser) that should also give up to 4x performance improvement over javascript. That is expected for the next year, when the new "Oilpan" garbage collector will be finally integrated into Chrome.
I work on Dart at Google. We have used Dart internally for critical applications for over a year now. It's pretty mature at this point, even if there are some specific areas that are still evolving (async/await, reflection, js interop to name a few).

Dart is significantly better than JavaScript (IMO, of course), that's what it was designed for. Mostly it comes down to sane semantics and static analyzability.

> I would have thought it would be more feasible to create something with already proven technology

If everyone felt that way, nothing would ever get proven and we'd still all be using, I don't know, COBOL or something. :)

Different teams have different perspectives on risk. Some want to ensure they can ship something stable with no surprises. Others think there's a chance that a newer piece of technology will be better enough to be a competitive advantage and are willing to take that chance.

The first soldier to run onto a battlefield with a musket was using unproven technology too, but it worked out pretty well when the enemy just had swords.

> is there something in Dart that I am missing which makes it considerably better than languages such as JavaScript etc.?

I've worked on large JavaScript codebases, and I found them really hard to maintain and understand. I'm on the Dart team, so I'm obviously biased, but here's what I like:

1. The language is statically shaped, meaning classes and methods have a declarative, not imperative syntax. It means that tools can understand the classes and operations in your program just by parsing it. That makes nice code navigation (go to definition, find callsites, etc.) easy where I've never found it to work well in JS.

Note that this isn't about static types and type annotations and stuff like that. It's just about being declarative versus imperative. I also find declarative code much easier to read than JS's soup of SomeType.prototype.someMethod = function() { ... }

2. It has a really nice standard library. Solid collections with lists, maps, sets. Lots of higher-order functions for transforming them. Futures and asynchronous streams are built right into the core library (and used by the DOM!). A much cleaned up DOM library. For basic mucking around with data, I don't need to lean on third-party libraries in Dart like I do in JS.

3. Static typing help find a lot of my bugs early. I don't annotate local variables, but even annotating at method boundaries is enough to find all of my dumb typos. It also gives me auto-complete for methods, which is a huge time-saver when working with unfamiliar code.

4. Lots and lots of little nice language features: getters and setters, final, lazy-initialized top level variables, string interpolation, => lambdas, correct binding for this, solid block lexical scope, etc.

For those who said "why would you use something like Dart which is incredibly immature across the full stack?"

I would ask one simple question back -- Have you try Dart yet? I bet you don't. Like most people, I used to argue if Dart is too young to be production, but after I spent couple hours during weekend, all doubts is gone. And what is even magical is that I don't need to Learn it, very soon I found myself already making things I want with Dart, in a very productive way.

Any way to see the source?
Thanks for sharing. Could you share us more about the performance? Did you compare with Java or other solutions?
Does Dart have libraries for interfacing with DB systems on the server side yet?
Yep!

There are a bunch of packages on pub: sqljockey (MySQL), postgresql, oracledart, odbc, mongo_dart, wilt (CouchDB), google_cloud_datastore, couchclient (CouchBase), and more.