BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Blossom Switches to Dart

by Zef Hemel on Apr 08, 2013 |

In a blog post, Thomas Schranz has announced that his company will be porting their Blossom product, a web-based Kanban board for product teams, to Dart, Google's new web programming language and platform that can be used as a replacement of JavaScript.

The company's move follows after a long period of frustration with the fragmentation of the JavaScript ecosystem. Schranz writes:

At Blossom we are huge fans of JavaScript and in many ways it is a wonderful language if you know how to avoid its dark corners. That said, I feel the JavaScript ecosystem is severely lacking in many areas. Especially when it comes to core plumbing.

I find it pretty frustrating that you have to jump through so many hoops in order to arrive at a situation where you can start to get things done. I don’t know how this must feel for newbies to the ecosystem, but I guess the learning curve is rather steep and the question marks are plenty.

As a result, the company decided to gradually migrate over the front-end of the application to Dart. Previously, the front-end was built using a combination of CoffeeScript, Backbone.js, Underscore.js and jQuery, assembled using Brunch.

InfoQ spoke to Schranz to learn more about the switch.

Dart is still a young language, why did you make the decision to make this move now?

Dart is still young if you compare it to other languages, but the tooling, standard library and the package management system it provides already make it way easier to work with compared to JavaScript's ecosystem.

There is a lot of fragmentation in the JavaScript world. Especially when it comes to building blocks. We've got a ton of competing ways to manage packages, handle modularity, work with async code, dependencies or even iterate over collections. This leads to libraries that don't mix and match very well. Some force you into a specific ecosystem others try to stay agnostic and reinvent the wheel. I feel that the JavaScript community suffers from NIH syndrome way more than other programming language communities like Ruby, Python or Dart.

This not only creates unnecessary complexity and confusion for beginners, but also for people who have been writing JavaScript for years. Switching to Dart might look like a risky move on the surface, but from my point of view it would be riskier for us to stick around in JavaScript land.

What makes Dart a good fit for Blossom?

We were looking for a way to become more productive in working with our front-end code base. Dart provides a great foundation in that regard. Thanks to the Dart VM we get very quick save-reload development cycles and a powerful code analyzer. This makes the Dart editor a pleasure to work with. It supports auto-completion, refactoring and debugging on a level that's just not available for JavaScript. Also, the package manager, optional typing and consistency in the standard library make it way easier for us to reason about our code base. I think it is important to understand that Dart is not only a programming language, it comes with batteries included. Having a cohesive development experience feels amazing.

Dart is still in an alpha stage of development. As a result APIs are still changing, has this been an issue for you?

The language semantics and syntax feel pretty stable to me already. That said, there are a lot of improvements happening on the API level as the Dart team is working towards the 1.0 milestone. Fortunately Dart comes with great tooling support as I've already mentioned. The editor shows methods that are marked as deprecated and even comes with a clean up tool for automatically updating your code base, if possible. But even updating things by hand is not too much of a hassle if you follow the blog and the mailing list.

You are in the process of switching over, migrating the application piece by piece. What has your experience been with Dart code interacting with JavaScript and vice versa?

There is a js-interop package that you can use to create JavaScript objects, call functions or even expose Dart functions you want to call from JavaScript. This already gets you pretty far in terms of interoperability. For Blossom itself we actually don't need the interop library much, because the components of our existing Backbone.js code base are fairly independent and are easy to migrate widget by widget. We also use Justin Fagnani's routing package, which lets us take over parts of the application with Dart. So far migrating is easier than we've expected.

What has your experience been developing on the Dart platform thus far, compared to JavaScript?

It is a joy to work with. It feels incredible to have a consistent development experience where you can actually focus on improving your product instead of bike-shedding about fundamental building blocks of your ecosystem. Previously, our JavaScript code was littered with checks for undefined, because JavaScript has the tendency keep on trucking when saner languages would throw an exception. The last time I felt that liberated was years ago when I was switching from PHP to Ruby and the Rails framework. Back then this was also considered risky and insane.

How much code have you ported to Dart until now, more or less?

We are at about 5% right now. We're writing new functionality in Dart and are porting existing parts every week.

Are you aware of any other production applications that are making the switch?

I am not aware of other applications in production that have switched from JavaScript to Dart, but I wouldn't be surprised to see more announcements in that direction in the future. The Dart community is growing and a lot of people can't wait for the 1.0 milestone. In addition, some service providers are starting to support Dart. For example there is drone.io, a continuous integration service is used for testing by many Dart open source packages.

Do you recommend other companies to switch over to Dart today?

It might be a bit early to switch, but I would definitely recommend to look into Dart and to play around with the language, the tooling and especially Web UI. Just give it a try next weekend.

How do you see the future of Dart, will it see widespread adoption?

I see a bright future for Dart. It brings the joy back to web development. The people behind the platform are top notch, as are the the early community and the packages that are available. It's an exciting time to build applications for the web.

When Dart was first announced a year and a half ago, there was significant critisism of the language and approach. Since then, the Dart platform has been iterating steadily, third-party IDEs including JetBrains' WebStorm and IntelliJ added support for Dart, and it is now possible to deploy server-side Dart applications to Heroku.

Blossom is the first publically available production application that is making the switch. Time will tell whether this is the proverbial one sheep's leap that makes the rest follow.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Dart ... mobile? by Mark N

What would push me over the edge with Dart would be to use it for Mobile UI. Maybe the Web UI just works on mobile.

Re: Dart ... mobile? by Mark N

Re: Dart ... mobile? by Thomas Schranz

As Mark already mentioned you might want to look into www.rikulo.org/ which is a Dart framework for building mobile applications.

Re: Dart ... mobile? by Faisal Waris

A mobile web application will typically also require server side processing (database access etc.) and browser-to-server communication (in addition to HTML5 integration and client side processing).

If all can be done in a decent (i.e. non-JS) language then web development is slowly coming out of the dark ages.

Re: Dart ... mobile? by Mark N

LOL. I should have added to my reply to myself... "Never mind, I found it..".

That being said why is it so difficult to google "dart mobile" and find that? Part of the problem is the term Dart is just too general.

Re: Dart ... mobile? by Mark N

A mobile web application will typically also require server side processing (database access etc.) and browser-to-server communication ...
Yup. Got that. In fact, since i use DDD, it is pretty much ready. I just need a mobile language/framework that doesn't make me want to smash small animals.

Re: Dart ... mobile? by Thomas Schranz

Heh, didn't realize you replied to yourself. I'm not used to the InfoQ comment area UI :)
Sometimes googling for "dartlang" helps. There is also a lot of activity on the Google+ community: plus.google.com/communities/114566943291919232850

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

7 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT