Skip to main content


Showing posts from December, 2012

New site for Dart news and articles

For the latest Dart news, visit our new blog at .

Dec 17 Language Design Meeting Notes: Configuration-Specific Code, Optional Named Params

Dart engineer  Bob Nystrom  has  posted the notes  from the December 17th language design meeting. He writes: Here's my notes from this week's meeting. It was a short one since we were mostly focused on M2: Configuration-specific code There's been some discussion among the language designers about this, but I haven't seen the details. Gilad says that libraries are parametric definitions. An import can define paramaters. The restriction is that these parameters have to be constants. Optional named params Lars says people are starting to nag him about a problem: sometimes with optional named parameters, you want to forward exactly what was passed. The language doesn't currently give you a way to do that without a combinatorial explosion. He asked Gilad if he can cook up some syntax where you can optionally pass a parameter. Cheers! As always, we invite you to join our  Dart mailing list , ask questions on  Stack Overflow , or

Breaking Changes in dart:html: Window, LocalWindow & WindowBase, LocalHistory, LocalLocation

There are a number of name changes coming down the road in dart:html. Pete Blois  gives us the details :  FYI- We'll be renaming Window to WindowBase and LocalWindow to Window. Ditto for LocalHistory and LocalLocation. If you're curious, but not familiar it, there is both the global 'window' object, and IFrameElement.contentWindow. The contentWindow only exposes a subset of APIs while dart:html's 'window' exposes the full API. We used LocalWindow and Window to expose these two API sets, but LocalWindow was too undiscoverable. Hence, this change. As always, we invite you to join our  Dart mailing list , ask questions on  Stack Overflow , or file feature requests on .

A Game of Darts, Target 7: Defining a Custom DOM Tag Using Dart's Web UI Package and Web Components

The  Game of Dart tutorials  provide a gentle introduction to building web applications using the Dart language, tools, and APIs.   In the latest tutorial , l earn how to make custom DOM elements using the <element> tag, use data binding to connect Dart variables to content, and attach event handlers in HTML using the Web UI package.  As always, we invite you to join our  Dart mailing list , ask questions on  Stack Overflow , or file feature requests on .

New Article by Gilad Bracha: Mixins in Dart

Mixins are a much talked about and anticipated feature of Dart and in a new article  Google engineer Gilad Bracha gives us details of plans to incorporate mixins into Dart in M3. Read about basic concepts behind mixins, the syntax and the semantics of mixins in Dart, issues surrounding privacy and statics, the extensibility of current proposals and what changes all of this brings to the language spec  : As always, we invite you to join our  Dart mailing list , ask questions on  Stack Overflow , or file feature requests on .

New Dart Editor Update for M2

Dart Editor keeps getting improved. A new M2 build is out and  Eric Clayberg  fills us in on the details : A new Dart Editor build is available at . Changes include: General context menu cleanup UI tweaks to the Class Hierarchy view Improved logging for failed update checks More analysis errors and warnings Various analysis, editor and refactoring fixes Breaking Change List: dart:html changes New HTML form field objects and constructors. e.g. RadioButtonInputElement. See more at issues/detail?id=1684 And as always, view the  changelog  for the full list of changes, and to get started with the Editor see our  tutorial .   We invite you to join our  Dart mailing list , ask questions on  Stack Overflow , or file feature requests on .

Publish Your Own Packages to Pub

Pub , a package manager for Dart, is now accepting uploads of new and updated packages. Developers can self-publish their Dart libraries to for other developers to use and enjoy. Bob Nystrom sends the good news: As Anders' announcement email said, with M2 out the door, you can now publish packages yourself to  You'll need a Google account that you can use to authenticate. In theory, it's as simple as going into your package directory and running:  $ pub publish   It will walk you through the one-time authentication process, validate your package, and then you're good to go!  We've tested this as thoroughly as we could, but our experience has been that users in the wild have a much greater variety of machine, operating system, software, and account configurations than we can hope to test for.  Please be patient if you run into issues. File bugs and we'll do our best to sort them out as quickly as we can. 

New Article Detailing Dart Milestone 2 Changes

The Dart team announced its Milestone 2 (M2) release today. Seth Ladd   has a new article   detailing the many changes and improvements that M2 brings. Find out about smaller dart2js output, improved libraries, SSL in the Dart VM, the Web UI library, direct publishing to pub, new http, oauth2 and serialization packages, and more: As always, we invite you to join our  Dart mailing list , ask questions on  Stack Overflow , or file feature requests on .

Dart Milestone 2 Brings Smaller JavaScript Output and Package Uploads to Pub

Anders Sandholm gives us some of the details  of the Milestone 2 (M2) release : We’re happy to announce the next milestone of the Dart project - M2. The bits for the editor and SDK are available at . A few features you may like in this release: Significantly smaller generated JavaScript from dart2js due to tree-shaking of the html libraries and general minification.  Tree-shaking is on by default. Minification requires the command line flag --minify .  As a result, the generated code for swarm is now only half the size compared to M1. Support for uploading of user packages to pub . The M3 release will focus on core library cleanup and the new streaming API for asynchronous communication. We’re looking forward to your feedback and thanks for your support. As always, we invite you to join our  Dart mailing list , ask questions on  Stack Overflow , or file feature requests on .

Dec 10 Language Design Meeting Notes

