The Changelog: Software Development, Open Source - Google's Dart Programming Language (Interview)
Episode Date: May 8, 2014Adam and Andrew talk with Lars Bak and Seth Ladd from Google about Dart, a new language and platform started by Google for scalable web app engineering....
Transcript
Discussion (0)
Welcome back everyone.
This is the Change Log where a member supported blog, podcast, and weekly email covering what's
fresh and what's new in open source.
Check out the blog at thechangelog.com, our past shows at 5by5.tv slash changelog.
And you're listening to episode 121.
We're joined today by Lars Bach and Seth Ladd,
just two of the awesome team members behind Dart,
a new language and platform started by Google for scalable web app engineering.
Today's show is sponsored by our partner DigitalOcean, FreshBooks, and New Relic.
We'll tell you a bit more about FreshBooks and New Relic later in the show, but DigitalOcean,
we owe our uptime to DigitalOcean. We're hosted on DigitalOcean. We are a partner with DigitalOcean.
We think that you should use DigitalOcean. I mean, that should be the spot right there, right? But
it goes on. It's super easy to use DigitalOcean.
Literally, in 55 seconds, you got a server, full root access, SSH keys on the machine,
your choice of OS at your fingertips.
It just doesn't get any easier than that.
It's affordable.
Pricing plans start at $5 a month.
You get half a gig of RAM, 20 gigs of SSD drive space, one CPU, one terabyte of transfer, and it's blazing fast, SSDs, and it's super easy to use.
Use the promo code CHANGELOGMAI, that's right, CHANGELOGMAI, to get a $10 credit when you sign up.
Head to DigitalOcean.com to get started, and now, on to the show.
Welcome back, everybody.
We are joined today by Lars Bach and Seth Ladd.
Lars is a co-founder of Dart and V8,
and Seth is a developer advocate for Dart.
We're here today to talk about Dart and what it is and all those good things.
So, Lars, why don't you give us an introduction
to who you are and where you come from?
I don't want to spend too much time,
but the sad story is I've been doing virtual machines
for object-oriented languages since 88.
So there's been a few.
And you probably can remember some of them,
like Hotspot.
I was a tech leader on Hotspot.
I've done StrongTalk, what else?
V8 is one.
Lots of different virtual machines,
and my game is making the languages run fast.
Lately, last three years, I've been focusing on
the new programming language Dart.
It's basically sort of a witness from the experience of language Dart. And it's basically sort of a readiness
from the experience of implementing JavaScript.
So we can talk about that later.
Yeah, for sure.
So I forgot to mention when I introduced you
that you both are at Google.
So I just wanted to make sure we make that clear.
That is true.
Okay.
All right.
And Seth, why don't you give us an introduction
about who you are and where you come from?
Sure.
So I'm a developer advocate with the Google Developer Team.
And for the past couple of years, I've been focused on Dart and helping external and internal developers get online with our tools, our language, our libraries, and help get the community excited and participating in this new project.
Awesome.
So can one of you give me an introduction to what Dart is?
I think that a lot of people have heard about it because it's not exactly brand new, but
maybe there are some people out there that aren't really familiar with it and would like
to know what it is.
Oh, I can take a stab at that.
We started the Dart project three years ago, and it's a platform, and it includes a new programming language for the web,
but it also has libraries,
a consistent set of libraries,
and programming tools on top of that.
If you talk about the language,
it's a clean, simple, class-based,
object-oriented language,
and it's more structured than JavaScript and we really want to capture
people that are interested in having structure in the programming language so they can easily
do refactoring and build large web applications.
Awesome.
So one of the things about Dart I think that I've heard just kind of talking to people and and and actually like
doing some of my own research is right now it seems like and this is kind of the main one of
the main questions i want to kind of get to but right now it seems like one of the big goals of
dart is to be able to compile it down to javascript but that doesn't feel like the end goal for dart
so would you say that javascript or sorry, that Dart is going to be an evolution
in writing programming for the web,
or is it going to be an option a la CoffeeScript
or something like that to compile down to JavaScript?
Well, first of all, I have to say for us,
being compatible with the web is really important.
So one of our most important components
is the Dart toS compiler. It translates
the Dart source code into JavaScript and ensures that you get the same semantics as if you ran on
top of the virtual machine. Of course, we have a virtual machine as well, and we have a special
build of Chromium we call Dartium, and it has that Dart virtual machine built in,
and so we can run raw Dart in that browser.
But yeah, the compatibility with the web is super important for us.
So do you think that's something...
I guess the question is, if you had to kind of pick,
would compatibility with JavaScript be what you would rather,
or would you rather every browser have the Dart VM installed?
Well, first of all, it's always great if people take all our code
and include it in the browser.
But I think the point is what we're trying to do is we're trying to make sure
that if you only have a JavaScript engine in your browser,
you'll still run Dart fine.
But there are certainly advantages with running the Dart VM inside the browser.
Two of them is that it runs faster.
And secondly, you have a fantastic startup experience
because the applications start up super fast.
I do want to draw a distinction, though,
between Dart and some of the other languages like
CoffeeScript so CoffeeScript is designed to provide a new syntax on top of JavaScript but
it still retains JavaScript semantics whereas Dart is its own language so yes compiling a
JavaScript is really important for the project in the web but we're as Lars was saying we're
able to bring over the semantics from the Dart language and libraries back down to JavaScript.
So it's not just syntactic like code of paint.
So, yeah, that's something that, you know, you'll see with like TypeScript and ASM that are more like, you know, just subsets or supersets of JavaScript.
But this is a new language, but I have a, I mean, maybe just in layman's, like, if you could explain to me the difference, because if it compiles down to JavaScript, then it seems like it, while, you know, in the future, I could envision a world where using Dartium or any other browser with the Dart VM has major advantages because you can write Dart and run Dart in the browser.
But as long as it's being used to compile down to JavaScript,
I don't really necessarily see the huge increases that you can get with the Dart VM.
Well, let me just stop you a little bit.
You get fast execution.
I guess that's a good thing.
But think about the development process.
When you change the line of code,
you can be up running right away
instead of first
translating to JavaScript and run in a Java engine. If you have the Dart VM inside the browser,
right, you can do debugging at the source level. And you can do very interesting things that are
based on the language. That's hard to do when you first translate to JavaScript and want to provide the same kind of programming experience.
Yeah, so I guess that's what I'm saying,
is that it seems like the major benefits of Dart,
other than just the language itself being a very clean language,
is when you actually use it in the Dart VM itself
rather than compiling it to JavaScript.
I think one of the huge benefits of Dart is the productivity,
which is sort of what Lars is alluding to here,
in that as a developer, and I'm being asked to deliver
engaging, wonderful experiences to my users on mobile devices
that need to run 60 frames a second,
take advantage of all the HTML5 features,
and really take advantage of these new mobile devices,
I'm being asked to develop and deliver much more complex applications.
And when I have a much more complex world,
I need languages, libraries, and tools
to help me compensate for that
and do things like static analysis,
warnings, refactoring,
all the great stuff that we've had
for other platforms for years and years and years.
And I'm basically being asked
to do this on the web now today
just because my
users are asking for this and so the huge advantage of dart is i get that productive
development experience yet still get the really fast iteration times of the web
so so one thing i would like to mention about the language we haven't talked about what's in
the language but one thing i find that's really great is the optional typing.
And optional static typing gives you that you can start programming
without any types.
So when you do experimentation, you can get up, run very fast.
But as you write a library and you want to harden it,
you put in the types maybe on the interface to the library,
and you can make sure that if
people want to use the library, they can validate that you pass in the right kinds of objects
to that interface.
And I think that allows the programmer to trust the library more instead of that if
you don't have any types and you call a library and you get an error, you basically have to
debug third-party code, which is not easy.
Yeah, I think there are some really cool things
about Dart, the language itself,
which we'll get into in a little bit.
But one thing that I think...
Okay, so we've talked a little bit about
what's the major benefit of Dart in its current form,
but what would you say...
Where do you see Dart in five years
or in 10 years or in 15 years?
Where do you want to see this project headed?
Clearly, we want to make sure
that a lot of programmers will use it.
Right now, it's clear that web applications
are becoming larger and larger,
and to control these big piles of source code,
I believe strongly that you need a better structure
in the programming language.
And the way we handle libraries in Dart
will certainly help you.
The projects we have been supporting in Dart,
they have all been saying that as soon as they get used to the new language which
doesn't take very long they really really like the the typing and the tools so they can you can
do refactoring that really counts when you build big applications and you have to maintain them
over time yeah one of the the and this is kind of an aside here the fact that dart doesn't hoist
variables i think makes it a lot easier to read, like, you know, top to bottom than JavaScript just in general.
I mean, that's like a one little teeny feature of Dart, but like a major impact in readability since I've noticed it.
So you asked, what do we want to see in 5, 10, 15 years, I'm extremely motivated to help the web continue to develop and deliver
amazing experiences on mobile devices. And so if anything we can do to help developers just
naturally and organically continue to pick the web to deliver these really great experiences,
then I'm very happy. And I feel like at this point, we need to give developers who are used
to building on native platforms and who have very high expectations in tools and productivity, I need to deliver that to developers when they want to target the web.
Yeah, so I think that that's definitely a pretty broad goal, right?
And I think that there's nothing wrong with that.
I think that's a great goal.
But how do you do that? I mean, I guess my question is, I'm trying to figure out a good
way to word this. But so in the 90s, like, you know, JavaScript comes about, and then all of a
sudden, today, it's ubiquitous, and it's everywhere. And you can, you know, use it in any environment
that basically a browser exists in and now with, in cases of not the browser existing.
So how does Dart go from where it is now
to becoming ubiquitous where you can use it anywhere?
Well, in the first phase here,
it was very important to focus on the web client
and making sure that we can do web applications really well.
The next step is, of course,
running on the front end of the server
so you can use the same programming language,
the same libraries in the client,
but also on the server side.
And with our last release,
we sent out some more IO code
so you can actually run the Dart system
on the server side.
So it's clear that if you can span
from the client to the server,
it gives huge advantages to the programmers.
Yeah.
But again, I would like to say that what's important to us
is to make sure that we provide a very efficient programming platform.
And of course, it's great to get more users, but making sure that people can innovate faster
is a clear goal for us.
I think Dart is a different language,
and it's certainly not everybody
that likes a new language for the web.
But deep down, I think that innovation
is what's going to make the web even better.
So it may be worth it to just talk about
what is Dart for a second,
because we've talked a lot about the language a lot,
and I'm not sure many people know
the full breadth or scope of the platform.
So real briefly, it is its own language,
and I'd love to hear Lars talk a little bit
about some of the influences of that.
But there's also a core set of libraries, which I think is really missing from the web platform
right now. It's very hard to say, like, what kind of collection facilities do I have? What do I have
for dates and times? What do I have for stopwatches, debugging, you name it. So Dart ships with a very
rich core set of libraries. It also has a package manager. And inside the package manager, you can go get libraries for crypto, game drivers, image processors, you name it.
There's, I think, over 880 packages in our package repo right now.
We also ship an editor and plugins for other editors like Sublime and WebStorm and Eclipse.
And then we have, of course, a Dart to JS compiler.
And we also have a great static analyzer,
which speaks to that productivity aspect of Dart,
where because Dart is static and toolable,
I can run programs that tell me where I have warnings and errors
before I run the program.
And that's such a huge productivity win.
So I really think of Dart as a platform on which I can build.
So it's interesting because we actually had Rob Pike and Andrew Geron on the show to talk about Go a while back.
But it feels kind of like you are taking the same approach to Dart as they are with Go in that tooling and productivity is a major, major part of it.
It's not just a language.
It's right.
It's not just a syntax that compiles the JavaScript.
It's its own language with its improved semantics, better developer productivity, and very toolable.
I think there are certainly big differences
between Go and Dart.
Yeah, of course.
One thing I would like to highlight
is that we have been very conservative
when designing the language.
So if you have a background in Java or C Sharp
or JavaScript, it should be very easy
to start being productive in Dart.
I would say in a few hours,
you can probably understand most of the
semantics of dart and that has been a goal from the beginning so that we can easily get programmers
to be productive in our system yeah so talking about a little bit about the community of dart
here the is it similar as go where like it's an open language and the whole world can see
the changes that are made, but you're hesitant to accept changes from the outside world as
of right now anyway?
On the contrary, we want all the changes we can get.
So everything that relates to Dart is out in the open, even from day one. All our chainslists go directly to
the outside and we are getting patches in from external developers and we encourage
that a lot. It's clear that for some corner cases of the advanced compiler, not many people contribute,
but in more light areas, we get a lot of contribution,
especially when it comes to packages and so on.
But on that note, the language itself is now in the ECMA spec process.
In fact, there was some really good news there.
The ECMA group TC52 has been meeting to discuss the Dart language spec itself,
and it looks great, and it looks on track.
So what does that mean for Dart?
If Dart becomes standardized, what does that mean?
How does that change the game?
It basically means that there's an official process
how the language is going to change in the future.
So we inside Google cannot just decide to change it.
And I think that's really important if we want to have other companies or organizations implement another version of the VM.
Because then they can join the committee and make sure they have an influence in how the language is going to change in the future. Do you think that there's... It's double important too when you're talking about building
web languages and things that need to live in the open like the web ecosystem does. So I think a lot
of developers are just look for that to make sure that they can trust this is something that has
legs and longevity. Let's pause the show for just a minute and give a shout out to our sponsors,
FreshBooks. You know, we use FreshBooks here at The Change Log, and I gotta say, I'm probably logged
into FreshBooks five, ten times or more a day, either sending invoices, reviewing invoices,
estimates, receipts, expenses, all these different things we're doing, and honestly, it makes
our life a breeze.
It makes my life so much easier, and it makes people a breeze. It makes my life so much easier and it makes
people that work with us, their life so much easier because it's so easy to pay us. It's so
easy to, to like collaborate on what's going on, um, around these parts of our business. And it's
just, just love fresh books. And I want you to love fresh books too. If you're, if you're out
there and you're not using fresh books, go try it out. 60-day free trial we're giving away to our listeners.
If you go to GetFreshBooks.com and enter the changelog in How Did You Hear About Us,
when you sign up, you'll get access to that 60-day free trial because they support 5x5 and the changelog.
But tell me if this sounds like you.
We just came to this tax season, and your life is probably a bit of a mess. If you weren't using fresh books,
you're digging through invoices, you're going through all your records one by one. It's the
worst. No one wants to do that. And that's why there's fresh books. Okay. It's simple. It's easy.
It's a cloud accounting solution that makes not only your taxes easy, but your day-to-day business a breeze. Create
professional invoices, capture and track expenses, get real-time business reports in just a few
clicks. All too easy. The sooner you start using FreshBooks, the sooner you can start focusing on
the work you love. Focus on your work, not your paperwork. Again, go to this URL, getfreshbooks.com,
and enter the changelog in the How Did You Hear About Us section,
and you'll get access to that 60-day free trial from FreshBooks.
Do it now.
Do you think that the lack of standardization right now
has prevented anyone from considering building a VM for Dart other than Google?
We're still early in the process, I would say.
But you cannot make a standard out of something
that's moving fast.
So it's important that you have a basic design
of the language and it's fairly stable
before you standardize it.
So you need to be at a certain stage
before you can start standardizing.
I think we are there now.
We haven't changed the language very much
since we came out with 1.0 in November.
So this is the right time to do it.
And we expect that the current spec
will be ratified in the ECMA TC52 here this summer.
That's pretty quick, actually.
I feel like just a few months to have the spec ratified.
Well, we started the process late last year.
Okay.
It's half a year.
Yeah.
So it's funny.
When we talked about,
I felt like I had heard about Dart much longer.
You said the project's only about three years old?
Yeah, a good three years. Yeah. So when you say, yeah, I mean, just, I just remember hearing about Dart and I guess maybe I've made so many life changes in the last couple of years
that it seems like it's been a lot longer, but, but that's a pretty quick process in general to,
to start the language and get to a point now where we're talking about you know like when you started
Dart three years ago was it
something that was an experiment or
did you kind of envision it being
this here only three years in the future
well I hoped
it would be at this point
so but when you started
it was not an experiment
like five years ago
I did an experiment with Casper
where we spent one quarter
do a Dart
like language we did a VM
and an implementation just to see how
it would work on the web
and that looked pretty good so
three years ago we got the
go ahead
to do it but it was not an experiment. We
really wanted to change how you did web applications or you could, an alternative to do web applications.
So I think we are on good track. Three years is not long for a new programming language
and we're getting good traction. The interesting part is that people that actually have tried dart and develop some real code with it they are fairly happy and that's what makes me proud
yeah i mean i would encourage anyone to just go to the website and and you can tell very quickly
that this is not it's very different from javascript in a lot of senses but it's very easy
to pick up and you can just kind of you can tell that that there's a lot of emphasis put in like you know if you're a web developer if you've built things for the web
right now it's not a huge hurdle to be able to write dart and i think that's a major win
for you guys for sure and just to talk about the seriousness of the project we are working we
really hard to have a very clear semantics that's documented with a language specification
and making sure the implementations we have are conformant.
So that's what we spend a lot of time on.
And also making sure that when we generate JavaScript from Dart,
we validate the resulting code
that runs in the various modern browsers
like Internet Explorer, Firefox, Safari, and Oberon. runs in the various modern browsers like internet explorer firefox safari and obron
so i want to move on a little bit to the language itself and some of the design and the thought
behind the language do you do you all have anything else you want to say about just the
motivation and the theory behind dart i'm just super happy being able to write in dart so i think it's really cool that I get to come to work and work on something that actually makes me happier to build for the web.
So I feel like that's a win.
Yeah, for sure.
So let's talk a little bit about the language itself.
Can you kind of give me some, I don't know, like obviously this is hard to summarize in a few sentences because I'm sure a lot of thought went behind this.
But can you give me some of the insight into the thought behind the language
and what the process looked like to figure out the syntax of the language and all that?
Well, first of all, we have to say that the only way to get a successful language
is to include curly braces.
So that was the first thing.
And semicolons.
And semicolons, yes.
Of course.
And then secondly, we knew from the beginning
that it had to be translated to JavaScript.
And that sort of was a challenge
because some of the language feature
we wanted to have into the language,
we could not put in
because they would not translate to efficient JavaScript.
So the design process was sort of very iterative in coming up with a feature that matched the
language and then implement and see how it would look in JavaScript.
One thing or a feature we didn't put in, we wanted to have, but we could not make efficient
on top of JavaScript was non-local returns, as you probably know from small talk.
It's a way to bail out from a recursive algorithm
very quickly.
But in JavaScript, you could only implement that
by throwing an exception,
and that was really slow on most implementations.
One thing that I found really fascinating
when I talked to the co-founders
and some of the other VM developers for Dart
is the difference in how VM design
impacted the language design.
So maybe Lars, when you helped build V8 and you took the JavaScript language,
which is very flexible, but you ultimately made it very fast.
How did that experience help us design the Dart language so that the implementations can be fast?
Well, JavaScript is very flexible.
If you try to access
a property that's not there,
you'll return an undefined.
If you set a property
that's not there, you'll expand the object
with a new property.
And so in order to make
V8 fast, we had to
design for a sweet spot kind of
application.
And the problem with that is that if you from the side create a new library and you poke
at a few objects, suddenly the application would be slow.
So one of the design goals of Dart was also to make sure that we had an execution model
that would be robust when it came to performance.
So you can actually trust that if you had a performant library,
it will continue to be robust no matter how you used it.
So one of the impacts of that is Dart has classes
and a Dart program is declared.
And then when the virtual machine scans it
and then parses it and then compiles it,
that's the structure of the program.
And you can know that that is the structure
so the VM can more quickly and more easily and the structure of the program. And you can know that that is the structure so the VM can more quickly,
more easily, and more efficiently optimize that program.
We basically borrowed the optic model from Smalltalk.
So a very simple optic model where in a class you define the fields you want
to have for the instances, but you cannot expand it at runtime.
So fields have to be declared.
And the same way if you have a non-global array
and you access an element outside the range,
you'll get an exception instead of expanding the array.
So it's more rigid than small talk in some sense.
On the other hand, you also get notified
if you do something wrong.
Like in JavaScript, if you have a spelling error,
what happens is the program continues to run,
but it doesn't behave the right way.
In Dart, you'll be notified.
You'll try to access something that's not there.
So we talked a little bit about how flexible JavaScript is,
and that's kind of a double-edged sword, right?
Like, it's neat and it's nice because it allows me to do a lot, but it also makes it very easy for, like, developers to make mistakes.
And in a lot of ways, because, well, for a few reasons, I would imagine, right?
The first is obviously that in order to compile Dart down to JavaScript, like, it's a lot easier when Dart is more restrictive than JavaScript to be able to compile to JavaScript.
And the other way is it's a lot harder,
it seems like, to make mistakes in Dart
in the classical way that you can make mistakes in JavaScript.
Was that part of the thought process
behind some of the restrictions in Dart?
Clearly, because if you want to support programming in the lot,
it's very important for a programmer
that he can write a piece of code
and be fairly certain that it will work
against the other libraries in the project.
So certainly having a tool chain
that will check that the way you use the system is valid
is important for big programs.
So that was part of the design criteria.
And also in JavaScript,
not only properties for normal fields can be added,
but you can also change the functionality
as you go along at one time.
So for instance, if you want to swap two functions
in a library of JavaScript,
you can do that without getting notified.
But the program doesn't behave the right way.
In Dart, we have decided that libraries are declared and classes are declared.
That means that when you first stop running,
they will stay the same, functional,
from the beginning of the program execution to the end.
And that also means that you'll not get problems with conflicts.
In JavaScript,
you can have monkey patching.
And if two libraries have a monkey patching a core object,
you can get into sort of interesting behavior.
So one thing I want to bring up,
just kind of as another little aside here,
you've mentioned,
the first thing you mentioned was that
obviously it had to have curly braces
because it's impossible to have a successful language without them and you've
talked a lot about the influence small talk the small talk had on dart uh one of my co-workers
said he thinks it's reasonable to describe dart as small talk with curly braces totally before
this show in the same way that javascript is you know scheme with curly braces uh how do you feel
about that statement?
I'm honored if that's a statement because Smalltalk is one of these languages
that are very minimal and elegant.
So if he thinks we are close to that,
I'm very happy.
We try to have a very simple execution model.
We think that if you have a simple execution model,
it's much easier for the programmer to understand
what's going on when he runs the program.
For instance, if you go into a debugger
and do a single step
we want the people to be fully aware of what's going on
and by having simple semantics
like you mentioned before
that variables are staying in the scopes they are declared in
like we have clean lexical scoping,
it's much easier to understand what's going on in these cases.
And we think this is...
The more comfortable the programmer is
with the execution of a program,
the more experimentation he does and the more innovation.
And I think that makes him a better programmer,
or her a better
programmer yeah it's almost like the flexibility of javascript in some ways can prevent you from
from being too um uh too experimental because you're afraid of what of the unknown consequences
right like with dart you know exactly what you're going to get uh it's very predictable and so it's
a little bit easier to like try and experiment without worrying about you know impacting the rest of the large project you're working on
so the other flip side oh go ahead lars i just uh one short comment before seth um so um i've used
many different programming languages but one thing that's interesting with dart is that i get the
same feeling as when i program in small talk in the old days you want to make the program better so
often you you write your class and you start experimenting with it making it smaller and
denser and better that feeling as a programmer is very powerful it makes you make the program
look good and it also makes it more robust going forward so you mentioned experimenting and maybe
like features of language make it easier or harder.
This is something I think Dart's done pretty well, at least for me, and I think it's really critical for a language of the web.
That is, when you start a web project, you might have a very small little script, no type annotations, probably just some functions.
And then you hit reload in your browser, and then you see it pop up right there.
You're like, wow, that was really cool.
And then you might add another couple functions, and up right there. You're like, wow, that was really cool. And then you might add another couple of functions and you hit reload.
You're like, wow.
And before you know it, you're actually experimenting and trying out the platform
and you're building up a mini little app.
And Dart allows you to start way at that beginning where you just have some
functions and reload, but it helps you grow over time and scale up to when you're
actually ready to add some classes and then you're ready to add maybe a classes. And then you're ready to add maybe a library. And then maybe you're ready to add type annotations. And so from an experimenting
point of view, I actually find Dart easier because I can start as early as I want in that kind of
scope or scale, but I can keep going and keep going and keep going and I don't sort of collapse
under my own weight. And also due to that structure of things like classes and libraries and ultimately packages and interfaces
and all that great stuff,
the experimenting becomes even easier in the ecosystem
because I can build on top of the structure
other people build.
And so I don't need to put something out
into the community and hope it doesn't monkey patch
and sort of step over somebody else's stuff. so for experimenting i actually think dart is really really productive
awesome yeah true let me ask you a question here i'm just reading through one of your
faqs which by the way if you are listening to this show and you have any interest in dart
whatsoever go to the website and just like read through the FAQs and the different things about the language.
It's a, this is one of the best things I think Dart has done.
This is our bullet plate for the show, I think.
I mean, this FAQs list.
Yeah.
I mean, it's incredible reading through this and just being able to easily see kind of
the evolution of the language as well as like the differences.
But one of the things that I'm looking for and I haven't really been able to find,
because these have to exist, right?
There has to be some sort of gotchas
for JavaScript developers that are coming to Dart.
It can't just be all butterflies and flowers.
There has to be something here that's like,
if you typically do this in JavaScript,
this will catch you up here.
Do you know of any kind of common pitfalls or gotchas
that JavaScript developers might experience coming to Dart?
Well,
it's clear that we don't have a value.
So if you are big
on getting text
strings converted into code and executed on the
fly, I think it's a problem in Dart.
Because we have decided
to make it much more structured for
various reasons.
So that's certainly something you have to get used to.
But other than that, yeah, there doesn't seem to be a bunch,
which seems like a pretty awesome thing,
but you wonder if there is a catch, you know what I mean?
Well, we've run numerous hackathons internally to the company,
externally to the company.
We had a recent global Dart flight school program, which
we ran. And so I've seen it numerous times. People are up and running in Dart in about an hour, and
they come from all different backgrounds. And this is one of the reasons I really, really like this
project is because it is so approachable. I've seen high school students, some of their first
programming experience in these hackathons have a web page built. And I've seen people with years and years of Java, years and years of ActionScript, years
and years of JavaScript all get up and running. So at least in my experience, it's very approachable
and familiar. And there's not really a lot of those caches based on your other language because
Dart says, okay, we've learned a lot of great lessons. We're making this a familiar, approachable experience.
So let me ask you that one of the, what I believe,
is probably the best lesson that Dart learned,
and, I mean, wow, looking at the implementation here,
is querying the DOM.
And anyone who was around before jQuery knows
querying the DOM in JavaScript was an absolute nightmare. And then when jQuery came along, you were like, oh, wow, I can
query it based on these selectors. And it's like so much easier and everything makes sense.
And I look at the Dart, you know, how Dart queries the DOM. There's two succinct methods
to query the DOM. And that's all you have to worry about.
Oh, it gets even better. What is returned to you are actual iterables. And so you no longer have like array-like things or arrays.
Because of that rich core library that we have
that you get out of the box with Dart,
you've got lists and arrays and sets and maps and iterables.
And once you have that core library,
then the other libraries like the HTML library
get to use those as well.
So if you know Dart programming programming then you know web programming so i don't even know if people are going to be able to function
knowing that i mean when i start building something for the web like step one is get all
your javascript requirements and one of those is jquery like how are people going to even know how
to get started without having to go out and download the latest production build of jquery
i guess we could, yeah.
I guess skip that step.
I'm not embarrassed that it's too easy.
So I think we should mention again
that Dart has a very comprehensive basic library.
That's very cool.
We have, for asynchronous programming,
you have futures and streams.
That's a very consistent way of doing asynchronous programming.
And we have all these collection types
that really fit well together.
So I think if people are used to a programming language
where you have a good set of libraries,
like if you come from Java or C Sharp,
Dart is actually very interesting to look at for web programming.
And because of the fact that, yeah, these futures,
which are sort of like promises in a sense in JavaScript,
are baked into the core platform,
all the other packages out in the Dart ecosystem
use all these same core primitives. are baked into the core platform, all the other packages out in the Dart ecosystem use
all these same core primitives.
So there's no more like, which one of these do I use?
Just everyone uses futures for the one-shot callbacks and streams for the repeating callbacks.
And it just propagates the ecosystem.
And it's just another one of those decision points that the community doesn't have to
debate and developers don't need to reinvent.
So everyone can kind of take a step up in terms of what they get to work on and contribute back.
And it's just it's helped everyone be so much more productive.
Let's pause the show for just a minute and give a shout out to our sponsors, New Relic.
If you've got a web or mobile application, you need to know about New Relic.
It's your new best friend, basically. It's your easy-to-use analytics dashboard that basically gives you powerful code-level visibility into the real-time performance of your application.
So this means that you can spot bugs, see bottlenecks, and fix problems fast, hopefully before they even affect your users.
And thanks to New Relic, you no longer have to ship your app to production and then helplessly wait around, hoping for the best until negative app reviews and tweets start to roll in.
New Relic empowers you to see what's going on and what is working and what isn't working all in real time.
And the way it works is really straightforward.
They give you a lightweight agent that you unpackage into your production level apps. That agent sits around quietly and securely in the background,
kind of gathering real-time metrics across geographies, devices,
platforms, all the way down to the end user level,
and then displays all that data in real-time graphs.
So coders can have the visibility they need into the performance of their web
applications and make everything awesome.
So go and check out New Relic today by visiting newrelic.com slash the changelog to learn
more and use the offer code the changelog and take advantage of this special 30-day
extended free pro trial available exclusively to our listeners.
Newrelic.com slash the changelog.
So I think there are like some obvious questions that people will probably have.
One of them is, is what does Google use Dart on right now that you can kind of share with
us?
Sure.
We have an internal sales tool that this, this is a great story.
It's sort of like the Widowmaker project in a sense that they've tried to rebuild this
system a bunch of times.
And you know legacy software, right?
There's a bunch of decisions made.
And they tried to rebuild it, rebuild it.
And then recently they did a full rewrite in Dart and Angular Dart and delivered the project on time and blew away everyone's expectations.
And now that's a successful deployment. We also have other apps like Google Elections has a really neat app to help track elections around the world,
and numerous other internal tools that we're not quite ready to share yet,
but there's a page on our site called Who Uses Dart that references some internal and a bunch of external as well.
Awesome. So there are some external.
Can you kind of allude to some of those
without having to go to the site here?
Oh, sure.
So one of my favorite is this company called Soundtrap.
And what I really like about them is not only do they use Dart,
but they also use some of the really cool new HTML5 features
like WebRTC, which is real-time collaborative communication,
and some of the media stuff
like get user media and audio and video. So they built a collaborative music authoring app
with Dart and WebRTC. So it's such a cool thing. Another great story is a startup called Blossom.
And I like their story because they were originally on JavaScript and, let's see, Backbone.
And they, over time, gradually, their users didn't even know it, started swapping out some of their components for Dart components.
And so that was really cool to show that, yes, you can take an existing JavaScript app, and if you like what Dart has to offer, you don't need to rewrite the whole thing.
You can do it piecemeal.
Awesome. So, yeah, I mean, yeah, I don't have much to say to that
other than the fact that this is obviously something
that is going to continue going in that direction.
And I think that that's a good thing.
So just to, even though we are from Google,
our only objective with this project here
is to make people more efficient at doing web applications
so everything is open and we are very receptive to to feedback so we can make it better so if
people are trying it out and they have problems in an area we would like to hear the feedback so
we can make the system solve that problem one thing i notice here is that similar to Go, you don't actually see any Google brand on the Dart website.
That's obviously on purpose, correct?
That's right. It's an open source project. It's for the web. The spec itself is in the ECMA process now.
It's no secret that Googlers work on the project, but like a lot of other successful projects for the web, it really is for and of the community. So the, the million dollar question,
and we kind of talked about this a little bit before. Um, but, but how do you know that you've,
for lack of a better term, how do you know that you've won with Dart? Like when do you feel like,
okay, you've gotten to a point where dart is is here to stay
when every developer is building for the modern web on mobile devices
and uh i don't think we can get there without something toolable and productive like dart
so um yeah that's a good answer but this is. So it bottoms out to that we will continue to innovate
to make sure the web platform gets better and better over time.
Getting success with a programming language is hard
because people have to like it.
They have to like the feel of it when they type in the code.
At this point, it looks really good.
The projects we've seen working working with dart
they like it and it's growing right now the community both inside our company and also
outside so we have been around we've been working on this for three years success
is coming i think it looks pretty good if we have the same growth over the next two years i would be really really
happy because just having the competition going means that even other web programming language
they will might learn something from what we did in dart and that will lift the whole industry
hopefully so it's certainly an idea that we can we can make everything better not only the dart
system yeah you get the feeling that that one of the goals of Dart
is not just to catch up and be where web programming is now,
but one of the goals of Dart is to move web development forward.
And I think that's a pretty good, ambitious,
but also one that's necessary here.
I don't know if we should go back and talk about V8,
but that's sort of the same with the V8 project.
When we started out, there was not a lot of JavaScript code being executed because it
was very slow.
And you basically have to look into the future and figure out what do people want in the
future when it comes to executing JavaScript.
And we decided that the more speed you have, the more innovation the application developers would go for.
And that's also what happened.
And in the process, all the other browsers got fast JavaScript engines as well.
And I think that's great.
Yeah.
That's one of the things about, I don't know, about JavaScript, about the current state of browsers right now,
is you'll see these ships of browsers and it'll be like some JavaScript efficiency, some performance increase.
But that kind of almost feels like it's plateauing to a degree where the major, like you said,
the benefits you got when V8 started coming and things like that were much bigger gains than the ones you're seeing right now um does dart follow that same trend or or you know obviously dart is
young so there's a lot of performance increase to come in the future but but you're not plateauing
now or they are from ship to ship are they are they major efficiency increases that you're seeing
that is getting faster and faster with each release we're doing,
and we are focusing on it.
And because Dart is more structured than, as we mentioned, with JavaScript,
you would see that over time that Dart will get the same kind of performance as Java, basically,
except for if you're doing hardcore double computation yeah but that's not our goal
but for ordinary object-oriented programs we should approach that kind of speed so we're aiming
high but you'll see performance improvements over at least the next few years. Yeah. No plateauing in sight.
Yeah.
You heard it here first.
We're going to have a web development
that is as fast
as system programming.
That's a good thing.
So speaking about performance,
the last release we had,
1.3,
really focused on
server-side performance.
One of the questions
we get all the time is,
is there a node for Dart?
I think developers like what they see, but they know they have to write some server code and client code and
so they want to know can they do dart on the server and so the answers are resounding definitely
we the virtual machine runs on the command line uh just like you know ruby or python or or v8
and you can get access to files and directories so sockets. There's a built-in web server, built-in web sockets, SSL.
And we've recently turned our performance attention
over to the server-side story as well.
So the story is looking really good.
Awesome.
Oh, yeah.
Since it's a language project,
we also have to say that our internal tools
are mostly written in Dart.
So the Dart to JS compiler is, of course, written in Dart
and also the analyzer.
Nice. So for people that are just getting started, what's the recommended way to do
just that, to get started with Dart?
On the website, there is a one-hour code lab called TryDart and you build up your pirate
name. But it's really great. It walks you through the features
of the language. It walks you through some web programming. And yeah, in just about an hour,
you're going to have a working Dart app. So the website is dartlang.org.
Okay. Awesome. I think obviously, I mean, it's an entire ecosystem. It's not just a language.
We can sit here and talk about it for a long time. And I would love to do just that. But we try and keep the show down to about an hour. So I have a feeling that this is going to be one that we're going to want to have another show on in the future to see where it goes. But for now, I want to give you guys an opportunity. Anything else that you want to kind of mention about Dart for the people to hear before we move on?
Well,
we hope that people try it out and give us their opinion.
And hopefully it's a good one.
That's pretty much
it. We'll continue to work hard on making
it better over time.
So that's pretty much it. I think
it's very hard to convince people to use another language over the radio.
People have to try it out and have to feel the programming to figure out if it's something
they can be productive in.
So it's a very personal kind of decision.
What's the recommended way to give feedback?
Is it through the mailing lists?
You can file an issue on the issue tracker,
or you can send an email to the mailing list.
They'll be answered.
I'd love to ask all developers who are interested in Dart to go check out pub.dartlang.org.
That's our hosting site for packages,
and you'll find tons of great stuff in there from the community.
And when you're billing for the web, don't forget that the trends are very clear, that everyone's moving to mobile.
I know I sound like a broken record here, but if I have to tell anyone anything, it's develop and test on mobile phones and tablets for your great web stuff because that's where your users are, and we think Dart can help you do that.
Awesome.
So, okay, great.
So we ask our guests the same set of questions at the end of every show,
and I want to go ahead and ask you all these questions.
So I'll ask Lars first, and you kind of both answered this first one already,
but just in case there's anything else.
Do you have, like, a call to arms for the community?
Yes.
My call to arms is that innovation is important
and programmers have to be flexible and try out new stuff to see if they're more efficient using
a different platform there than they used in the past so try out that and and see if it's more
efficient and seth anything from you other than uh building mobile stuff i'll be really specific
about it in dev tools you can turn on mobile emulation.
So my call to arms is when you develop on your desktop and you're in Chrome or DevTools,
turn on mobile emulation and just always live with that little window there.
Gotcha.
The second question here is if you weren't doing this, what would you be doing?
And I'll ask you first, Seth.
Probably doing something around education or teaching.
I'm really inspired by the MOOC, the online classes and courseware stuff.
And so I don't know.
I think that would be pretty interesting.
Gotcha.
And for you, Lars?
Oh, I need more spare time.
I would travel the world on a bike. Well, you can only I would travel the world on a bike.
Well, you can't only travel part of the world on a bike.
You got to get on a plane at some point or a boat.
That is true, but half a year on a bike would be great for me.
But I always have, so I've tried it before and it never works.
So if I don't do that that I would probably do another language
or VM project.
Nice.
And Lars, for a programmer hero
or just somebody that's been hugely influential
in your life?
I have to mention my old professor
Ole Lehmann-Massen.
He was the co-designer
of the beta programming language,
a successor to similar 67, if you remember that.
He has been very inspirational in pushing me to do languages
and virtual machine implementation all the way back in the mid-'80s.
So he's probably the main reason why I'm doing it still.
That's awesome.
Seth?
I got to say, Neil deGrasse Tyson, a scientist and educator, is just really inspiring to me
because that's someone who clearly knows what he's doing and talking about,
but is so passionate and inspirational with how he delivers that stuff to the world.
So I really enjoy watching him.
I've actually been waiting for the day for somebody to mention him as their hero
because he's been a personal hero for many that I've known,
and he's with a new show recently.
Obviously it's really good, so people are really enjoying his method of teaching.
He kind of comes from his own predecessor too.
Yep.
Nobody said anything to that.
Nope. No love to that. No.
No love for Adam.
No love for Adam. I've been listening to this show. I mean, this is one of those shows where I wanted to kind of jump in, but I feel like I don't add a ton. I wanted to kind of dig in a bit more about the Pub Package Manager, but we can save that for a different show, I'm sure.
Yeah. Yeah. So anything else you guys want to mention here before we go ahead and close out the show
just thanks for
inviting us
we need to get everybody to listen
in on what that is all about so
we are just happy to be here
yeah I really appreciate the opportunity
I remember the changelog
is always one of those podcasts that is
on the top of my queue and for a long
time now so it's kind of an podcasts that is at the top of my queue and for a long time now.
So it's kind of an honor to be on the show.
So thanks.
Well, it's an honor to have you guys.
So I just wanted to.
Absolutely.
Yeah.
So I wanted to once again just say thanks to Lars and Seth for joining us on today's show.
Like we kind of alluded to, Dart is a big project.
And it's hard to do any project the size of Dart, you know,
justice in a 45-minute to an hour radio show.
So I just want to encourage, just like they were saying,
to encourage anyone, if you're interested in this whatsoever,
just head over to the website.
It speaks for itself, and it's something that you can just start
hacking on in your own time and really, I mean,
just with the small amount of time I've spent on it
just to kind of learn it and stuff. It's been a, it's been a pleasant experience, something worth checking out,
worth hacking on. I think it's definitely something we will want to consider talking
about more on this show in the future. But once again, I just wanted to say thanks a bunch for
joining us. And that's it for this week. Just for the listeners, if you have not subscribed to the
ChangeLog Weekly,
it is our weekly email where we share everything that hits our open source radar.
You can subscribe at thechangelog.com slash weekly.
And we will be back next week.
I don't think we know the guest yet, Adam, so we will save that as a super secret surprise.
Yes, you're right.
Yeah, yeah.
So until next week, though, let's say goodbye.
All right.
Bye-bye.
Thank you.
Bye. We'll see you next time.