Thursday, May 30, 2013

Dart project co-founders answer your questions

The Dart team received a lot of great feedback from the community in response to our various Dart presentations at Google I/O. We asked Lars Bak and Kasper Lund, Dart project co-founders, to help answer your questions. Here's what they shared. Enjoy!




Q01: Are there any plans for to use Dart as an alternative or replacement to Java for Android app development (native APK apps)? James Wendel, United States

A01: The current focus for Dart is web applications. Your best bet is to talk to the Android team about this.



Q02: In some benchmarks the DartVM is now outperforming the JVM. Do you you think it will be possible for the DartVM to outperform the JVM for most code? Are there specific areas where the JVM's design will allow it to perform better than the DartVM? Greg, Wellingtron

A02: For programs like numeric computations Java will always have a performance advantage over the Dart VM. The reason is that Dart code is dynamically typed whereas Java has built-in basic types like byte, int, and double. However, for object oriented application code we see no reason for not matching or exceeding the speed of JVMs. We will continue to push performance of the Dart VM since performance is a key driver for web application innovation.



Q03: Few years back GWT was heavily promoted by Google. Now Google is promoting Dart for the future web development. How could I convince my company towards those technology for the longer run? and what are benefits would I get if I choose? Thamizharasu, Chennai

A03: Dart is on track to get into Google Chrome, is used by critical internal projects, and has a growing community. Dart has commitment from Chrome, has a large and experienced team working on it, and the team is investigating how to place Dart into a standards organization.



Q04: In which ways the requirement of Javascript as a compilation target for compatibility affected Dart? What would you make different if this requirement wasn't there? mdakin, Zurich

A04: To ensure compatibility with all modern browsers, we only added language featured to Dart that could be translated into efficient JavaScript. One useful feature we abandoned was "non-local returns" that requires unwinding of stack activations. In JavaScript you can implement a non-local return by throwing an exception. However, this turns out to be extremely slow on most JavaScript engines.



Q05: How much faster than Javascript can Dart get? Nik Graf, San Francisco

A05: The Dart team's goal is be at least 2X faster than V8. See dartlang.org/performance for some benchmarks and results.



Q06: Can you share some details on language support for asynchronous programming? It's a huge pain in JavaScript and Dart can make a real difference here. Ladislav Thon

A06: We expect to take another look at what language features might help with async programming, but not until after 1.0 launch.



Q07: Any hints about possible future language features that could be added after 1.0 is released? Greg, Wellingtron

A07: We expect to implement enums. We also expect to explore features for async.



Q08: Today Google introduced new Android Studio. Is there a plan for releasing something similar for Dart? Valeriy, Ukraine

A08: We're happy that JetBrains has a Dart plugin for IntelliJ and WebStorm. The Dart team supports this effort, and collaborates with JetBrains. Also, you can try our Dart Editor.



Q09: Can you outline the distinctions between Dart and GO on the server side? Will Dart in the future compete with GO on the server side? thien bui, Berlin

A09: There are many distinctions between Go and Dart. Go is a structurally typed language, requires a compiler, has goroutines for concurrency, and is designed for lower-level systems programming. Dart is nominally types, does not require a compiler, uses isolates for concurrency, and is designed for modern web apps (that run on client and server). Dart has been designed to compile to JavaScript, Go has been designed to compile to efficient server-side code. Go is more mature, and has more tools than Dart right now.



Q10: Are there plans to extend SIMD support by adding new features like AVX and add GPU programming support to language and VM? mdakin, Zurich

A10: There are plans to take advantage of the new AVX instruction set. One example, would be adding Float32x8 type which fits inside the new 256-bit wide registers. Another example would be to use the new gather and permute instructions. There are no plans to add GPU programming support to Dart at this time.



Q11: EcmaScript 6 is taking shape - offers classes, modules, block scoped vars (let/const), iterators and other good stuff. asm.js offers performance. Why use Dart - especially if the DartVM is not built into Chrome(OS)/Blink and Android. kc, UK

