Skip to main content


Showing posts from February, 2013

Dart in the Shell Video Tutorials Now Available

(Guest post by Dartisan Kevin Moore, author of BOT, Pop Pop Win, and Dart Widgets.)

Most of the discussion about Dart revolves around browser-based web app development. Dart is also a great platform for serving web content. As I've built out a number of projects, I've realized Dart is also a great language for scripting the shell.

While Dart is a first-class programming environment for building browser-based applications, the Dart Virtual Machine (VM) was designed from the beginning to run outside of the browser as well. The Dart SDK and accompanying packages includes libraries for accessing, inspecting, and modifying the file system along with features for creating and managing native processes.

It is possible to build an entire project in Dart - from manipulating HTML elements to serving HTTP requests to test automation and build scripts.

After success building a number of shell commands in Dart I wrote a blog post: Dart is great for shell programming, too.

Dart in the Shell vide…

Using Dart with Sublime Text

We know that developers have a wide range of preferences for their development tools, from simple text editors to full IDEs, and one size does not fit all. We think that all developers should have a productive and fun time working with Dart, so today we’re happy to announce an update to our Dart plugin for Sublime Text 2. The updated plugin supports syntax highlighting for modern Dart code, and includes several common Dart snippets to help you code faster. We also built dart2js into Sublime’s build system so it’s just a single keyboard shortcut away. Finally, the plugin automatically runs Pub whenever you create or update your pubspec files, so you can install and update your dependencies without ever leaving Sublime.

Check out this video where we walk through using the updated plugin:

If you’re looking for a more featured editor, you can try out our Dart Editor, the Dart plugin for Eclipse, or the Dart plugin for IntelliJ / Webstorm.

The Dart plugin for Sublime Text 2 is open source on …

New Dart Editor Build with Pub Publish Available

Dart Editor has a new build. Daniel Rubel fills us in on the details:

A new Dart Editor build is available at Changes include: Pub publish commandMore cleanups including: => onClick.listen
  migrate Future.delayed()
  migrate Uri.isAbsolute/hasAuthority() to getter
  migrate TimerMinor fixes to Samples Breaking Change List:
dart:html A number of Indexed DB APIs have been updated to return Futures, more will be updated.Deprecated events syntax has been removed.Element.dataAttributes has been removed, use Element.dataset instead. libraries:
deprecated Collections-methods removed.New StringBuffer API, implementing StringSink interface. For more, see the latest news.
And as always, view the changelog for the full list of changes, and to get started with the Editor see our tutorial.

I/O Library Now Uses Streams

We have done a full re-design of the dart:io API (file, network, directories, etc) to use the classes and concepts in the core library and in dart:async. This means that there is almost no callback registration in dart:io any more. All async operations now use streams and futures.

(These changes are available in bleeding_edge as of today, and should show up in a weekly build soon.)

We think this is a great step forward in aligning all of the “dart:” API's and for you to have fewer concepts to learn when using Dart for different tasks.

However this is a breaking change which requires rewriting code using dart:io. The good news is that most of these changes should be mechanical. The following sections describe these changes in more details and give some examples on how to migrate code to the new API. For more information take a look on the API documentation for dart:io.

Streams in dart:io
The classes InputStream and OutputStream are gone and have been replaced with classes implementing I…

New site for Dart HTML5 Game Developers

Great news game developers! John McCutchan has launched a new blog devoted to game development in Dart. I interviewed John about the site and game development with Dart. Keep reading to learn more about game development in Dart.

Shailen: Are game developers using Dart?
John: Yes, there is Pop Pop Win and a group of ex-flash developers are porting their actionscript games to Dart. An example of their work is Escape.

Shailen: Why do you think Dart is good for game development?
John: There are multiple reasons. First, Dart is a structured programming language with classes, libraries, an optional type system, lexically scoped this, and more. These features are taken for granted by most developers from other platforms, so they are happy to have them when programming for the web. Second, the Dart VM is already faster than V8 in some benchmarks* and work continues to make it faster. Game developers understand how important performance is. Finally, for ActionScript developers, the Dart syntax is …

New Streams API with Dart Milestone 3

We are proud to announce the Milestone 3 release of the Dart SDK, which provides a new, cohesive API for asynchronous programming and a unified model for events. Some of the new or improved classes in this release include Iterable, Stream, and Future.

Dart's M3 release delivers on a common developer request for a more unified approach to events. New and updated in M3, the Iterable class and the Stream class now provide synchronous and asynchronous models, respectively, for a common theme: a sequence of items.

The Iterable class is now much more prominent in Dart and is the ancestor of common collections like List and Set. Many APIs now return Iterable instead of a specific collection. You can map, join, skip, take, and more on an Iterable. Here is an example:

var names = getAccounts().where((a) => a.isPlatinum)

.map((a) => a.fullName)

The Stream class (and its dart:async library) is new, and it provides an asynchronous s…

Dart with Google Web Toolkit

In this episode of Dartisans, I'm going to show you a variety of ways to use Dart with Google Web Toolkit. I know that there are a lot of GWT developers out there who would like to give Dart a shot, but they aren't sure how because they already have a large, successful app that's written in GWT. I'm going to show you ways to integrate Dart into your existing GWT application without having to rewrite it from scratch.

To do this, I've built a sample application that uses both GWT and Dart. I'll show you how to setup a development environment so that you can work with both technologies. Then, I'll show you a variety of ways in which you can get GWT and Dart to interoperate, such as:
Using GWT and Dart to manage different parts of the same pageUsing Dart to retrieve JSON from a Java servletUsing window.postMessage and JSNI to pass messages between GWT and DartUsing JavaScript, JSNI, and Dart's js package for synchronous interoperability between GWT and Dart…

New Article on How to Use Future Based APIs in Dart

Read the latest article at and learn about using Future based APIs

Futures are crucial to how async works in Dart. The article covers Future basics, explains how to handle errors that are emitted asynchronously, and how to deal with multiple Future-returning functions. 

Your feedback really counts. Please join the conversation at the Dart mailing list, and ask questions at Stack Overflow.

Photo credit: