[MUSIC PLAYING]
LAURENCE MORONEY: Welcome to the Googleplex.
This is an incredible place with lots of great stuff being
worked on every single day.
Before I worked here, I always wondered
what it be like to come to the Googleplex,
meet up with a Googler, and have coffee with them,
and just chat about what they do, how they do it
and why they do it.
And today, we're going to do exactly that.
So welcome to this episode of "Coffee With A Googler."
Today, I'm meeting with Francesc Campoy.
He's a developer advocate on the Google Cloud platform,
and he specializes in the language called Go.
So welcome, Francesc.
Thanks for joining us.
FRANCESC CAMPOY: Oh, thank you for having me.
I'm very happy.
It's an honor to be here.
LAURENCE MORONEY: Oh, thank you so much.
So, Go.
What's so special about Go?
FRANCESC CAMPOY: So Go is a primary language
that was created five years ago here at Google.
It was created with the main goal
of solving Google problems.
The most important thing when you--
the most important word that comes to mind when you think
about Google is, of course--
LAURENCE MORONEY: Scale, right, yes.
FRANCESC CAMPOY: Scale.
There you go.
So, it's basically scale in three different axes
of the same problem that we have.
One of them is how many engineers or developers
do you have per project?
And Google is pretty well known to have really--
a really big number of engineers.
LAURENCE MORONEY: Right.
FRANCESC CAMPOY: If those engineers
are using a primary language that
doesn't help them interact with each other, share a code,
be able to read and understand what the other wrote,
that's a big problem.
LAURENCE MORONEY: I see.
FRANCESC CAMPOY: So Go concentrates a lot
on keeping it really simple, having very good readability.
So even if you might not have read a single line of Go code
ever in your life, you might find a Go program
and find it surprisingly familiar, actually.
LAURENCE MORONEY: So it's not like C++ in that regard.
FRANCESC CAMPOY: Uhh, not exactly, yes.
That's actually-- C++ is the language that we still use
mostly for servers.
LAURENCE MORONEY: Right.
FRANCESC CAMPOY: So Go was supposed to replace C++.
LAURENCE MORONEY: Ah.
FRANCESC CAMPOY: That didn't really happen yet.
It actually surprisingly came-- most people coming to Go
are coming from other languages like Python and Ruby,
because they like the simplicity of the language.
LAURENCE MORONEY: Cool.
Cool.
FRANCESC CAMPOY: The second axis of scale for these problems
is the number of cores we have in a single machine.
Nowadays, for instance, you can check on the Google cloud
platform.
We provide instances that have 32 cores.
LAURENCE MORONEY: Wow.
FRANCESC CAMPOY: If you have 32 cores
and you are not able to use them correctly
because your primary language doesn't support concurrency
or a parallelism, you're wasting money, basically.
LAURENCE MORONEY: Sure.
FRANCESC CAMPOY: So it's really important.
Concurrency is a fundamental part of Go.
And finally, the number of machines we're running.
Everything now is about the cloud.
The cloud is about running across a big fleet of machines.
You need to be able to communicate correctly
between different machines.
But these, we have been doing it at Google for ages, basically.
LAURENCE MORONEY: Yeah, yeah.
It's in your DNA, right?
FRANCESC CAMPOY: Yeah.
So Go was created from the beginning keeping
all of those aspects in mind.
LAURENCE MORONEY: OK.
Now, Go recently had a new release dropped, right?
Was it 1.4?
FRANCESC CAMPOY: Yeah, it was 1.4, yeah.
LAURENCE MORONEY: OK.
What's in this?
FRANCESC CAMPOY: So in Go 1.4, there
was not much new from the point of view
of features of the language.
LAURENCE MORONEY: OK.
FRANCESC CAMPOY: It was more about improving things.
One of the things that we improved
was having a better garbage collector.
We keep on doing that every single time.
That's one of the topics of research
that we're actually working on very, very closely.
LAURENCE MORONEY: OK.
FRANCESC CAMPOY: Then some small features.
One of the small features that was not really important
at that point but will become way more important on 1.5
is the support for Android.
LAURENCE MORONEY: Android.
FRANCESC CAMPOY: Yes.
We gave some basic support for Android, and with Go 1.5,
the support for Android will be much more important.
LAURENCE MORONEY: So what kind of Android apps
can you build with Go right now?
FRANCESC CAMPOY: The idea is that we
don't want to replace Java.
Java is the language of Android, and we're totally OK with that.
What we're trying to do is replace all the languages
that people have been using to, for instance,
write games, where basically, you're not depending
that much on the UI of Android.
You're basically writing everything from scratch.
Your buttons don't need to look like Android buttons,
for instance.
LAURENCE MORONEY: Right.
FRANCESC CAMPOY: In those cases, basically what you
need is to be able to open and close connections and files
and then basically write into the screen and play some music.
All of those are actually powered,
not of the SDK of Android, but the NDK.
LAURENCE MORONEY: Got it.
FRANCESC CAMPOY: That's what we're supporting.
With Go 1.5, we will give support for Android,
the NDK only.
And the good thing about this is that what we're doing
is we created this Go mobile thing.
Go Mobile is just a layer of abstraction between your Go
program and the Android behind.
LAURENCE MORONEY: OK.
FRANCESC CAMPOY: Now, the cool thing
is that that Go Mobile layer abstraction
has been designed with multiple platforms in mind.
LAURENCE MORONEY: Cool.
FRANCESC CAMPOY: So we're also working on iOS.
LAURENCE MORONEY: Cool.
FRANCESC CAMPOY: And very soon we
expect to be able to say, you can write your app just in Go
and deploy it at the same time, both on the Apple Store
and on the Play Store by Google.
LAURENCE MORONEY: Nice, nice.
Cool.
FRANCESC CAMPOY: Pretty excited about that.
LAURENCE MORONEY: Yeah.
Now, you said that a lot of that's coming in 1.5.
FRANCESC CAMPOY: Yes, that's-- by now,
we're able to run things on Android.
That has been, actually, the case
for a little bit, because Go is compiled in a lot of platforms.
ARM is one of those, so you would be able to run it.
But the possibility of contacting-- of using the NDK
and being able to use OpenGL and these kinds of things
on Android, that will come with Go 1.5.
LAURENCE MORONEY: Cool.
So it runs on Android, and you mentioned earlier
on that runs in the cloud.
But the cloud is so diverse.
There must be lots of great scenarios,
like, where else is Go making good stuff happen?
FRANCESC CAMPOY: Yeah, so there's actually
so many new projects that are using Go.
One of the ones that everybody's talking about is Docker.
LAURENCE MORONEY: OK.
FRANCESC CAMPOY: Everybody knows--
LAURENCE MORONEY: So Docker uses Go?
FRANCESC CAMPOY: Yes.
Nobody knows that Docker's bringing Go--
LAURENCE MORONEY: I didn't know that.
FRANCESC CAMPOY: --but it is.
Yeah, it is bringing Go.
There's also all the things that Cooper Net is--
Cooper Net is also bringing Go, so Cooper Net is just basically
like the open-sourced version of how
Google manages data centers.
LAURENCE MORONEY: Right.
FRANCESC CAMPOY: There's so many other more.
Corel has, for instance, new Linux distribution.
They also use Go.
And I think that the main reason for this
is that because on the cloud, you need two things.
One is you need to use very well your machines,
so concurrency is important.
And then again, you need to use the network very well.
So the networking package that we have on Google
works really well.
So it's a little bit of both.
Then the last thing that I think is very important
is that we provide multi-platform compilation
and also cross-platform, which means
that I can compile an exit binary for Windows
from my Linux machine.
LAURENCE MORONEY: Wow.
FRANCESC CAMPOY: Yeah.
Basically it allows it to work in whatever environment
you want, and then deploy it to the cloud, whatever cloud is
using, which is a great thing.
LAURENCE MORONEY: Yeah, that's pretty cool.
So if a developer wants to get started with this,
there's so much diversity there, right?
So if a developer wants to start programming in Go so that they
can reach that diversity, how would you
recommend they get started?
FRANCESC CAMPOY: Well, I think that the most important web
page to remember is golang.org, which is the Go home page.
Then from there, you're going to find
a variety of resources, documentation, tutorials
and so on.
And there is a specific tutorial that is really important.
It's very successful.
It's Go tour.
LAURENCE MORONEY: Go tour.
FRANCESC CAMPOY: The Go tour.
So that's in tour.golang.org.
LAURENCE MORONEY: Tour.golang.org, OK.
FRANCESC CAMPOY: Yes.
LAURENCE MORONEY: OK, I'll have to remember that one.
FRANCESC CAMPOY: Yeah.
That allows you to learn Go without having
to install anything.
So basically, you get to a web page
and you're going to be able to see some instruction
on the side, some Go code on the other side
that you can edit and run and just play with the language
and understand the basics without having to install
anything on your computer.
LAURENCE MORONEY: That's pretty cool.
Great way to learn.
FRANCESC CAMPOY: Yeah, I think that's the best
way to learn without having to engage into anything.
Just go there, try it.
If you like it, that's awesome.
If you don't like it, well, let us know.
LAURENCE MORONEY: OK, showing how we can improve it.
FRANCESC CAMPOY: Yes.
LAURENCE MORONEY: Well, thank you so much, Francesc.
And thank you for watching this episode of "Coffee
With A Googler."
I've learned so much about Go, and I hope you have, too.
So if you want to learn more about Google and about Go,
subscribe to the Google Developers YouTube channel
where we've got lots of great videos.
And if you've any questions for me
or any questions for Francesc, just
please leave them in the comments below.
Thanks for watching.
[MUSIC PLAYING]