A11: We're excited to see JavaScript continue to evolve. Dart is a more ambitious effort to take a fresh look at web programming, and thus doesn't need to deal with all the backwards-compatibility issues facing ES6. For example, Dart has many new features like string interpolation, mixins, isolates, lexical this, ints and doubles, named constructors, named optional parameters with default values, real libraries, tree shaking, no undefined (only null), simple truthy/falsey values (only true is true), and of course optional type annotations. Dart is a more toolable, statically analyzable language and thus it's easier to be more correct about refactoring, warnings and errors, code navigation, tree shaking, and more. People use Dart because they like the performance and productivity. (Note: asm.js only accelerates a narrow type of programming, which is dealing with numbers. The Dart VM optimizes programs you'd author by hand.)



Q12: What are the advantages/disadvantages of a sourcecode VM, such as Dart, versus a bytecode VM, such as the JVM? Greg, Wellingtron

A12: Productivity comes to mind. With a source code VM, you don't need to first compile code before running the app. Thus, the iteration cycles are much faster. Just edit and reload! This is important for web developers who want to iterate quickly. Note that the Dart VM internally generates machine code from the source code, via its optimizing compiler.

Also, a real disadvantage of a bytecode VM is the VM needs to verify the integrity of the bytecodes before they can be executed. This adds complexity and opens up for security problems.



Q13: For now Google is the only one embracing Dart on Chrome. I don't see Mozilla, Apple and any other browser embracing Dart sonner. Using pure JavaScript to solve this issue won't let Dart survive forever. So how to make sure that Dart would survive? ghabrianis@gmail.com, Tunisia

A13: Dart is designed to be a productive programming language that compiles to JavaScript. Because developers can write apps with Dart and deploy across the modern web today, the future of Dart is determined by developer adoption.



Q14: If I develop a WebGL game, will I ever be able to target iOS and leverage the performance of the Dart VM or native compilation? Filipe Morgado, Portugal

A14: It is currently an outstanding research project to determine how to port Dart apps to iOS and still remain performant. Luckily, Dart is open source so we look forward to the community exploring this area.



Q15: Are there plans to introduce shared state concurrency and parallelism? Filipe Morgado, Portugal

A15: No, we’re not planning on supporting general shared state concurrency. Having said that, we are very interested in improving our support for concurrent and parallel algorithms.



Q16: Will SIMD support make it into V8? b, sf

A16: V8 implements the ECMAscript standard, so the question is really “will SIMD support make it into ECMAscript” and that is best answered by the ECMAscript committee.



Q17: Will there be an option to see the generated code along with actual Dart code in the editor in future? mdakin, Zurich

A17: That is a very good idea and certainly worth filing a feature request issue on http://dartbug.com/ for. In the meantime, you can output the generated code that the VM produces with this command:

dart --disassemble_optimized --code_comments

You can also try http://web.irhydra.googlecode.com/git/hydra.html to view the output from the Dart VM compiler.



Q18: Can you explain Dart to a six-year old? Ruudjah, Netherlands

A18: It is hard to explain any programming language to a six-year old, but maybe you could tell him/her that Dart is a tool that might make the next web version of Angry Birds have more pigs and angrier birds?

Tuesday, May 21, 2013

Strong Dart presence at Google I/O 2013

Google I/O 2013 was a breakout event for Dart. The conference featured three well attended Dart talks, a Dart code lab, and a crowded Dart booth.


Seth Ladd interviews Lars Bak and Kasper Lund about the state of Dart from the floor of Moscone Center. Dart is now running twice as fast as JavaScript on certain benchmarks. The language and the core libraries are stable, and Dart expects to reach 1.0 status in a few months.

Dart sessions at I/O

Google I/O 2013 featured three Dart talks (videos embedded below).

Web Languages and VMs: Fast Code is Always in Fashion

