>> I'm Lachie.
>> I'm Oliver.
>> This is the Open Source Show.
[MUSIC]
>> I'm Lachie Evenson,
a PM at Azure.
>> I'm Oliver Gould, one of the creators of Linkerd.
>> Oliver, why is it now that Rust is hot?
>> Rust has really taken traction over
the past few years because it's hit a maturity point.
We had actually looked at it several years ago,
three or four years ago,
before it hit 1.0, and it was changing so rapidly.
There was no way to build a website in it for instance,
it was all very primitive.
Fast-forward a couple years,
we have rich ecosystems of production-ready
libraries and crates that we can
actually start building real applications with.
On top of that, we keep seeing big security issues driving
more and more security intensive code
into higher-level languages like Rust.
>> So who are the type of developers that
would naturally gravitate towards a language like Rust?
>> Now, I've seen a lot of systems programmers,
a lot of game developers where they care about performance,
but don't want to necessarily be writing games in C++ anymore.
Also, a lot of Edge and IoT applications,
we see embedded being a real motivator for Rust.
>> Do you think the problem's folks are
trying to solve with things like microservices,
or application development in the Cloud has lead folks to Rust?
>> Where you need really fine-grained controls in IoT devices,
Rust is becoming a really appealing solution.
>> What I'm hearing is Rust gives you a safety net.
Tell me what that actually means?
>> What that means is that, we put all the cost in the compiler.
>> Okay.
>> So I've been writing a lot of Go recently,
and with Go the compiler doesn't
do a whole lot, so it's very fast.
But that means when I run the program,
I get NullPointerExceptions,
and have runtime errors.
Rust changes that and says,
we'll make the type system smart enough to find
all of those runtime bugs in the compiler,
and so I spent a lot more time waiting for my code to compile,
but once it compiles I'm pretty sure it's going to work right.
>> So in Linkerd specifically the data plan is written in Rust.
>> We chose to write the data plane,
the proxy in Rust,
so it's very high performance and small, lightweight.
But then we chose to write the rest of the application so that's
several web services and CLI and things like that in Go.
We chose that because we thought there would be
a larger library ecosystem, integrations
that already are available for Go,
and may also a bit easier for folks to just come into
and be productive on day
zero without having to spend a lot of time learning.
>> Then what was it about Rust that led you to make that decision?
>> We chose to use Rust one for correctness.
>> Okay.
>> Having a very good type system in the language,
means that I can be pretty sure my code's correct at compile time.
Two, we did it for performance,
and so we had been in the JVM before,
and with that comes lots of memory overhead and
a garbage collector that's going to do things whenever it wants,
and Rust has none of that.
The compiler is the garbage collector,
and so we get rid of a huge class
of real production issues by moving to Rust.
>> I hear speed and safety,
is there anything else that makes Rust really so compelling?
>> It's community.
>> Community.
>> The community has been really excellent to work with.
>> That sounds like a great ecosystem.
Do you know much about the heritage of Rust?
>> Mozilla has been really the driving factor behind
Rust over the past several years and it's
actually being used in Firefox today,
and it moved over big parts of the rendering engine onto Rust.
But now some startups like Buoyant are as well.
>> Okay. So you mentioned you've tried
several years ago to implement in Rust and
it wasn't the right time when you had difficulty,
what has changed between then and now?
>> Maturity, right?
So before the ecosystem just wasn't there.
If I wanted to build a network application,
it would have been a lot of manual things
that I have to build to do that.
Fast-forward a few years, we took a look
back at the ecosystem and we saw Tokio,
which is similar to Netty is an asynchronous networking framework.
Hyper which is a HTTP library that uses that,
and Tower which is a service framework like Finagle.
Seeing all the investments actually going into this,
other companies are investing in this and it
seems like the right time to be planning for the future there.
>> What are some open-source projects
that I could go look at that are using Rust?
>> So I know Microsoft IoT Edge,
which is actually doing a lot with Rust in the open source.
We at Buoyant are doing Linkerd,
and I have a whole bunch of open source libraries around that.
>> I'd like to hone in on your journey with Rust.
What was the experience like writing your first app in Rust?
>> Yes, so I was coming from the Scala/Java World.
I'd written a bunch in Go as well,
and then I came to Rust,
and it would not bend to my will.
I wanted to make Rust work like those other languages
I used, and I tried to write object-oriented programming in Rust,
and I had a really hard time getting
started because Rust's programming model pushes
you to think about problems differently and changes the way you
design your programs to lead to more performance systems,
and so it's actually,
it took me about a year to be really proficient in Rust.
I think that time is getting better
now as the ecosystem gets better.
For me, the biggest breakthrough I had was when I
used to think of programs as execution flowing,
and thinking about the CPU, and what the CPU is doing.
As I moved to Rust I started
thinking a lot more about the memory,
and how data was laid out in
memory and how the execution flowed and
ownership of different parts of memory is given to
different parts of the application at runtime.
So that's a really profound but subtle difference,
and flipping that over took some time for me to break through.
>> What are some snippets that you would like to share,
the top three things when getting
started with Rust that you think are compelling to know?
>> Okay. One, it's not Scala.
It's not whatever language you came from,
it's its own thing and you're
really going to have to take the time to learn it
and give yourself the space to be a
little frustrated with it and work through it.
Two, it can feel slower because of that.
The development speed can be a little slower because you
spend more time getting the compiler right,
and less time finding bugs once it compiles,
and so that can be a change in how
you value satisfaction in your work.
>> Right.
>> It was tough for me at first.
Three, again I would find that support community.
Some folks who have done this well and are doing this,
who have code they can share with me that already works,
and the more code I've been able to
read the much better I've been at writing.
>> Fantastic. If I wanted to get
started with Rust, what would I do?
>> The Rust website, rust-lang.org
is a great place to get involved.
Lots of documentation, there's a book there,
there's playgrounds, you can go start
typing code on the browser and get started.
They also have a lot of
online chat areas where people are super helpful,
and so I'd find a project that was interesting to me.
I got involved with Hyper and Tokio,
and their communities were both really helpful for
me getting from zero to moving.
It's really a good place to get started.
>> Fantastic. So if I wanted to learn more about Linkerd,
where would I actually go to do that?
>> Linkerd on GitHub is the best place for you to get started.
>> Okay.
>> We have lots of documentation there,
there's a proxy where you can get
involved with and a whole bunch in there.
>> Fantastic. So thank you for sharing your knowledge.
All the links that Oliver suggested,
all will be in the description,
or you can go to opensource.Microsoft.com for more information.
If you loved this episode,
give it a like and subscribe to the channel.
Thanks for joining us on The Open Source Show.
[MUSIC].