Dart engineer  Bob Nystrom  has  posted the notes  from the December 10th language design meeting. He writes: Mixins We're down to arguing about syntax. Lars says, OK, here it is:     class C extends S with M1, M2 { ... } Mixins are linearized from right to left. This makes sense since the class body appears last but takes precedence, so we work backwards from that. Gilad has an updated proposal that he'll send out. There is one corner case. If you want to mixin, you have to have an explicit superclass:     class C  extends Object  with M1 { ... } [Bob: This means that I believe we have the semantics  and  syntax for mixins nailed down now. Woo!] throw as expression They're looking to implement this in dart2js now. Even with the restriction on rethrows, it still feels tricky. Since  throw  takes an arbitrary expression on the right, including a conditional one, there are some corner cases related to how it binds. Lars: Is rethrow an

New Dart Web UI Codelab

If you've been waiting for the right time to learn how to use Web Components in Dart, now's your chance! Continuing where we left off with the Google IO 2012 Dart Codelab , I've created a Dart Web UI Codelab which focuses on Web Components and the new Web UI library. In this codelab, I cover: How to set up pub How to use Web Components How to use dynamic templates and two-way data binding (inspired by Model-driven Views) How to build an application with multiple Web Components Where to get more information about Web Components and the Dart Web UI package What to do if you get stuck while trying to build an app using the Dart Web UI package We've already created videos , blog posts , and articles about how to use Web Components in Dart, but this codelab is pretty exciting in that it walks you through building a complete, albeit small, application using Web Components and the Dart Web UI library. So give it a try and tell us what you think! We invite

Dart Editors adds GUI for pubspec files

Eric Clayberg  fills us in on the details on the details on the new Dart Editor build : A new Dart Editor build is available at . Changes include: New forms based pubspec.yaml file editor! To see it, right click on a pubspec file and choose "Open with Pubspec Editor". New Class Hierarchy view. New Clean-up to add and remove local variables type annotations. Launches in non-Dartium browsers are now faster (we only invoke dart2js if the source has changed). If a build.dart script indicates to the Editor that it has remapped a file (foo.html ==> out/foo.html), and the user launches that file, we'll launch the generated file instead. For things like web_ui applications, this means fewer clicks for users and a simpler workflow. Added a preference to control automatically running Pub. Breaking Change List: dart:html changes All dart:html class names have been updated to follow the Dart naming guidelines. For example CSSStyl

An Approach to Illiterate Programming: doc-code-merge

It's very common to embed code examples in technical documentation. However, doing so is kind of painful. First of all, the environment you use to edit the documentation may not be the same as the environment you use to write code. For instance, I generally use Dart Editor to write Dart code, but I use Sublime Text 2 to edit documentation written in HTML or Markdown. Secondly, it's difficult to run unit tests or use dart_analyzer if the code is trapped in documentation. This is a big problem for us on the Dart project because we move pretty quickly, and we want to make sure our documentation is always 100% correct. I've created a tool called doc-code-merge to solve this problem. doc-code-merge is the opposite of what Donald Knuth labelled Literate Programming . doc-code-merge lets you write your documentation and your code examples completely separately. When you run doc_code_merge.dart, it makes a copy of your documentation with all the examples merged in. The Pragmati

Dart VM improves performance by 50%

The Dart VM is now 50% faster than Chrome’s JavaScript engine, V8, on the two Octane benchmarks, Richards and DeltaBlue . This info is available and being tracked on , whic h we’ve launched today. It is the new place for up-to-date information on Dart performance. We’re tracking and comparing performance of V8, the Dart VM, and the Dart to JavaScript compiler for every new revision, so you can now follow performance improvements as they are landing and help us keep an eye out for regressions. The benchmarks are run on a Linux ia32 architecture and follow the standard Dart benchmark harness . Over time, we'll add to the set of benchmarks being tracked. Of course, benchmarking is a subtle science, which is why we've published a short guide on benchmarking Dart. It's still early for Dart VM, but we're encouraged by the initial performance boost for web developers. If you are too, download the Dart SDK and get started today. We enco

BREAKING CHANGE: Renaming web_components Package to web_ui

The web_components package has a new name. John Messerly gives us the details :  We're renaming the web_components package to web_ui. Aside from saving everyone's wrists a bunch of keystrokes :), this new name was chosen to reflect the growing mission for the project. When we first started, we envisioned the project as a polyfill for the new HTML5 web components standard. But since then the effort has expanded to encompass a bunch of model-driven views (MDV) and template features, data watching, CSS polyfill work (just starting), and more. Web components is one of the shiniest new features, but there are other shiny features already there and more coming. We also have a new mailing list for the project! Please do sign up if you're interested in discussing how to build web apps on top of the exciting new standards. Send your web-ui thoughts to: Google groups URL: fromgroups#!forum/web-ui

Dec 3 language design meeting notes (Mixins)

Dart engineer  Bob Nystrom  has  posted the notes  from the December 3rd language design meeting. He writes: If you're as excited about mixins as I am, you'll be happy. This week's language meeting was all about them. I tried to keep up as best as I could this week, but I'm not much of a secretary. Any omissions or mistakes are all my fault. Lots of people were in this meeting. Except Lars, who is apparently in Austria with Katy Perry. I'm guessing that's a joke, but you can never tell... Kasper likes the proposal but discussed some syntax changes with Peter. They are discussing VM implementation since Ivan [VM lead] is in Aarhus [Kasper and Lars' office]. Does the mixin have to go in the superclass chain? Gilad: There is well-defined semantic model and it has been implemented before. Kasper: Where is it being in superclass chain visible? Reflection? Gilad: In is checks too. You could also see it in super calls, but the curre