Lars Bak and Kasper Lund dove deep into the internals of V8 and the Dart VM, explaining why the new Dart VM is needed to take the web platform to the next level.




One popular part of their talk was a demo showing Dart's support for SIMD (single instruction, multiple data) processing. SIMD allows for a big performance boost. Without SIMD, their skeletal animation example supported only about 30 monsters (first image, below). With SIMD, that number increased to about 120 (second image).






Dart: HTML of the Future, Today!

Siggi Cherem and Emily Fortuna explained how Dart libraries have simplified the web building experience, and showed how cross-browser polyfills have made web components available for use today.



What's New in Dart: Your First-class Upgrade to Web Development

Justin Fagnani and Seth Ladd provided a whirlwind tour of the Dart platform and updated conference attendees on Dart developments since last I/O.




Dart code lab

The Dart code lab provided a hands-on experience to participants, who built a mobile-friendly web app using Dart and the Web UI framework.

Overflow crowd at the Dart code lab. The number of participants at the code lab increased by over 60% from I/O 2012
You can try the Dart codelab and build a modern app using the Web UI framework.

Dart booth at the Developer Sandbox

The Dart booth at I/O was a busy, bustling place. Conference attendees got to watch cool Dart demos, interact with Dart engineers, and pick up some nice Dart swag!

Shailen Tuli shows the results of benchmarking code in the Dart VM, dart2js, and hand-written JavaScript. The Dart VM won handily, with the JavaScript compiled by dart2js neck and neck with handwritten JavaScript.  


Adobe shows off the Toolkit for Dart

Adobe released the Toolkit for Dart for Adobe Flash Professional at I/O. The toolkit lets designers and animators create assets for HTML5 projects using Dart libraries and supports most of the core animation and illustration capabilities of Flash Professional.

Playing an HTML5 game built with Flash Pro, exported to Dart with the push of a button! 


Dart at the JetBrains booth

JetBrains featured their Dart plugin for the IntelliJ/WebStorm IDE.

An attendee gets a tour of the features available to Dart developers.


I/O news coverage about Dart

Stephen Shankland at CNET prominently covered the talk by Lars Bak and Kasper Lund on VM performance. Here's an excerpt:


John Pavley at the Huffington Post covered Dart in his round up of Google I/O news:

excerpt from huffpo article

To get an even better feel for Dart at Google I/O 2013, look for #io13 #dartlang on Google+

Monday, May 20, 2013

Notes from May 6th Dart Language Design Meeting

The incomporable Bob Nystrom fills us in on the language design discussions taking place amongst Dart engineers. Here are his notes from the May 6th language meeting:

API maturity annotations

Lars says Dan Grove wants a decision on annotations that denote maturity of source code. For most stuff, Lars thinks we should just annotate the whole library. The place where makes sense is dart:html. In that case, we can make an exception.

I asked if this is a language question, or just a question for people at the level of the language team.

Lars says Dan specifically said for the language.

Everyone agreed this is a good idea for the Dart system. [Gilad later clarified that they all also agree it is not a language issue.]

Lars says everything except dart:html we'll put in the libraries.dart config file. We can show that in the Editor.

[Dan later clarified was that his question was the meta-question to decide if this issue is a language issue or not.]

? operator

Gilad: Can we get rid of it?
Lars: Yes.
Gilad: OK, done.

map literals

Lars asks if everyone likes the new proposal [that Gilad sent to the language team]. Everyone does.

[This is now in the latest published spec. Basically, you can have non-string keys in map literals. Woo!]

exports

Lars says Florian has some issues about exports. Asked if Gilad is talking to him about it.

[This is the same issue about exports that came up on the mailing list recently.]

library names

Gilad says Kasper's proposal looks fine. Given other decisions we've made, it makes things more consistent.

Lars is reluctantly accepting it.

This means it will be a static warning to import multiple libraries with the same name. This is a breaking change so we should let people know it's coming.


