Google's Dart Reaches 1.0 |
Written by Mike James | |||
Wednesday, 20 November 2013 | |||
Google's other language, Dart, has just been released as version 1.0 and it claims to be stable and ready to do real work. Is anyone interested? Does it have anything to offer? And can you rely on it to be around the next time you look?
Google took the plunge into creating its own languages a few years ago with Go for general and systems programming and Dart, its JavaScript killer. Of course, not everyone thinks that JavaScript needs to be killed, but there are a lot of programmers familiar with a class-based, strongly-typed language such as Java or C# who find it so different they they really don't want to cope. Dart is class-based and optionally-typed and is instantly understandable to any Java, C++, or C# programmer. Dart could be just right for them, but there are lots of complicated and messy issues. Version 1.0 has everything you need to write and run Dart programs. It comes with the Dart editor, a lightweight IDE which supports code completion, refactoring, jump to definition and a debugger. It makes creating Dart fairly easy, but where are you going to run it? You are offered two choices, but in most cases only one of them is going to be practical. There is a modified version of Chromium, Dartium, that runs Dart directly using a VM. You can also use the VM to run Dart on the server, making it an alternative to Node.js. The VM approach may be the ideal, but most users are going to have browsers that run JavaScript, not Dart. The solution.is to use the dart2js compiler. This outputs optimized JavaScript that, it is claimed, runs faster than idiomatic JavaScript. How can JavaScript run faster than JavaScript? The idea is that dart2js generates better code than you can because it doesn't have to care about writing code that can be understood. The latest version of the compiler also claims to produce smaller JavaScript programs. It also makes use of "tree shaking", which put simply removes any code included in your program that isn't being used. For example, if you include a library but only use one function it contains then tree shaking removes all the other functions. There are now more than 500 Dart packages that can be used via the Pub packet manager including AngularDart and Polymer.dart. If your favorite package isn't available in Dart, then there is an interop facility.
The Dart team claims that it is now production ready and is moving into a phase where: "...the Dart team will focus on improving Dartium, increasing Dart performance, and ensuring the platform remains rock solid. In particular, changes to core technologies will be backward-compatible for the foreseeable future. " This is all great and if you are looking for a class based language to use to create web apps Dart is a possible choice but... Adopting a language is a big commitment. You spend a lot of time building apps and you need to trust that the language will be there in the future. It is clear that JavaScript is going to be around for a while, but what about Dart? The big problem is that Google doesn't have a good track record of sticking with its innovations. For example, the GWT, a way of compiling Java to JavaScript, was flavor of the month until Dart came along and Google moved programmers from this open source project to Dart. The GWT project continues as open source, but without the driving force of Google 100% behind it. It is also clear that Dart isn't going to get the support of Mozilla and Microsoft and this means that Chrome is the only browser likely to support a direct implementation. Some are suspicious that Google might use Dart as a way to make Chrome unique in the browser market - a return to the "works best in x" days. However, Google is also pushing very hard for reform of JavaScript from the inside by contributing to the development of ECMAScript 6. Dart is a nice language and well implemented, but in choosing a language there are many other considerations. More InformationDart 1.0: A stable SDK for structured web apps Related Articlesjs2js The Revolution In JavaScript Google Helps Devs Convert JavaScript To Dart Dart Does Physics - Just To Prove It Can!
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
Comments
or email your comment to: comments@i-programmer.info
|
|||
Last Updated ( Sunday, 19 January 2014 ) |