ALEXIS MOUSSINE-POUCHKINE: Hello.
Welcome back to Devoxx 2013.
We're here right after the Google keynote
with Lars and Kasper.
And welcome, guys, and congratulations.
You've just announced Dart 1.0.
KASPER LUND: Sure did.
LARS BAK: Fantastic news.
ALEXIS MOUSSINE-POUCHKINE: Yeah, I know.
You've been working hard on it, I'm pretty sure.
LARS BAK: We've spent the last two and a half years
working on Dart.
So finally it's out, and it seems like it's well received.
It's a fantastic new platform for writing web applications.
ALEXIS MOUSSINE-POUCHKINE: Right.
So give me the big picture in terms
of what it's trying to do, the fact that it's not
just a language, probably, the elevator pitch.
LARS BAK: The elevator pitch?
ALEXIS MOUSSINE-POUCHKINE: Yes.
It's going to be short, first floor.
LARS BAK: We only get one [INAUDIBLE]?
ALEXIS MOUSSINE-POUCHKINE: Moving up.
LARS BAK: The only thing we want is
to make a program that's more efficient way when
they write web applications.
And today, there's currently some obstacles.
We think the language is not structured enough
for writing big applications, lacking of tools.
And we're trying to solve that with Dart.
And so Dart is a combination of a programming language,
a rich set of consistent libraries, an IDE.
And then we have the final piece.
We have Chromium with Dart VM support.
So that means that when you do development,
if you change the code, you can try it right away.
So no lag in tools when using it.
It
KASPER LUND: I think it's worth adding
that in addition to having that native way of running
Dart code, you can also compile Dart to JavaScript and run it
across today's browsers.
ALEXIS MOUSSINE-POUCHKINE: Which would be probably--
so you're talking about the developer use case, which
is as fast as possible of a round trip,
so you get immediate feedback on your changes.
And you're more addressing the deployment story,
which today probably will be more
about generating JavaScript.
But--
LARS BAK: It's a valid point.
You need to deploy your application.
And by no means, we don't want to fragment the web.
So it's important that when you translate that code
into JavaScript, it'll work on all the modern browsers.
ALEXIS MOUSSINE-POUCHKINE: So let's
drill down just a little bit on this.
How good of a job are you actually doing
generating the JavaScript?
How big, how efficient is the code that's being generated?
KASPER LUND: So the generated code
is getting very, very good.
So we measure performance of the generated code
and the size of the code, check it over time.
And we've made lots of good improvements
there, to a point where generated
JavaScript code emitted from the Dart to JS compiler
is as efficient as handwritten code for a lot of cases.
ALEXIS MOUSSINE-POUCHKINE: And I probably
should have mentioned that you guys are performance guys.
You've been working on Hotspot, on V8,
and the goal every time was really
to enable a new class of applications
because the speed was so much faster.
KASPER LUND: Performance is good.
People tend to like it.
It's easy that way.
ALEXIS MOUSSINE-POUCHKINE: Perfect.
LARS BAK: One thing I should add about performance
is that if you increase performance in a platform,
you enable a new class of applications
to run on a platform.
And that certainly happened on the web,
where over the last five years, performance of the browser
has just went through the roof.
And suddenly, you see very complex and very animated
applications running on the web.
And this is just due to performance.
When you give performance to programmers, they'll use it.
KASPER LUND: Especially if you give them
like 100 times performance improvement.
That really changes the game.
Things that you couldn't build before
are suddenly possible to build.
ALEXIS MOUSSINE-POUCHKINE: So this is 1.0,
and you guys are talking performance already?
KASPER LUND: Why not?
ALEXIS MOUSSINE-POUCHKINE: No, great.
I think it's a great feature.
Performance is always a great feature.
It tends to be a 1.1 or 2.0 feature.
In this case, it's not.
LARS BAK: I think Kasper forgot to mention the Dart VM we have.
We also have a VM for Dart.
It's running twice as fast as JavaScript.
So it's not too bad.
It's a good starting point.
And we expect that over the next year or two
to dramatically increase the speed,
both on the translated code to JavaScript, but also
on the native implementation.
ALEXIS MOUSSINE-POUCHKINE: So the end result
is web applications.
But not only you can go-- we'll probably
talk about where else you can use Dart.
But who is this really targeted at?
What kind of developers?
Is it JavaScript developers today,
web developers, maybe service side, trying to get into--
KASPER LUND: There's a lot of interest from people that
actually have a background in Java, C#,
that want to try to find a good way of using their skills
on the web for building web apps.
We certainly see a lot of people interested there.
ALEXIS MOUSSINE-POUCHKINE: So worth mentioning probably
is the optional typing.
LARS BAK: Optional typing is interesting in that you
can start out doing prototyping without being bothered
by the types.
When you then get your structure into your program,
you can start adding static types in your APIs.
So at least all the teams that use your code
can see how it should be used.
KASPER LUND: Yes, documenting the intent
of your code makes a ton of sense
when you're working with people.
LARS BAK: And it also makes it much more readable.
So given that you're serious about doing web applications,
your applications will survive for a long time,
and you need to maintain that and refactor it.
And the more intent you have specified in the program,
the easier it is to maintain over time.
KASPER LUND: A simple description
of that is that we found that people that
use Dart for writing web apps have an easier time actually
taking a sample and understanding what it does
and finding relevant documentation from the type
annotations than people that start from JavaScript.
Because you don't have the types in there
to tell you what to look for in the documentation.
So it's really helpful.
ALEXIS MOUSSINE-POUCHKINE: So other than types,
it has everything you'd expect from a modern language,
so packages built in, lambdas, all of those things.
You want to talk about maybe syntactic sugar?
You've mentioned you've done a demo during the keynote.
KASPER LUND: Sure.
So we try not to add too much syntactic sugar.
But sometimes, you just want to express your code
in a concise, nice way, without repeating yourself
over and over again.
So we've added a few things that make it easier
to construct objects in a simple and sane way
without repeating the field names and the parameter names
all over the place, like it's common in some other languages.
So we've done a lot of things to just cut down
on the boilerplate.
So we like to call it a ceremony-free language.
You don't have to write tons of code just to get your stuff up
and running.
LARS BAK: And the feedback from the products that
are using Dart so far has been that it's
more compact than Java, and it's very readable.
So, so far, it looks good.
It seems like we've hit the sweet spot
for what people are expecting.
ALEXIS MOUSSINE-POUCHKINE: What's
quite impressive, I think, is that you guys have pretty much
started building a real community around it.
So because you have package management,
you have people contributing those libraries
in the form of packages.
You have people using it, early adopters.
So tell me more about the community
and how it's been used, and maybe what's
Google's interest in all this.
And is Google even using Dart or planning to use it?
LARS BAK: Of course they're using Dart.
So this is not a toy project.
We're doing it for real.
And we're serious about making it a good platform for writing
scalable web applications.
One thing you have to bear in mind, before we have Dart,
you would find big web projects that
were using JavaScript plus comments, where
the types were put in comments.
And you would, based on these comments,
try to figure out how the program was stitched together.
And we're just taking the extra step
in making a language that supports that.
So for applications that are large
and where you have several teams working on the same code base,
this is a huge step forward.
And of course, you know that Google
is having a lot of big web apps.
And we are serious about making sure
that we can maintain these web apps over time.
So yes, you will in the future see applications written
in Dart from Google, as well as from the outside,
which is important.
ALEXIS MOUSSINE-POUCHKINE: So there's at least one
that's publicly talked about and Brad Green from the Android
team was up on stage talking about.
How to build an application with--
was it a team of 10, 12 developers
in less than six months?
And none of them actually knew neither Angular nor Dart.
LARS BAK: So this is the interesting part.
We have been very conservative in designing the programming
language so that if you had a background in a programming
language like C# or Java, you could easily transition
into using Dart without having any surprises.
So one of our core goals when designing the programming
language was there was no surprises when using it.
We would like to have each construct in the language
be as natural to understand as possible,
so no magic was happening to the program.
I think that that is key to make sure
that people like the programming language.
KASPER LUND: Like returning to your point about packages
and community around Dart, it was very nice
for us to be able to give a keynote.
And the demo that we wanted to show in there
was actually based on third party, you could say,
community code built by someone outside our team,
just using the Dart platform.
And it's an excellent set of libraries
we have out there that way.
ALEXIS MOUSSINE-POUCHKINE: So Angular is very popular.
Tell me more about the work you've
done with the Angular team.
LARS BAK: So the Angular guys decided
to make a Dart version of Angular.
And that's a great way to write apps,
a framework for writing web apps.
But in all the logic in the program, you just specify Dart.
ALEXIS MOUSSINE-POUCHKINE: And then what kind of benefit
do they expect from that?
And are they getting it already?
KASPER LUND: Well, they're getting
some of the same benefits as everybody else that's
writing in Dart-- more structure to your code.
It's easier to document your intent.
Everything's built for writing larger, maintainable apps.
And you certainly get that, even in a setting
where you're using Angular Dart.
So there's really no difference between Dart
and Angular Dart in that space.
Angular solves the problem of data binding
and those things, in the Angular way, you could say.
And then Dart takes care of making sure
that your application can scale up and in the basic constructs
that it provides.
LARS BAK: So if you like the nice bindings they provide
in Angular, then you can use Angular Dart, together
with all the logic written in Dart, and it works just great.
ALEXIS MOUSSINE-POUCHKINE: Great.
So you can use Dart to build web apps.
Can you use it for command line, service side?
Does it even make sense-- it's a general purpose language,
so you should be able to do that.
LARS BAK: It's a general purpose programming language.
And we already have applications that
are written outside the browser.
One should mention the Dart to JS command line tool.
It's a compiler that takes Dart code and produces JavaScript.
Of course it's written in Dart.
KASPER LUND: And of course, it can compile itself.
ALEXIS MOUSSINE-POUCHKINE: Of course.
LARS BAK: Oh yeah.
So you can compile the Dart to JS compiled from Dart to JS
and run on top of a JavaScript engine, if you like that.
KASPER LUND: If you're interested in that sort
of thing.
LARS BAK: But that's probably beyond the point.
But this is one example where we have
scaled Dart to run outside the browser.
So that works really well.
Another one is that we have a performance tracking server
system inside to track our increase in performance.
ALEXIS MOUSSINE-POUCHKINE: That's server side.
LARS BAK: It's all written in Dart.
And that's been running stable for one and a half years now.
So it even works outside the browser.
KASPER LUND: It does.
ALEXIS MOUSSINE-POUCHKINE: Very nice.
LARS BAK: And there's more to come here.
But I think it's important to focus on web applications now.
This is the first area where we are
trying to have consistent libraries and so forth.
And when that all works well, we'll
be happy to expand outside.
ALEXIS MOUSSINE-POUCHKINE: Yeah, let's focus on that.
Let's do that really well.
So you guys have had a lot of experience
in virtual machines, Hotspot, V8.
What were the challenges with Dart VM specifically?
KASPER LUND: It's sort of designed
to be less challenging, you could
say, than many of the other things.
We know, from from ground up, how VMs work.
So that helps when you design the language
that you're trying to avoid some of the pitfalls that
make it really hard to implement.
So we tried to make a design that
allows us to make it go really, really fast.
[INTERPOSING VOICES]
LARS BAK: We designed it to make it easier for the VM
implementer.
So one thing that we have been bothered by in our systems
is that it's very hard to predict
the performance of an application.
So the Dart programming language has
been designed so that we can predict
how well it performs on the VM.
So the programmer, when writing a program,
he can sort of estimate how fast it runs.
And this is great.
KASPER LUND: It's basically all about avoiding
performance pitfalls.
If you fall off that performance cliff in too many weird ways,
it makes it really hard to reason
about the performance of your code.
LARS BAK: So for instance, to give a contrast
to make it more concrete, in JavaScript,
you know you can use an object as a dictionary, basically.
And if you, from the side, get hold
of an object inside an application
and start messing with it, suddenly the whole application
runs slow.
And that cannot happen in Dart.
So we designed it in such a way that that's not possible.
And I think that will be great for developers,
because they can predict how well the code runs and should
not try to sort of guess whether it runs fast
on one platform or the other.
So this is good.
ALEXIS MOUSSINE-POUCHKINE: So performance, by the way,
is not just the app running fast.
It's also about the app starting fast.
In the web, that actually makes a lot of sense.
So there's work, I understand, around that
in the Dart VM in terms of fast startup.
Do you want to talk about that?
LARS BAK: Yeah, we have snapshots.
ALEXIS MOUSSINE-POUCHKINE: Snapshots.
LARS BAK: So snapshots is a simple mechanism
where you basically start up the program
until you're about to execute main.
And at that point, you take the whole heap
and stabilize it and put it into a binary format on the file
system.
And you can use that as a starting point
when you start the application.
And easily, you get a factor of 10 in startup performance.
That means that if your application would take a second
to start up, now it's only 100 milliseconds.
And as soon as the Dart VM appears in Chrome,
then you will hopefully see a very snappy startup
of web applications.
Right now, we're using these snapshots
when starting up Dart to JS to make
sure the tools have a fast startup in our tool box.
ALEXIS MOUSSINE-POUCHKINE: Great.
So when can we-- are you starting
to talk to the Chrome guys to get in?
Of course, you have a Chromium build with the Dart VM, which
is what you mentioned for the development cycle.
Next step is obviously to make it
available to as many people as possible.
And people will just realize that the app is running faster,
right?
LARS BAK: Precisely.
You can think about the Dart VM inside the browser
as an accelerator.
So if it's not there, it'll take off the [INAUDIBLE] version.
Talking to the Chrome guys-- we are the Chrome guys.
We are working on the Chrome team.
So of course.
ALEXIS MOUSSINE-POUCHKINE: Well, I'm
sure you need to do some convincing before it happens.
LARS BAK: The technology speaks.
ALEXIS MOUSSINE-POUCHKINE: For itself.
KASPER LUND: It does.
ALEXIS MOUSSINE-POUCHKINE: Wonderful.
Well, on that note, congratulations again
on that 1.0 release.
Where should people go to try it out?
LARS BAK: Dartlang.org.
Try it out.
Send us some feedback.
ALEXIS MOUSSINE-POUCHKINE: There you go.
[INTERPOSING VOICES]
LARS BAK: --for you guys.
So hopefully you like it.
And send us feedback so we can improve our system.
KASPER LUND: That's it.
ALEXIS MOUSSINE-POUCHKINE: Thank you guys.
LARS BAK: Thank you.