As always, view the changelog for the full list of changes, and to get started with the Editor see our tutorial.

Wednesday, May 15, 2013

Adobe's Flash Pro CC Exports to Dart and HTML5


At Google I/O today, Adobe announced their new Toolkit for Dart, a plugin for Flash Professional CC that allows developers to export their animations and games to Dart code and HTML5.



"Adobe is delighted to announce the Toolkit for Dart, an extension that enables web designers and animators to publish their Flash content to Dart." said Tom Barclay, Sr. Product Manager at Adobe. With the Toolkit, developers, designers, and animators can create interactive, animated content inside of Flash Pro and publish to the Dart language and HTML5 APIs. Because Dart compiles to JavaScript, the content runs across modern desktop and mobile browsers without plugins.

Toolkit for Dart supports many of the core animation and drawing capabilities of Flash Pro, including bitmaps, shapes, movie clips, graphic symbols, classic tweens and motion guides, simple buttons, text fields, drop-shadow and glow filters, additive blend mode, single-shape masks, visible and cacheAsBitmap display options, and embedded audio. The Toolkit generates Dart code that represents items on the stage, symbols, images, and sounds in the library.

The Toolkit doesn't translate ActionScript to Dart. Instead, developers write Dart code for the interactive parts of the content. Dart is similar to ActionScript 3: it is a familiar, class-based, object-oriented language with rich core libraries, optional static types, and more.

The extension leverages the StageXL for Dart library to reproduce Flash runtime features. The StageXL library is a complete and robust Flash-like engine for Canvas that is built on top of the Dart programming language. StageXL provides an approachable Flash-like API to build games and other graphically rich content. It is intended for Flash/ActionScript developers who want to migrate their projects as well as their skills to HTML5. Bernhard Pichler, author of StageXL, asks you to "use your creativity to enrich the modern Web."

Adobe plans to contribute the Toolkit to the open source community. The Toolkit for Dart is expected to be available as a Github repo shortly after Flash Professional CC is released on June 17.

Monday, May 13, 2013

Try Dart In Your Browser

Try Dart without leaving your browser, thanks to the relaunch of try.dartlang.org. The team compiled dart2js (a Dart to JavaScript compiler) with dart2js to produce a web app that lets you write and test Dart code in your browser.

Try Dart is an easy way to experiment with Dart. The in-browser playground supports HTML, runs offline, and comes pre-loaded with a few examples.

Please enjoy, and let us know if you have any feedback.

New Targeted Mailing Lists for the Dart Project


tl;dr: We have some new discussion groups. Sign up for announce@dartlang.org.
For a quick summary, read the Guidelines section below.


---


Hello Dartisans!


As our community has grown, so has discussion around Dart, so we have created four new discussion groups, and updated a few others.


New Groups:


announce@dartlang.org : Dart Announcements
This group is for official announcement for the Dart project. This will be product releases, breaking changes, major events, press briefs, and other important messages for the entire Dart community. For now, the group will remain limited to a select group of individuals who manage specific parts of the Dart project.
I recommend signing up for this group today, as it is a low volume way to stay up to date with Dart on a day-to-day level.
---


Note: Replies to announcements in this group should go to dart-dev@dartlang.org to keep the announce list noise-free, but still provide a forum for discussion.

For the time being, posts to
announce@dartlang.org will be forwarded to misc@dartlang.org.
In a few weeks we will remove the forward to misc@dartlang.org to prevent unnecessary duplicate e-mails, so sign up now!



eng@dartlang.org : Dart Core Project and Libraries Development
This is the list to go to if you want to discuss the development of the Dart open source project. As the project continues to grow, it’s important to be able to stay connected with state of the core of Dart itself.


This is a good place to talk about core library APIs, discuss breaking changes, and interact with the Dart engineering team. If you’re thinking of contributing to the Dart project, let us know in this group!


This list will be more technical than some of the other lists, so keep that in mind when subscribing. You should subscribe to this list if you’re interested in keeping up with day to day Dart development and engineering.


---


Note: If your discussion is about a project you’ve created, broad feature requests such as other languages’ features you’d like to see in Dart, the state of the web/JavaScript/html5/etc., news, links, or events, then please post to misc@dartlang.org. See the guidelines below.



html-dev@dartlang.org : Dart DOM/HTML Libraries Development
If you want to keep up with the latest developments to the HTML/DOM libraries, here’s where to go! The libraries in question are: dart:html, dart:svg, dart:web_audio, dart:web_gl, dart:indexed_db, dart:web_sql, and dart:chrome, but it’s possible there will be more. This is the group to follow to hear about changes to DOM bindings.
I recommend signing up for this group, as it is a medium volume way to stay up to date with anything changing in the main DOM libraries. If you build client applications, or just care about the modern web, stay tuned!


editor@dartlang.org : Dart Editor and Plugin Development and Discussion
If you use the Dart Editor to write Dart code, or debug Dart applications, or for any reason at all, this is the group for you. The Editor team loves, probably more than any other team, receiving feedback. This list is a great place to talk about what you want to see in the Editor, and discuss the state of the Dart IDE.

---


Other groups:


Just a reminder about the other groups we have:


misc@dartlang.org : Miscellaneous Discussion
vm-dev@dartlang.org : Dart VM Development
compiler-dev@dartlang.org : dart2js Development
web-ui@dartlang.org : Dart Web UI Package Discussion


The following groups are read-only, as their posts are auto-generated:


commits@dartlang.org : Commits to the Dart Repository
bugs@dartlang.org : Dart Issue Tracker Updates
reviews@dartlang.org : Dart Code Review Updates

---


And just to be clear, here are guidelines for posting to any of the groups:


Guidelines

Wednesday, May 8, 2013

New Quick Assist Items in Latest Dart Editor Build

A new Dart Editor build is available at www.dartlang.org/editor

This build introduces a couple of quick assist items.

The first assist item lets you combine an 'if' statement with an inner 'if' statement. Place the cursor over the starting if, press cmd-1, and hit return. That converts the following code:

  if (!(object is Person)) {
    if (object.name.beginsWith('R')) {
      nextItem = object.name;
    }
  }

to this:

if (!(object is Person) && object.name.beginsWith('R')) {
  nextItem = object.name;
}

The other quick action converts (!(item is A)) to (item is! A) format:

Place cursor over is, press cmd-1, and hit Return to convert to to is! format


Eric Clayberg fills us in on the changes introduced in this build:
  • Opening type from omni box opens corresponding file.
  • F3 works for URL in import/export directives.
  • Search View: Show next/previous search result actions.
  • Search View: Show type references as part of the first field in declaration.
  • DND in Files view restored, will update URLs in/to moved unit.
  • New Quick Assist to Join 'if' statement with inner 'if' statement
  • New Quick Assist to convert '!(x is A)' into 'x is! A'.
  • New Quick Fix to add 'package:' import.
  • Fix for ‘library’ directive highlighting when there is leading Dartdoc.
  • Fewer false positives in new analysis engine.
  • Additional warnings and errors enabled in new analysis engine.
  • Many general improvements and fixes to new analysis engine.
      Breaking Change List:
  • Directory.current is now a getter

As always, view the changelog for the full list of changes, and to get started with the Editor see our tutorial.

Thursday, May 2, 2013

Dart Sessions at Google I/O 2013

Join us at Google I/O 2013 in San Francisco's Moscone Center from May 15 through 17.



This year's conference features numerous events of interest to the Dart community. You can see three Dart presentations, and take part in a Dart code lab. One of the talks, by Dart creators Lars Bak and Kasper Lund, will be streamed live. And all of the talks will be available on video.

If you are at I/O, be sure to stop by at the Dart booth in the Developer Sandbox on the 3rd floor of Moscone Center. You can ask questions of Dart team members who will be available on all three days at the booth, and also at the office hours area nearby.

