[MUSIC PLAYING]
ALEXIS MOUSSINE-POUCHKINE: So hi, we're
here back at dotJS in an amazing venue,
and I'm here with Nicolas to talk
about Dart, which is the topic of the session you just
gave at the conference.
So, for those that have been living
under a rock, that have not heard of Dart 1.0
being released first of all, and maybe Dart in general,
can you give us a quick intro to what this really is?
Is it just a language?
NICOLAS GEOFFRAY:So Dart is a language,
a new programming language.
But it's not just a language.
It contains lots of tools around the language,
like an IDE, a lightweight IDE, where
you can do refactoring, debugging, completion, code
completion.
There's also a compiler to JavaScript.
So you can run your code on any modern browser.
And we have what we call a VM, which is really an accelerator,
that will run your Dart code really fast in Chrome.
ALEXIS MOUSSINE-POUCHKINE: So a new language
that can compile to JavaScript, I suppose
this is what most people will do today.
Can you tell us about the differences between language
that will be compiled to JavaScript in terms of workflow
development and performance versus maybe using
the VM as a native execution?
What are the differences here?
NICOLAS GEOFFRAY:So when you compile to JavaScript,
you're obviously limited to JavaScript performance,
the performance of the runtime underneath, right?
There has been a lot of work going on
to make JavaScript really fast in the last few years.
But we designed the language with performance in mind.
The background of the Dart designers,
they've implemented virtual machines for many years.
They've done Hotspot, they've done V8.
So when we designed this new language, we said, OK,
how can we make that language really fast?
And what you have for the Dart VM--
and you can actually see the numbers on our page,
dartlang.org-- is it can run code
twice as fast as JavaScript.
We have a set of benchmarks that we chose.
And you can see the evolution over time.
And you can see initially we were really--
compared to JavaScript-- really bad because we were just
starting the project.
But over time, like in a year, we caught up,
and now we're like two times faster.
ALEXIS MOUSSINE-POUCHKINE: How about VM performance?
You said it's an accelerator, how much improvement can
we expect?
NICOLAS GEOFFRAY: That's two times faster.
The ones you can expect-- you can see the trend
on that graph, which is like it's getting better and better
every day.
So it's hard to say a number, but a 2x, 3x performance
improvement is something you can think of.
ALEXIS MOUSSINE-POUCHKINE: Right,
and the VM is something you can use today, at least when
you develop, or if you control the deployment environment.
I think the work now is to get this
into main Chrome, which is-- it's not there today.
NICOLAS GEOFFRAY: Yes.
It's not there today, there's a lot of technical things
that need to be fixed in Chrome to get the Dart
VM into the browser.
We have a project called [INAUDIBLE],
which is basically a revamp of the memory
management in our Blink engine in Chrome.
And it will enable running two different languages,
like JavaScript and Dart, inside the same browser.
ALEXIS MOUSSINE-POUCHKINE: OK.
So can you talk about-- I think the Angular team also
is working with Dart, and how are they
using their two technologies, and what are they using it for?
NICOLAS GEOFFRAY: So the Angular team, they
have this project called AngularJS
that started before Dart.
And once they saw Dart being this very interesting platform,
they decided to go for Angular to Dart as well, so that they
can offer-- if you want JavaScript, you have AngularJS,
and if you want Dart, you have AngularDart.
So as of today, I think the JavaScript version has
more features than the Dart one, but the Dart one
is trying to keep up to what the AngularJS has.
Internally at Google, we have built an app, just
based on Dart and AngularDart.
That was a few weeks ago.
We had someone from Google presenting how to use Dart
and how to use AngularDart to build
that-- it was a sales application.
And they were really amazed about how productive they were.
ALEXIS MOUSSINE-POUCHKINE: Right, I
heard things about an entire team
being brought to develop a critical app,
because this is about the ads division vision at Google.
And they had no prior knowledge of neither Angular nor Dart,
actually.
NICOLAS GEOFFRAY: Yeah, I think their background was more
about Java, so the app used to be in GWT.
And they switched to Dart without knowing the language,
or AngularDart without knowing the framework.
And the number that they gave us is that it took them
six months to build the app from scratch, dogfood it.
And the dogfood went pretty smoothly,
and they were able to just launch it.
So now pretty much everyone uses it.
ALEXIS MOUSSINE-POUCHKINE: Great, so it's definitely used,
at least internally, at Google.
So you didn't wait for a 1.1 version
to talk about performance.
I mean it's really a feature from the beginning
and-- not even 1.0-- it was, as you said,
something you looked at when you designed the language.
Tell me, maybe for Dart-to-JS, which
is the compiler to JavaScript, which you've been heavily
involved in-- give me an example of what kind of optimization
you're doing there that is really proving to be useful
performance-wise.
NICOLAS GEOFFRAY: So the nice thing about the Dart language
is that it operates in a closed world environment.
So when you're compiling to JavaScript,
you can make a lot of assumptions
of things that will happen at one time,
like you know that certain fields will never change,
or certain fields will always get that type.
So you can do these kind of global optimizations,
for example, tree shaking, type referencing,
all those nice standard compiler optimizations that JavaScript
engines cannot do because they don't have this closed world
assumption.
So dart2js implements all these compiler optimizations
and generates a JavaScipt code that sometimes actually runs
faster than the JavaScipt version
that you would write by hand.
ALEXIS MOUSSINE-POUCHKINE: OK, great.
So how about the tooling, is there anything you recommend?
You mentioned an IDE-- web developers don't really
like IDEs, I mean the term, they have tools,
but they don't call them IDEs.
Do you force people to use an IDE before they can use Dart?
NICOLAS GEOFFRAY: No, no, no, no, we don't.
Actually, I code in Vi as well, because that's
my work environment, my workflow.
So you can code in Vi, Emacs, whatever editor you like.
We also have plug-ins for different IDEs,
on the names I don't have right now,
but you're not just forced to use that IDE.
You don't have to use an IDE.
You can actually also use the command line
and run an analyzer that will analyze your source code
and tell you where your errors could be.
So, no, we don't force anyone into using the IDE.
ALEXIS MOUSSINE-POUCHKINE: Awesome.
So maybe one final question before we wrap this up.
Is Dart just meant to be a web language,
or can you imagine using it maybe on the service side
to write command line tools?
It seems generic enough to be able to do that.
NICOLAS GEOFFRAY: Yes, it is generic enough.
So Dart started as a solution to all the problems
we saw with web development.
So that's why we started Dart with web in mind.
But it can actually do way more than just web.
It can run standalone, so you can run the VM standalone.
You can actually build a server, so if you know Node.js,
that's really similar.
You can build a service side Dart code.
We have IO libraries that do files, sockets, HTTP.
So it's pretty much ubiquitous.
It can be run anywhere.
ALEXIS MOUSSINE-POUCHKINE: Very good.
Well congratulations on the launch of Dart 1.0,
NICOLAS GEOFFRAY: Thank you.
ALEXIS MOUSSINE-POUCHKINE: I hope it all goes well.
Looking from the workshop that was done here at dotJS,
it was completely packed.
So there was definitely a lot of interest there--
NICOLAS GEOFFRAY: They were blown away by the technology.
ALEXIS MOUSSINE-POUCHKINE: Great.
Let's hope we have a lot of other people interested
in this.
And with that, that's all the time we have for it.
Thank you, Nicolas.
NICOLAS GEOFFRAY: My pleasure.
ALEXIS MOUSSINE-POUCHKINE: And go and check it out,
dartlang.org.
[MUSIC PLAYING]