Tip:
Highlight text to annotate it
X
SETH LADD: Welcome.
We are live from the Google I/O floor here with the
co-founders and engineers on the Dart project, Kasper Lund
and Lars Bak.
Thank you guys for joining us.
My name is Seth Ladd, I'm a developer advocate on the Dart
project and today we're going to learn all about Dart.
So thanks guys.
First we should talk, Lars, what is Dart?
And what can you do with it?
LARS BAK: Well, Dart is a new programming
language and a platform.
It includes libraries and programming tools providing
structure and web applications.
So basically, Dart is a new product that has a goal of
improving the productivity of web developers.
And it can be used today.
You could download it and try it out.
SETH LADD: So you mentioned the web.
Kasper, where does Dart actually run?
KASPER LUND: Actually it runs across the entire modern web.
And so it runs in every modern web browser.
And Dart can be translated to modern JavaScript and it runs
just beautifully in all new browsers.
Even we do have builds of Dart that runs with a
native .VM as well.
But I think the core of it is that it really runs
everywhere.
SETH LADD: Awesome.
Mobile and desktop?
KASPER LUND: Mobile and desktop.
Yeah.
SETH LADD: Perfect.
So what's the latest news on Dart?
What did we learn here from I/O?
LARS BAK: Well, that's a lot of stuff going around with us.
Well, first of all, about Dart is getting faster and faster.
We have a virtual machine for Dart and we are now clocking
twice the speed of JavaScript, so this is very exciting.
Because one of the goals for Dart is we have a very
[? efficient ?] limitation, because if you have a faster
engine in the browser, you will allow web applications
available to us to be more innovative in doing
applications.
So we want more advanced apps in the browser.
KASPER LUND: Everything about applications and benchmarks
starting to make good use of the extra juice they're
getting from Dart and it's fun to see these benchmarks and
applications come to life and people are really starting to
build new, cool things on top of Dart.
SETH LADD: Some of the other news that I heard is the Dart
language is stable.
Where are we with the core libraries?
LARS BAK: The core libraries are also stable.
SETH LADD: Great.
LARS BAK: So the latest release in 4 we had with Dart,
we really stopped further development
with the core library.
So they're very consistent now and you can pick it up and use
it in a consistent way.
And all the small pieces in the libraries are fitting
together nicely.
So we're very proud of that.
KASPER LUND: Yeah, you don't have to worry
about breaking changes.
Like if you build something on top of the Dart platform now
using the libraries and the language, they will run
tomorrow, as well.
SETH LADD: Great.
Well, I know that you've both worked on a lot of virtual
machines before.
Tell us something that's different or
unique now with Dart.
LARS BAK: Well, first of all, this is the first time we're
doing a programming language.
And since we had all this experience in implementing
programming languages, it's been nice to be on both sides
of the fence.
We can do the design of the programming language while
thinking about how we perform when we implemented it.
So Dart has been designed to be simple.
And yet, we could still optimize it when we implement
it in a virtual machine.
KASPER LUND: It's really built from the ground up based on
principles and designs that we knew we could make run really
efficiently.
And we are starting to see that come to life with that
factor of two on certain benchmarks and applications.
So it's really nice.
SETH LADD: And you guys, speaking of speed, you showed
a really cool demo in your talk this morning.
Tell us a little bit about that and how you're able to
unlock even more performance.
KASPER LUND: Well, I can do that.
The demo we showed at the session we had this morning
was showing that Dart is capable of taking advantage of
what is know as SIMD instructions found in most
modern CPUs.
And so syndi-instructions are instructions that allow you to
operate on four floating point values and parallel.
Making essentially three new calculations and
audio-processing and stuff like that, much, much faster.
So the demo we showed, had a SMDI version and a non-SMDI
version and the SMDI version was running some 3D animation
like four times faster.
It was really--
SETH LADD: Four times?
That's awesome.
Very cool.
So who's using Dart these days?
We haven't quite hit 1.0, but is anyone actually doing this?
LARS BAK: Well, people inside Google and outside Google are
using Dart now, which is great.
So, you have companies like Blossom doing a lot of web
view component development and also
providing back to the community.
So we have a site where people can upload their packages.
SETH LADD: Help.dartlang.org
LARS BAK: Yeah.
And so other parties can use it.
So this is very exciting and we see a lot of traction this
year on Dart.
People are happy about it and they seem
productive when using it.
KASPER LUND: I guess that's the most important thing.
People actually trying the platform out and using it to
build real things feel very, very empowered by it and
productive.
That's awesome.
SETH LADD: I know there's other partners that are using
and integrating Dart.
WebStorm IntelliJ.
They have a Dart plug-in, for instance.
And then today we saw Adobe announce their FlashPro
exports to Dart.
That's really cool to see these other products and APIs
also playing in the Dart ecosystem.
KASPER LUND: Yeah, that's very nice to see them being able to
make use of the fact that we run across the
entire modern web.
So you can take that code generated from the Adobe tools
and you can compile it further to JavaScript that runs
everywhere.
Or you could make use of the Dart VM and get a fantastic
performance.
It works really well.
LARS BAK: So I just want to add that Dart is an open
source project.
And we have many external contributors to this project
and this is great.
That also allows other companies like Adobe to
provide input to us or even change the code itself, if
they choose to do so.
SETH LADD: So how do developers get started?
Do I have to learn a whole new programming language?
I mean, what happens there?
LARS BAK: Well, the good thing about Dart is we
didn't invent very much.
So it's basically a very simple program language, so if
you have a background in JavaScript, C# or Java, you
can pick it up within an hour, I would say.
KASPER LUND: So all you need to do is to go to our website,
dartlang.org and download a build of the
editor and off you go.
It's actually very easy to get started.
SETH LADD: Great.
I want to go back to the virtual machine aspect.
I know you guys have done a lot of VMs from Java,
SmallTalk, V8, as well and now Dart.
I'm still curious about what are some of the design aspects
of the Dart language that enables
the VM to be so efficient?
What's really the difference?
LARS BAK: Well, the easiest way to explain it is by making
the contrast to JavaScript.
In JavaScript you can add properties on
the fly to an update.
That basically means, ahead of time, you don't know the
format of updates.
In Dart, we have designed it so that when you create an
instance of a class, you know exactly the format.
That means that they don't change the layout of an
update, adjacent to the program.
That makes it much easier to generate code for fetching
fields and also takes a [? cued ?]
method from that update.
KASPER LUND: And we actually see a very big
benefit from that.
If you look at the generated native code that the virtual
machine produces, it's a lot smaller.
It's like a factor of three smaller than the corresponding
code generated from V8, which is a pretty good indication
that we're doing something right.
Like aiming for this more simple internal
structure of the VM.
And that really helps performance.
LARS BAK: Another thing we're also
looking at is quick start-up.
So when you contrast again JavaScript to Dart, when you
read in JavaScript program, you actually execute
JavaScript before you start running the real program.
In Dart it's different.
You don't execute anything before the first instruction
in main is being executed.
That allows us to apply techniques like snapshotting
to get ultra fast start-up.
SETH LADD: And that's incredibly
important on mobile.
Where every battery matters.
Definitely.
KASPER LUND: We're seeing this technology where you can get
snaps of an entire application and read it and start it up
really, really quickly.
Being super, super important on mobile, definitely.
SETH LADD: And especially, if you think about it, some
applications they have a meg of JavaScript.
So imagine parsing in that much text, just
to get the app running.
LARS BAK: On our benchmark, you see that using snapshot
will make startup 10 times faster.
That means you only spend a tenth of the energy when
loading in the application.
Which is great on mobile.
SETH LADD: Especially here at a conference.
When your battery is going to run out.
I want my web apps to be fast.
But this is a lot about the virtual machine.
What are we doing Dart to JS?
To help keep those apps fast even when we compile the
JavaScript?
KASPER LUND: So one of the things that we do in Dart to
JS, is we built a fairly advanced calculation
infrastructure that allows us to do proper optimizations
while we compile Dart to JavaScript.
So we do tree-shaking, where we remove unused parts of your
code and we do things like inline and constant folding,
and all the sort of classical optimizations you do on code.
That means that if you write Dart code, we can generate
reasonably efficient JavaScript code that can
actually compete with handwritten JavaScript code in
a lot of cases.
And we're very much focused on delivering small JavaScript
code, as well.
So we built in a support for minifying the output, so that
commonly used identifiers in your code gets translated to
smaller, shorter identifiers.
That really helps a lot on the code side.
So it's built into the tool and it's kind of nice that as
a developer, you don't have to worry about that.
SETH LADD: I want the tool to do it for me, frankly.
KASPER LUND: Exactly.
LARS BAK: Just to stress a point, we are not trying to
break the web platform with Dart.
The whole point is that even though we don't have Dart in
your browser, you can still use it.
So you can translate Dart to JavaScript and use it on an
existing browser without the Dart VM.
And I think that's pretty cool.
SETH LADD: That's incredibly important.
KASPER LUND: One of the examples of that is actually
the Dart's JS, the compiler that translates Dart to
JavaScript is actually written in Dart itself.
And it can actually translate itself to JavaScript.
And the JavaScript that it translates to can actually run
on any modern browser.
It can run on your iPad.
And that doesn't have a Dart VM at all.
So just the fact that you have Dart that can actually
translate to JavaScript that runs across the entire mobile
and desktop web, is very, very important to us and very, very
cool at the same time.
SETH LADD: Well certainly performance
is incredibly important.
We saw what happened when V8 came along and started a new
renaissance performance and I started to see what the Dart
VM and the Dart tools are out there.
But there's a whole other pillar in productivity.
You talked a little bit about how Dart enables developers to
be more happy and productive, as well.
LARS BAK: Well, Dart is more structured.
That means that you can have tools that
can analyze the program.
And you can have tools that help you be organized to
program, like refactoring of code.
We also have static types you can use if
you want to in Dart.
And it allows you to have more structured codes.
So for instance, if you have two different development
teams that have to collaborate on libraries, you can put in
types on the interfaces to the library, so people could see
exactly what the intent is in using the libraries.
I think that improves productivity because you don't
have to go through a lot of documentation to figure out
what's going on.
You don't have to dive into the code.
You can look at the interface and you convince yourself this
is the intended usage of this library.
KASPER LUND: Now that you mention library, one of the
other key points to boosting productivity is also having
good support for modularity.
And Dart has that built in as part of the language.
So that makes it very easy to share pieces of functionality
and re-use pieces of functionality, which makes you
more efficient, as a programmer.
SETH LADD: Well, this brings back to
the Pub package manager.
We've seen countless number of packages where people have
shared their new libraries and behavior and functionality and
the ecosystem grows.
KASPER LUND: I think we're seeing more than 200 packages
on the Pub page at this point and it's certainly growing by
the minute, basically.
LARS BAK: It makes me happy to see the
communities pick this up.
This is exactly what we intended with this platform.
Programmers need choice when doing web development and I
think that is a good alternative.
And if it makes some programmers more productive,
you've succeeded basically.
SETH LADD: Absolutely.
So what does the future hold for Dart?
What can we expect to come up?
LARS BAK: Well, should I take that?
KASPER LUND: Yes.
[INAUDIBLE]
LARS BAK: So first of all, we are going to ship the Dart SDK
1.0, here after summer.
And we're excited about that, we have a complete package.
At the same time, we are taking the program language
Dart, and putting into the standards body.
Hopefully.
It's in the process.
And then we'll work really, really hard to get into
Chrome, as the next step.
So it's really exciting.
And when it gets into Chrome, you'll see this VM speed up
when you have your existing Dart application.
And that's exciting.
Suddenly everything runs faster.
SETH LADD: That's right.
It runs across the web, if you happen to have the VM it's
like an accelerator.
LARS BAK: Exactly.
KASPER LUND: And clearly we're not done with a
performance work yet.
We can do even better.
SETH LADD: Yeah.
[INAUDIBLE]
see the numbers are we're not even at 1.0 yet.
KASPER LUND: It looks good, but it can get even better.
SETH LADD: Absolutely.
So Dart's an open source project.
You could participate on GitHub and Google Code.
And we ask you guys to go to dartlang.org, download the SDK
and the editor.
And join the project, see what you can build.
We look forward to seeing what you build with us.
Thanks everyone.
LARS BAK: Thanks.