Here are some details about the talks and the code lab:

Web Languages and VMs: Fast Code is Always in Fashion

Lars Bak, Kasper Lund

A fundamental necessity for innovation within web apps is fast execution speed. This talk will take a deep dive into the machine rooms of both V8 and the Dart VM and explain some of the reasons why a new execution engine is needed for taking the web platform to the next level. Please join us to hear about how programming languages impact the underlying virtual machines, complexity, on-the-fly code generation, and predictable performance.

When: May 16, 10:00AM - 11:00AM PDT Level: Intermediate Track: Chrome & Apps


Come see what's new in Dart with its comprehensive, open-source ecosystem for the modern web developer. Learn how to be more productive with a new language: future-based DOM, package manager, JS-interop, a tree-shaking compiler to JavaScript, SIMD, Web Components, a rich editor, and much more. You'll leave this talk all caught up with Dart and ready to make the web awesome

When: May 16, 12:45PM - 1:25PM PDT Level: Intermediate Track: Chrome & Apps

Dart: HTML of the Future, Today!

Sigmund Cherem, Emily Fortuna

Develop large apps in a structured language and still experience fast Edit/Reload development cycles? Indeed, the prophecy has come true. Get crazy productive with Dart's tools, smooth HTML libraries, cross-browser polyfills, and web components based framework. Come learn how you can easily and quickly develop web apps that work cross-browser on both desktop and mobile platforms. We'll show you how to build modern web apps with Web Components and dynamic data-driven views without having to wait for cumbersome compile cycles. Make a change, hit reload, and boom, it's ready for all modern browsers.

When: May 16, 3:30PM - 4:10PM PDT Level: Intermediate Track: Chrome & Apps


You paid for the whole seat but you'll only need the edge! Get hands-on experience and build declarative, modern mobile web apps with Dart and Web Components. Go from zero to magnificent using Dart's structured language, comprehensive libraries, and lightning-fast dev cycle. Learn how to use the Dart toolchain to deploy and test web apps for tablet, phone, and desktop. Yes, you can!

When: May 17, 9:00AM - 11:00AM PDT Level: Intermediate Track: Chrome & Apps

Wednesday, May 1, 2013

Dart Team Updates for April 2013


As usual, Anders Sandholm has kept track what members of the Dart team have been doing recently. He shares his notes for April with us:

  • Dart libraries: dart:io
    • DNS lookup
    • IPv6 support
    • Upgrade sockets to secure sockets
    • Access to the PID (both for current process and the spawned processes)

    dart2js Compiler
    • Added support for new function subtyping rules.
    • Reduced the amount of patching we do on native prototype objects to a single property.
    • Improved indexing operations on native indexable types like typed data lists.
    • Landed support for rethrow and treating throw as an expression.
    • Reduced code size by sharing code in mixins between all classes that mix it in.
    • Improved our simple type inferrer to produce better types.

    Dartium
    • Greatly improved WebGL performance by using dart:typed_data for typed arrays.
    • Following up with Blink impact
    • Various bugfixes

    Pub
    • Ship pub as a snapshot in the SDK
    • Use backjumping constraint solver to resolve dependency graphs
    • Select appropriate versions of packages to work with the user’s SDK

    Dart Web UI
    • Implementing MDV v2 DOM APIs in dart:html
    Dart Dev Rel
    • More cookbook recipes
    • dartlang.org works again on phone/tablet
    • Dart Up and Running is updated to M4
    • Published Lang Spec M4
    • Dart Tutorials now getting the CI love on drone.io
    • Dart Tutorials now has a deployment script (thanks to Adam Singer!)
    • Lots of prep for Google I/O
    • api.dartlang.org now faster thanks to Page Speed Service
    • Continued work on Sublime plugin, including integration with analyzer
    • New Article: Creating Streams

As always, view the changelog for the full list of changes, and to get started with the Editor, see our tutorial.