Software Huddle - All about Rust with Tim McNamara
Episode Date: April 16, 2024In today's episode with Tim McNamara, we talk all about Rust. Tim is one of the leading educators in the whole Rust educational space. He wrote the Rust in Action book, which is probably the best Rust... book out there. He has a YouTube channel, he taught and did a lot of educational work on Rust at Amazon AWS. We talked about object ownership and object lifetimes and just all these interesting things that Rust has and why is this language loved by so many and why it's continuing to grow. He also gets into what it's like being an independent educator, creator, and some of the difficulties with that, how to get started, and how he deals with doubt.
Transcript
Discussion (0)
Like Rust enables, let's say, ordinary programmers like myself
to write extremely high performance code
that runs extremely efficiently.
Do you like the small standard library?
How do you sort of come down on that?
I don't like the small standard library.
It's showing Rust's heritage as the system's programming language.
And compared to its peer there which would be c
rust is a very rich standard library what sort of advice would you give folks that want to go
in this sort of maybe like education training consulting coaching type thing any advice you
have from them that you've picked up over the last year and five or six years as well. You need to start today.
And that doesn't mean start big.
It means start really, really small
because your success will compound.
And the compounding effect
is going to be much more important
than your current velocity.
Hey folks, this is Alex. And today's episode is with Tim McNamara. And we talk all about Rust, which is great because, you know, Tim is like
one of the leading educators in the whole Rust educational space. He wrote the Rust in Action
book, which is probably the best Rust book out there. If you want to learn Rust, he has a YouTube
channel, you know, he taught him and did a lot of education of Rust at Amazon, AWS,
and things like that. So this was great for me because I have more of a Python, JavaScript-type
background, not a lot of systems languages, but he taught me all about object ownership and
object lifetimes and just all these interesting things that Rust has and why it is this loved
language by so many and why it's continuing to grow. He also gets into what it's like being
an independent educator, creator, and, you know, some of the difficulties with that, how to get
started, like what, you know, supercharged his whole path and how he deals with doubt. And I
just like empathize with a lot of what he said. I thought it was good advice if you want to go down
that path. So check that out. If you have any, you know, questions, comments, guests, you want to see
anything like that, reach out to me or Sean. And with that, let's get to the show.
Tim, welcome to the show. Hey, thanks, Alex. Yeah, absolutely. So I'm excited today to talk
about Rust, which is just one of those languages that it's somehow been popular for like 10 years.
And it's still like the cool plate on the block, even even though it's been around now,
usually it's sort of ebbs and flows and something new comes. But for whatever reason,
Russ has just stayed popular. And you are the author of Russ in Action and probably like the
number one person people think of for like Russ education and that sort of thing and learning
Russ. So maybe just give, you know, listeners a little bit more about about who you are and
your background. Yeah. Hey, thanks.
It's interesting to hear how other people perceive Rust, right?
So I've started my own little training organization, a little company that it's little at the moment,
but it's actually growing.
We deliver training and consulting around the world.
And people can find me on timclicks.dev.
So you'll typically find me on timclicks. If you search, you'll find me.
The interesting thing about Rust from my point of view
is that its rate of growth is actually increasing.
So if you want to be in the top 50th percentile
in terms of experience as a Rust programmer,
you just need to wait nine months
like that's the doubling rate and that has been the doubling rate since like 2014 yeah it's like
quite amazing to see that and you see like um you know i talked about being the cool kid on the box
but it's been like the most loved programming language on stack overflow for like eight or
nine years in a row which is just like so weird because usually it's like these niche languages
that that like once they start growing and people are like get a little more mixed on but it's just like it's still continuing
to be most loved and now we have you know the white house coming out and saying everyone should
be writing rust or something something to that effect so yeah yes so like eventually rust so
it's going to be a newsworthy event when rust is eclipsed like that's crazy like that itself is a signal right like it's like
someone finally like a zig came along and like knocked rust off and you know what
i bet rust would still be in like the top five like that's still
for like a while and the thing about this most loved uh is and they've changed the wording to most admired in the most recent survey.
So if you're not familiar, this is the idea that if you ask, let's say, tens of thousands
of developers, what do you program in?
And some subset of that say, I program in Rust.
And then you say, okay, well, given the language that you currently program in, how much do
you want to program in that language next year?
And Rust has the highest proportion of people that want to stick with it.
Whereas, say, let's say Java, you know, Java is fine.
But there's not a lot of people saying, you know what, I really want to be a Java job up in next year.
It's like, that's what I really want to get into.
And I mean, it's interesting that Rust has a vibrancy to it.
And I think that comes from some of its descriptions of the way that it speaks about itself.
It is an inclusive language. It is an inclusive language.
It is an inclusive community.
It's, in fact, we'll actually talk about some of the controversy that has come out of Rust probably at some point because there has been a bunch, although I think that's settled down over the last 12 months or so.
Rust, if you go on the website, you see we're there to empower.
And that idea that a programming language is there to support you and your goals and to be a coach, to guide you along, is really important.
Whereas a lot of other programming languages are saying, I'm neutral.
I'm just a tool.
You can pick me up and you can put me down.
Whereas Rust is saying,
no, in order to use this language,
we recognize that there's a mental burden attached.
You need to actually do a lot of hard work
in order to get a payoff essentially
but we're there to support you and um being
someone who likes to teach the language like i i find myself consistent i find myself apologizing
for the language probably too much um because rust has this really interesting trade-off
and i'm yeah so i'm not a neutral observer here okay like let's let's but and so the
people will say oh look rust is hard to learn but what i think i'm i think that's what a more
accurate statement might be computing is difficult.
And Rust gives you that complexity as part of its approach.
So the downside with Rust, you get things like ultimate performance, memory safety,
some of these attributes that the whole programming industry has not been able to have for decades and the downside is that some of that in fact quite a lot of that complexity is pushed to you as the developer i was gonna say it's interesting
you see that trade-off in so many places across programming and it's just like you know different
strokes for different folks but you see that in like certain programming language you know like
i say ruby just like hides everything from you and just sort of goes and works.
In that same class of languages, Python is a little more explicit.
It's not going to be forcing you to think about memory as much as Rust and things like that.
But just in that sense, making things more explicit.
Same thing with databases.
Certain databases hide more from you.
Certain ones make tradeoffs more explicit.
Web frameworks, all sorts of things like that.
So it's interesting.
That tradeoff sort of just persists. And Rust is, you're saying at that end of just saying, hey, we're going to make everything obvious to you and clear to you,
even if it means you have to do more thinking or more work up front.
You know, ideally, there's some sort of long-term benefits to that.
Yeah. So the cost of zero-cost abstractions.
So zero-cost abstractions is a term that kind of
originated in C++. The idea that if you want to use a language feature, you're actually not going
to incur any runtime cost. This was brought into the Rust kind of ethos when it was very heavily
adopted by Mozilla to develop the browser that would hopefully compete against
Chrome. So that was kind of the origin story of the language, this idea that we need to provide
zero cost abstractions, but the cost of that is cognitive complexity or cognitive overload.
And like most embarrassingly for Rust is that this comes out with string handling.
And it's a very valid joke
that Rust has 10 different ways to represent text.
And this is exposed to you.
It's ridiculous.
But the thing is that,
at least it seems ridiculous until you think, well, actually, there are 10 ways to represent text.
And Rust has a preference for safety. For example, on a file system, you want your type system to treat the path separator, like the slashes or backslashes or forward slashes, depending on operating system, to be handled differently.
Because you don't want to make a mistake of like accidentally, weirdly deleting things.
And Rust does that in the type system as part of its standard library.
But the downside is that you just kind of have this like menagerie of different types to choose from.
And yeah.
Is that hard?
Like other than the sort of beginner cost of sort of learning those different types, is that like once you've sort of got the the model then it's fairly easy to get that or do you even find yourself like like switching
to be like you know what now i've i've didn't used to use this sort of text type and now i actually
have this new preference i have new appreciation for it or is that pretty settled and clear
for me to answer your question it's not difficult anymore like i actually really appreciate that rust does some things that are different than
other languages i was a go developer for about a year and a half i worked at a company called
canonical they make the ubuntu operating system they're a big go shop and they the one thing that
really irritated me about go was that the zero value of a type and for strings
that's the empty string is treated as equivalent as there being a missing value like there's no
real distinction between the zero the new the number zero and like a uh uh and and undefined or between the empty string and no string at all like essentially yeah
undefined and or null right rust uh makes this very explore like actually makes you choose
it actually requires you to define your type as optional and say this string might not be present.
And in terms of the big thing that took me a long time to get,
a huge amount of time really,
was this distinction between what Rust calls the...
It's actually not Rust terminology,
but again, Rust was late to the programming language spaces
and so he has used terminology from other places between like an owned string or like an owned type
and what it calls a borrowed type and it's like oh no i need to use i i just want to code i don't
really want to like programming language theory like get out of my it's like just let me let me
like code my web app and so so allow me to try and explain
ownership and borrowing in like 12 seconds yeah perfect this is gonna be great because yeah i do
not have a background in this and that's why i always hear the borrow checker and borrowing and
ownership and okay this is great own strength full it's under your control you set it up like
essentially you could you initialize the thing like i like um and i am
responsible for deletion a borrowed type means that responsibility for cleaning up like deletion
lives somewhere else so imagine you know we're setting up a database and i have you know students and
professors right because we're like we're setting up a university booking system for rooms or
something uh that's a hard we have some students we're, in classrooms. Now, if they...
And classrooms can hold references to students, let's say, right?
And what we don't want to do is delete the classrooms
while there are sort of students present.
We kind of don't want to create orphans
the type system won't allow you to create orphaned data essentially every single reference that you
have which means that if i rely if i refer back to the string which is my name that and i didn't create the string initially
i can't try and delete it um because it still might be accessed somewhere else rust will guarantee
that that name will persist for as long as it needs to live for the entire program for across threads at compile time so you actually get
some really nice properties from that there is no null in rust you can't have a null pointer
exception if you've ever used java or um and like things can't be undefined it just doesn't exist in the
language and i know that there are going to be people who are listening here it's like screaming
at their uh you know they're gonna be waving at the the air saying no no no tim you're cheating
what about unsafe and we're talking about unsafe yeah yeah and and but i i it's like yes yes you're technically correct
and unsafe does is as a thing but let's not scare people right at the start right away yeah so like
generally this is the rule and you know when you're in level 12 then you can learn about the
exceptions but yeah yeah once we're like a level 12 developer you know right now we're like you
know and we're gonna make our way up to you know i right now we're like, you know, and we're going to make our way up to, you know, I don't know.
It's been a long time since I've played role playing games.
So if I have a borrowed string or something like that, I can't delete it.
Can I manipulate it?
Can I change the string?
Or is it purely like a read only type of situation?
You're allowed to change the thing if you ask politely.
So Rust has another part of analysis that it does.
It says, okay, you can, like, I have some string,
and there are multiple parts of the program that want to access and read from
the string. Well, you can have as many readers as you want, programmer Tim, but if you need one of
them to have write access, well, the situation changes. You can either have sharing and you can
have multiple readers, but're only on one writer
it's like you have one or the other if you need both like you actually need to
be able to provide a write and read access to multiple places at the same
time then you start to get into the territory of wrapping your types in things that contain locks
and i'm gonna say something which has the risk of alienating a lot of people
but i'm hopeful it's actually going to demonstrate that the that rust's uh approach is really unified so the same mechanisms around managing
ownership and deletion which occurs implicitly by the way one of the things we haven't talked
about is that once your string that you own leaves scope it's deleted automatically okay so i don't i don't have to do like completely
manual sort of memory management no no no you don't you're not completely manually
in fact this uh that process of what the rust term is dropping um but essentially we can just call deletion or cleanup is ubiquitous so your locks
don't have an unlock method instead when they get to when that when the the thing that has acquired
access reaches the end of its scope the lock is automatically released this means that you
are freed from the possibility
that you're going to incur deadlocks
because you've attempted to unlock a lock twice
or weird things can happen with locking.
And for example, there's no close method on a file.
The Rust's file type doesn't have close on it. Network sockets don't
have close. The ownership system is pervasive. And once you get it, it actually simplifies a lot
because the API surface for all of these types, it reduces because we only need to learn one concept.
Now, the problem is that this concept of ownership
is pretty foreign to,
it's not often baked into the programming language.
It's baked into the way that you develop your software.
It's very, very important that you think about if you are in like c or c++ land and even
if you're in ruby or javascript or typescript or what have you you still only want to delete things
in one place and have one canonical location where the responsibility for cleaning up exists
because you don't want to introduce null pointers like you don't want to introduce null pointers
like you don't want to introduce null or undefined it's really really pernicious it's a really
horrible problem because as soon as you have undefined it's like well where the heck like
like like what do i do now like you kind of can't backtrack from that i mean so you're saying like
ownership is kind of unique to rest like how um i guess if i'm coming from c or c++ is that a pretty easy jump to make to actually
like understand how that works or is that like a you know that's a conceptual leap for a lot of
people so c++ is definitely closer the um and but c the the terminology is actually older than Rust.
So the C++ community will say things like
shared pointer and unique pointer.
And this is exactly the same as Rust's shared,
or sorry, what I call read-only borrows
versus read-write borrows,
which would be unique pointer.
Another terminology would be mutable pointer or, sorry,
mutable borrow and rust.
Anyway, so those map really well together.
And ownership also is a concept that exists.
And the other concept that people talk about is object lifetimes and
rust just bakes it into the programming language itself and essentially requires that you give a
shit like like the the doubt like rust is really pedantic and is quite bureaucratic and quite
fussy but it doesn't it it it's doing the it's kind of like a very strict you know and like the people that have there are sort of multiple classes of
people that have difficulty with rust and one class of programmer is someone who was a very
proficient c developer who just like was like throwing pointers around and like essentially
or someone who might have
like programmed an assembly or some stage you know because they're doing very low level stuff
and just wanted the absolute freedom to kind of play with the machine and kind of understood
inherently what was going on then they get told by rust actually no what you're doing is unsafe
like i'm not going to permit you to do this you need to actually comply with the rules of the language yeah so what are object lifelines in that sort of sense okay so an object lifetime
is a span of time of the program where it is valid to refer to so let's say that i have
initialized the string alex the alex string is i initial initialize Alex at time one, or T1.
And the scope of Alex, it kind of exists for, let's say, 20 lines of the program,
but that might be T6 and some logical clock.
Now, between one and six, it's okay to refer for other parts of the program to access you.
But as soon as we hit T7, I can't actually access you in a way that is legitimate, that
complies with Rust's rules. And I've been talking a lot about how this is bound to scope, but that's a bit of a lie.
There are other ways which you can reduce the lifetime.
For example, you could at least pass ownership to something else. So if I give ownership,
I give Alex to some function.
So I pass by value.
Instead of passing a reference to the original string,
I actually give the string itself into some function.
Then it's invalid to refer back to the original variable,
even though it exists, sorry, in the original scope.
Let's say I've got main, I initialize Alex,
and then sometime later I have some function,
I've passed Alex into that inner function.
And within main later on, I then try and capitalize Alex.
Now, that won't work with Rust.
Rust says, hey, hey, hey, hey, hey, Tim.
You've actually passed ownership here.
You don't get to hold on to it now.
Sorry.
That opportunity has passed and if you want to write the pro if you
and this if i don't if anyone has written go i don't mean to to jump on go i really honestly
it's just it's just easy like sorry um and if I have, I send something down a channel.
So it seems like I pass it or, in fact, I could do it with most programming languages.
I can spawn a thread and pass the data into that child thread.
But then I still have access to it in the main thread
it's like i can go haha
russ will not allow you to do that um the type system itself will protect you or not the type
system sorry uh the the borrow system it's like essentially like a logical analyzer inside the program. You could think of it as a super powerful linter for your code.
Gotcha.
So in that case, if you did want to sort of like, you know, manipulate that value in some way, you just you would make a copy of it, but sort of realize, hey, this is a this is a different thing.
Now, whatever I passed into that inner function that is sort of gone.
They got it at T whatever, you know, T6 and now at T7.
I can change it,
but other functions
not going to have access to it.
I just have to realize
that's a new variable now, essentially.
Right.
So we actually need to decide
what we want.
We could decide, you know,
what I actually think
the best thing to do now
would be to create a copy.
Alternatively, I could say,
no, no, I only want one copy. But what I'm going to do is wrap it in some special thing. And the specifics of like what
it's called don't really matter. But I can wrap the original string in some type which makes both sides of the inner function and the outer think that they have ownership.
Or I could change my inner function to accept a reference to the original.
Maybe I don't need to pass ownership all the way in.
Rust will force you to choose.
That is why it's hard.
It's not rust being difficult it's that computing is difficult and rust makes you to makes you like think about it um at least this is my...
Again, I'm slightly biased now because I'm no longer a beginner, right? Like, I wrote a book on the language, essentially to teach myself Rust, actually.
The best way to learn is to write a book about it, right? It's true. Yeah.
Yeah, yeah, yeah.
Yeah, I even told the publisher, I was like, like look i'm not the world's best rust programmer that's uh why i and they were like no no but
you're a good person so i'm sure you'll write a nice book and um the yeah so rust is fascinating
because we have this really interesting i say interesting instead of
a dynamic to break down that rust is difficult to learn and the other dynamic that is i think
quite important for the rust community to figure out is a perception that rust is a difficult to hire for and be difficult to get a job in and it's extremely odd to me
that these dynamics all exist when the facts are that rust continues to grow
rust is being it is the only other non-c language to be introduced into the linux kernel
it's being introduced into the windows kernel as well like that's how successful this thing is it will dominate it will come increasingly
to grow for the next let's say three to five decades of software i mean that's in some sense
a preposterous statement but the longevity of these systems like operating systems kernels that exist like linux is not
going to go around for them like it's not going to be replaced in the next couple of decades like
it runs on everyone's servers like everyone deploys to linux and it might change itself
and morph into something else but i don't think that something is going, I mean, who knows.
Are you seeing a shift in,
a shift or a growth in sort of where Rust is being used?
I know you're saying early on sort of, you know,
used for Firefox or whatever,
and a lot of like sort of low level kernel type stuff.
Are you seeing that expand into, I mean,
it seems like we see a lot of like new
infrastructure database type stuff written in rust but are you also seeing like web apis and
things like people doing that in rust or is that still like hey let's let's keep that in
java go or python javascript something like that i tried to say four sentences at the same time it
didn't quite come out my mouth the um the i have seen a massive shift over the last couple of years
where Rust has refused to stay in its lane.
Rust has continued to be the property,
the benefits that accrue around the reduction
in the number of errors that you create.
Like Rust enables, let's say, ordinary programmers like myself
to write extremely high
performance code that runs extremely efficiently and just like it's very difficult to express how
much nicer it is to have a system that just uses like 50 megs of RAM and it just sits there and it does its job
and you can pretty much forget it and it is serving tens of thousands of requests a second
like and it's and it costs like dollars a month to run you don't need a cluster you don't like
you could if you wanted to you can deploy it you like, but you don't need a 32 gig instance and a backup
instance. It doesn't cost hundreds of dollars. You're not
constantly babysitting this thing.
Before I started my own business, I actually worked
at AWS and I'm on record at saying that the reason why
I have a job is I want to save this company hundreds of millions of dollars a year.
And Amazon spends a ridiculous amount of money on memory.
Like it's quite expensive to run AWS, actually. And therefore,
but, and so just generally,
Rust has been able to do very, very well
at the traditional systems programming language,
but I definitely, like stuff,
but I definitely feel as though
it has outgrown systems programming.
There are still spaces that I think
that it doesn't,
that isn't well suited to, primarily with what I would call like interactive workflows.
So there's two domains that I'm really interested in that I still find Rust really clumsy for.
One would be, I don't know if you've ever used any sort of data science tools but the
there's the jupiter notebook python uh kind of environment is very ubiquitous kind of this
interactive immediate exploratory uh modality where you have some data set and you're generating
plots or you're kind of like crafting
models that sort of thing does not lend itself well to a compiled language that is very fussy
the other one would be kind of similar but different i'm really into generative art and
processing uh like p5 js for example just it's just a dream to work with in the browser
it's just and like there's just this immediacy that is available to someone that is you doing
front end that just is not present in rust uh and essentially it feels as though the code is having an immediate impact on what you're
producing. And that's one of the real benefits of, I think, front-end development, because you can
kind of see the changes. It's like if you're tinkering with something, it just immediately
pops up. And Rust approaches that. And so a lot of the front end frame so there are front end frameworks
written in so you can write front end in Rust because Rust has very good support for compiling
to WebAssembly and so there are front end frameworks that expect people to write rust like and and that works
and it approaches interactivity because of the essentially incremental compilation we can do a
bunch of trickery to essentially make it faster but it's still not fluid at least that's not how
it feels to me and um yeah, to answer your question,
yeah, those four sentences,
it's absolutely the case that Rust is bigger than systems programming.
Like it's more than just databases.
One of the other things we mentioned very, very briefly
is that Rust is being increasingly well used
for tooling to support other languages.
So for example, like the rough linter in Python
and they have that same team
is like a bunch of Rust developers making Python faster.
And they've got this new tool
which is significantly faster than pip called UV.
And in the no, sorry, there are a bunch of, I think like Tailwind CSS.
I think they've got some sort of tool that, you know, strips out all the unused styles and stuff like that.
And outputs you something that rewrote that in Rust in the last year or two.
So, yeah, you're seeing a lot of tooling around.
Like you're saying, other languages basically,
but written in Rust to make that go faster. And I really like that idea
that Rust can kind of play well with others.
Because it's just a programming language.
Like, it needs to prove its worth.
Like, it's literally just a programming language.
Like, it's not special
we shouldn't like it's a cultural artifact it's kind of it but it's not precious in the same way
that i would say there are other things that that humanity produces that i think is much more that
are much more important um just in terms of that cli story, one reason why Rust does very, very well, especially compared to tooling written in dynamic languages, let's say like a Node or Ruby or old stuff is even written in Perl, is that Rust allows you to kind of like pack up all of your dependencies and all of your code
and compile that into a single binary.
This was very prominently,
it's not the only language that does this.
Go, for example, was also very famous
and it had this opinionated style
where you could just create like a single file
that you could put on any computer
and it would just work.
Now, Rust offers that same workflow
that you can compile something on your laptop
and then it can just be copied to wherever you want
and it will work.
There's no installation step.
You don't need to worry to the same oh you don't need actually you don't
need to worry nearly to the same extent about like does the do we have the right dependencies
installed do i need to like ship like the programming language do i need a version which
version of ruby do i use do i have all of the gems like all like you know are they compatible
have i got the native version and did it was i did that did i have the right c compiler so that i could write the compile the c extent like native extensions
um that kind of stuff doesn't exist in rust and so it's very very good if you are writing tools for developers because all of that packaging nonsense vanishes yeah you you've mentioned go
a few times sort of in comparison do you see a lot of sort of like you know things that were
being written in go i know go was a hot language and still is used for a lot of different things
do you see that shifting to rust or are they different enough where it's like hey if you've
if you sort of made your piece with the gc or something like that maybe you're just using go like do
you see shifts happening there or or are they uh are they fairly distinct so rust was like a a bit
of a answer your question i i see and my perception is in the wrong place like i'm i see more shifts than
of big things so for example sidecars would have started like inside the kubernetes world would be
you know it's easier to write them in rust uh discord moved its back end from go to rust
because of the garbage collection pressure
there's a really fascinating blog post where they say huh every two seconds i'll like latencies just
have this really horrific spike like what's up with that and it turns out that goes say whoa whoa
i need to actually free up some ramp like i need some i need some i need to reserve some time myself to kind of get
my bookkeeping done otherwise and that really impacted discord's ability to serve messages
consistently but the the the reason why i pick on not pick on go the reason why i compare us to go so frequently
is just that they are there's there's two reasons one is that historically they were seen as
kind of frenemies or at least they were kind of like one was developed by google
and the other was developed by mozilla so this is kind of like the historical origin stories. They sort of appeared in the public eye at around about the same time.
And this is about 2012, 2013-ish.
And then it looked like Go was just rocketing.
And Rust was slow.
It took a long time to get any sort of real adoption and at the at that time they looked
extremely similar goes has go routines rust had this these little similar things which i think
would probably be called um green threads or um fibers depending on your or like Erlang processes if you've you know if
you're from the the Erlang space and had this they looked almost identical in terms of the way they
wanted to like see the world but eventually and so they were kind of spiritual they were seen they were compared
very frequently together now the reason why i talk about go so frequently now is that
rust and go are very divergent in their philosophy and so even though they both provide very, very high performance and look superficially like they probably fit in the same areas,
they are very different.
Rust is very focused on being technically correct.
It's not going to allow you to send maps down a channel
and then access them.
Once you've given something down a channel like that's it you cannot like you've given it to the channel you can't hold on to that data anymore
and likewise so there's just a whole bunch of like design philosophies rust is a large language with a relatively small standard library.
Go is a very small language with a very rich standard library.
And so even though they play in the same area with like develop,
like Kubernetes is probably the most famous Go project.
And yeah, it was like hugely successful.
It has a significantly different philosophy than Rust.
And I think that I don't, again,
I don't want to criticize anyone for programming
in the language that they prefer.
But I think for large programs that exist for a long time
where you want reliability,
where you want to be able to protect your users against like
memory safety like memory leaks and sorry your own system against memory leaks and your users
against like safety bugs and like crashes from null pointers and so you want systems ability
then rust is like a very strong contender should it be the language that you use your to write your next big
thing well maybe not but i think it should be on the list of things that you consider
like i think it's earned its place in that list um because there are a bunch of considerations
like do we have enough people on who know rust and uh or uh that come into play when teams start deciding on
programming languages you mentioned the the standard library the smaller standard library
of rust and i don't know if you saw phil eaton wrote a blog post about this last week i think
just comparing zig go and rust i believe and on a few different axes. And one was around that standard library.
And he said he wished Rust had a bigger standard library because he thinks it just leads to a little bit of, you know, third party package sprawl and some issues that way.
Do you like the small standard library?
How do you sort of come down on that?
I don't like the small standard library.
I think that it's too... it comes... like I know
I've got some suspicions as to why it exists. And it's showing Rust's heritage as the system's
programming language. And compared to its peer there, which would be C. Rust is a very rich standard library.
The C standard library is extremely austere. It's very minimalistic compared to what we might see from a batteries-included approach.
And so compared to that, Rust is quite rich.
It gives you a lot.
We have things like hash maps for free.
Not quite.
But now, I haven't actually read the post,
but I think this is a really interesting discussion
because it's a thorn in the side of Rust.
It's like, well, we'll just allow the community.
Essentially copping out.
The standard library maintainers say,
we don't want to expand the
library because we don't want to crush essentially innovation we don't want to pick winners
but that has a very significant cost to people that are just starting out
and like because like if what am i going to do are you seriously expecting me to search through
tens of thousands of packages to find exactly the right thing it's like why why are regular
expressions not in the language like why like and there are other times it's like well how do i
represent i don't know a web request or JSON? Like, what the heck?
Yeah.
And essentially, I think what Rust,
and this isn't actually the language problem,
but the community has this thing where they're trying to abstain
and they're taking, this is where I come into tension with,
I think it's with the Rust project, really.
Because I'm actually not part of an official Rust team.
And so I've joined a couple of meetings for the standard library.
So I was playing with the idea.
But ultimately, it's quite a lot of time.
And I'm in the wrong time zone.
I'm based in New Zealand of all places.
And so I can't really hang out with people in Europe.
Anyway,
there's a philosophy there where the standard library maintainers are saying,
Hey,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no,
no, no, no, no, no, no, like like it's it's we should put regular expressions in the standard library like
are you seriously going to suggest that like and like we like the i understand why there's concern
it's like oh we don't want things because the standard library is where like code goes to die
that's one of the problems is like no one wants to maintain
something that essentially can never change once you introduce it into the standard library you
can't really touch any of the apis because suddenly you don't want to destroy people's code
but like isn't that a backwards like isn't that a backwards, like, isn't that like, like, like really odd for the philosophy?
Because if you're in the standard library and you're maintaining some code that is used by, let's say, tens of millions of projects, it's like, is it really a failure that you can't upgrade?
Like, you can't break backwards compatibility.
Like, why is that actually a problem?
Like, that's fine it's boring and so the problem is there's a whole bunch of like human people don't like
working on maintenance people really like building new things uh complying with the standard library
means you suddenly need to introduce a whole bunch of like political stuff which you don't
really want to do you don't you have to sit in committee meetings and things like this becomes really dull if you're a main open
source maintainer it's kind of like not why you what you signed up for as an open source maintainer
uh but at some point there's going to need to be something which says for
and for multiple reasons but there's going to be some subset,
let's say like 50 packages.
And we talked about regular expressions a couple,
but there are others as well, like deserializing JSON,
like shuttling data around.
And there will be some set.
In fact, I have a pretty good idea of a couple dozen packages,
which essentially, if you think of like a solar system of,
where like the core exists
and then the standard library sits outside of the core
and then you might have something
sort of in orbit of the planet
that stretched analogy, apologies.
But we have some kind of blessed set
of third-party packages which just
makes it a little bit easier for people in their first three days with rust because you the real
issue that i have with like design by committee or at least design by talking to current Rust users is that the Rust users of today are actually in a significant minority
of Rust users in tomorrow.
Like one of the things and like the people that are just starting today, like there are
many people who are 14 and are like learning, like they're watching youtube and they're thinking hey man
i should learn to code and what we're doing is making like adding barriers to those you know
there are a whole bunch of people for whatever reason it's like i want to learn rust well i
don't want to learn rust and i don't want to have to i don't want to learn Rust and I don't want to have to learn Rust and all of the searching through packages.
It's like, I don't know enough to make an educated guess.
And so this is a struggle that every single programming language community faces.
But Rust now, because it is essentially at the center of so much software infrastructure, I think it needs to grow up a little bit.
It needs to kind of like accept that it is going to, like, it's going to be used for serious, boring projects.
It's going to go into trains. It's going to go into planes. It's going to go into trains it's going to go into planes it's going to go into
missiles like this um speak shuttles anything yeah like it's yeah then the kinds of demands that
a an aerospace company has from a programming language
are different than the demands
that fun and kind of quirky
like upstart startups have.
And somehow we all need
to be able to work together.
And so I don't think this would,
and I don't know, like I'm sure that there are plenty of people that are like you
know what tim rust is fine yeah yeah that's the hard part right how do you how do you figure out
like you know where it needs improving and and you know especially like you're saying the people that
know it already like they they have a little bit of status quo bias or they understand it they know
how to work with it and and how do you adopt it to the needs of the next
generation? On that same note, like I have a few like, I want to call them like issues with rust
or like things I hear about rust. And I would say small standard library is one. Another one is
unsafe, which you referenced earlier, like, hey, rust has all these incredible, like,
memory safety properties and things like that. But then you have this unsafe keyword, you can
sort of escape out of it. People say, look at we're looking at rust package and it's
got unsafe everywhere what like what am i doing here i mean how big of a problem is sort of rust
unsafe is it how do you sort of think about using it judiciously or advocate it in your training
like what do you think about unsafe yeah right so um just to give a very very small plug for my book actually
not meaning to like be too no yeah absolutely plug the book yeah it's a great yeah cool um
so one of the things that rust in action actually does is give you a run-through of unsafe and we
actually try to use it and essentially we can take do things like get a floating point number and like
unpack it and like inspect its bits and like play with it and kind of like so but then like and also
to demystify this thing it sounds like extremely scary it's like i put i'm putting on that i'm
putting on the hazmat suit and i'm gonna go into to contaminate an environment it's like it's it's radioactive in here or something um it's like i'm going into also and the interesting thing about unsafe code
is that oh sorry so i we we should actually like explain a tiny bit of context rust has a keyword unsafe which marks a block as what
and that's what we're going to explain now that essentially rust has this ability to kind of
uh and what's been hinted at is that essentially it gets to turn off a couple of the dials
but it's actually unclear when you're starting like what those dials actually are or how powerful
they are because there's an inherent fear that we're going to do it wrong okay so let me talk
about what those dials are and how serious it is and why unsafety what like why it's as
yeah let's actually start there and we'll see if what other things pop up in the conversation
unsafe does not allow you to do whatever you want with with the programming language
it actually relaxes a very few rules what it is doing is it pushing the burden for upholding rust's rules
from the compiler to you so imagine i have some third-party library that is responsible, like gzip.
So I have libgzip in my code.
And it's a C API.
It's written in C.
And I really want to compress some data because I'm sending data across the wire.
And so what I do is I allocate some memory,
have my string, have my string, I have my text,
and then I give Rust,
sorry, I give gzip a pointer.
So a pointer is a reference to some span of bytes.
And I say, look, for the next four kilobytes,
that's yours, gzip.
Please do your best.
I'd like shrinking this for me.
And then gzip says, okay, okay,
yeah, look, i'm good with that
okay i'm gonna give you back oh sorry sorry we're giving jesus probably a pointer and a length
saying with that span of bound so at that location uh is some sequence of bytes up to
and we've got the four kilobytes in length and all of that is yours i won't touch it you promise not to touch it
because you're giving it to gzip and gzip says okay okay cool i can do this i can i know about
compression okay so i'm going to give you back another pointer and gets another length.
Because GZip has said, aha, so I've got,
I decided to actually create a copy because I didn't trust you.
I thought that you might touch it.
So I had to be safe and I decided to give myself another copy.
I've given you back another span of bytes.
Now it's shorter.
You need to figure out how to incorporate those bytes in your program.
And so Rust's borrow checker cannot interrogate what the library is doing. So you, the the programmer need to do its work for it so you can
you have to manually construct rust string type for example and comply with any of the technical
term is invariance or you need to guarantee that the preconditions have been satisfied.
For example, you need to guarantee that the pointer is not address zero.
So the memory address zero is otherwise known as a null pointer.
And if you try to access that RAM, your program will crash.
It's just an integer.
So that's the crazy thing about memory addresses and pointers.
Everything, all of this abstraction about, like, references
and all of this terminology all boils away.
It's just an integer.
But that's all you've got.
And so unsafe is sort of a bridge
between Rust's very high-level abstractions
and the computer's very primitive data types.
If you've ever coded in assembly,
I've done it very rarely,
although I've written a CPU emulator and stuff.
And you discover that there's really only two...
Your computer really only understands two or three data types.
A memory address and data.
It just has bytes.
That's all it's got.
And it might even just be integers.
That's not a very rich type system.
And everything else has been added by
programming languages kind of on the over the top and unsafe pushes responsibility for deletion
to you as the programmer and also that exclusive access is provided in the right places so you can do things with unsafe like take some random
integer and then tell the computer that it's actually a memory address so we can actually
change the type or i could do things like uh i can essentially lie to the type system and say,
aha, from the network, I received four bytes.
Now, the network protocol specifies that those four bytes actually represent an integer.
Now, the type system initially gives you back something that looks a little bit like an
array which we'll call a slice and each of the single bytes.
And you with unsafe can kind of flip that around and say, aha, no, no, no, that's actually
a four byte integer.
And this is like these are the kind of things that are unlocked with unsafe.
Now, the question is like, well, that doesn't seem super dangerous.
Sadly, it's horrifically dangerous.
So people are much worse at this form of analysis than they think they are.
Like historically, like the evidence continues,
like we are still people and we are fallible.
Like essentially we're bad at it.
And so there's some other tooling that will run your tests and actually trace the memory through the unsafe blocks.
So essentially you've got your compression library and essentially it will check. and actually trace the memory through the unsafe blocks.
So essentially you've got your compression library and essentially it will check.
Like, did you follow the rules?
It's like, oh, no, no, sorry.
Actually, you broke the rules.
And it's surprisingly embarrassing.
It's like, well, heck.
Because sometimes it's really, really hard.
The most annoying thing is it seems like it should be trivial.
But the evidence suggests that the smartest programmers in the world
are not smart enough to figure this out.
That has been proven so many times and it's like
the software industry and so so so there is this kind of uh a community like we need when there's a
there's the kind of the immune system of rust like the the you know we talked about there's kind of the immune system of Rust.
We talked about the third-party ecosystem.
It's pretty vast now.
We've got over 100,000 packages there.
And there's plenty of unsafe.
In fact, I did some analysis for a talk that I'm going to give next week, actually, at Rust Nation UK, called Unpacking Unsafe.
And about 5% of packages, I think, I'm getting the numbers wrong,
have some unsafe block.
And the problem is that not all packages are distributed equally.
Some are more important than others. And these more fundamental things are actually, they require unsafe um and but famously people are kind of allergic or at least
very skeptical of claims that unsafe is fine so
an elementary so people laugh at Rust.
I was before for like this particular counter example.
So they'll say, aha, but in computer science 102,
I was asked to implement a doubly linked list in C.
So this is a data structure where every element in the list refers back to the thing that follows it and the thing that preceded it.
This isn't a data structure which is impossible to write in SafeRust, at least without incurring runtime cost.
It turns out that it's actually really, really challenging to write in c as well properly it's actually like
uh but you can't do this without unsafe blocks and the the thing is that russ is the russ
community is kind of allergic and to this construct at least this places a very high degree of the burden of analysis on this being like an
acceptable practice because there are some people that come from c++ or from some systems language
and think aha i could just unlock the gates it's like that's right oh this will be fine this is
exactly and then you just incur the costs
the all you're doing is incurring the costs that you tried to get freed from it's like you're
essentially removing the benefits of rust but maintaining uh some of its some of its challenges
the rust community quite sorry i mean there was just
one other point um i was a little bit disappointed with the rust community's treatment of a particular
web framework so i don't know if this is-t-i-x and this was just knocking
benchmarks just just like off the charts and it used unsafe like there was some data structure
or something that essentially it's like no no if we we we
i actually don't know the internals but it was the maintainer just got a huge amount of vitriol
like people just jumped on the guy he ended up saying you know what i'm out done with it yeah
interesting so is that framework like gone? Like,
has it sort of faded away now?
Huh?
Yeah.
So the, the history is really interesting if you care about these things.
And like I do from like an open source,
maintenance kind of point of view.
Cause you say,
well,
it's like,
I don't think that we should essentially like jump on people that make
mistakes.
Even if you think that they are genuine mistakes,
I think it was a little,
like my recollection is kind of getting a bit fuzzy,
but I think there was a,
like, how dare you tell me that I'm doing the wrong thing?
I think that was part of the issue
where someone was like,
actually, no, I made this choice and I'm right.
It turned out that the uses of unsafe
were actually unsound.
Like it could actually introduce memory unsafety.
Like the criticism was correct from a technical
standpoint and what has happened is that actix has been replaced in by another framework with
its same name by its same it's kind of actually it it morphed into something else. So Attics, the original implementation, was an actor-based system.
This idea that you could write little tiny functions that would run independently of each other.
And the actor framework was using this unsafe stuff to kind of make sure that everything was as fast as possible and
the web framework carried on but essentially they ripped the guts out of it and like replaced the
back end with uh what in the rust community is pretty well known this thing called the tokyo ecosystem and so
essentially what is now called actix web is a web framework like at the same domain name
by new maintainers but just a totally different architecture totally different setup yeah like
completely different except for the fact that there is like one little thing,
which is the WebSockets implementation
for sort of, I don't know, technical or legacy reasons,
I'm not sure, still uses like the original active framework
and presumably that will also, but it's not HTTP based,
which is why WebSockets, probably a little bit complicated.
Anyway, so there is kind of like this one one legacy bick i say legacy one little bit left of the original
stuff which itself has actually been totally revamped to use significantly less so anyway
i think culturally unsafe is probably
more scary than it needs to be.
I think it should be essentially de-risked.
So if I'm wanting to look at a package,
you mentioned there's some tooling to do some analysis of my code
and look at the memory and things like that.
Can I have pretty good confidence that, hey,
if I'm looking at a third-party package, it's using some unsafe,
that it is being safe?
Or is it really just going to take some people vetting it,
looking through it, using a lot in production,
getting some bugs out of there, and then figuring it out?
Or how, again, if I'm a new developer
and I'm looking at third-party packages,
how do I get some sort of confidence in what I'm using there
if it is using unsafe?
If you want to do the analysis yourself,
I'm going to start with a multi-layered approach.
Obviously, we can't get to perfection.
This is a standard that we cannot obtain.
You can have a policy of saying
that we're not going to allow unsafe code.
It's like we're writing a web API or we're writing something and we actually really going to allow unsafe code. Like we're actually, it's like we're writing a web API
or we're writing something
and we actually really don't want unsafe.
There are, you read the docs
and it's like there are lots of things that,
like there are statements that some libraries will make.
It's like we don't use unsafe here.
So that's one layer.
There is a community auditing system and i'm just like
looking it up now um and uh as a um so all of the rust ecosystem essentially is kind of anchored
with a command line tool called cargo and there is a little bit of, just like get subcommands are just other executables that are named the right way.
The cargo ecosystem has other subcommands and there are two.
One is called cargo-audit and this provides security notifications and so forth when CV cbus for rust packages are developed and the other one
is cargo vet which provides the ability for people to endorse specific versions of
third-party libraries and at this if you're a small business like if you're a small team that's probably the level of assurance
that you you want if you are like at a bigger scale like if you are 10 000 developers or more
and you want to have like a secure like a very secure tool chain like that's
a slightly different scale you do things like mirroring you create a mirror of all of the
public packages and essentially allow list like specific versions as they pass through gates
and that's actually quite doable with the tooling so if you want to run your own mirror, you can do so.
It's actually pretty, pretty easy.
And you can apply policy filters like,
oh, it's like we don't want to allow GPL code in our system.
That means that you could do that if you want.
Or you could even write a scanner which says, hey, do they use unsafe here?
It's a, I wonder if actually you could i don't know i'm opening my
i'm opening myself up for um a lot of criticism once i once i don't do this but i'm gonna sort
of say one of the things that i could do i have a uh i've got a an unsafe code research project called HeatShield. And at the moment
there isn't a lot of action on the
repository now. I'm looking now at the commit. I haven't actually pushed things up to GitHub
in a long time. But HeatShield provides the ability for you to at least
scan for unsafe and just kind of give
you a... Oh, there's another one as well
which is called cargo gaga so there's a bunch of like little tools um this this heat shield thing
is designed to be able to provide an analysis of the entire ecosystem so it's trying to be run
against every single public crate to gather a sense of like well what if your dependency's dependency um is vulnerable or gets taken over like maintainership changes to someone who decides to
like leak secrets um i think their the software supply chain story is um fairly
it's it's been well discussed but i mean that's that's that's sort of part of
this discussion as well you i want to talk about amazon to aws because you mentioned like places
with 10 000 developers and and you know you were at aws you had a goal of saving hundreds of millions
of dollars what did that sort of look like like what was your what was your time there like like
what kind of projects did you work on what's the desire within aw or was it was it amazon as a whole is an aws
specifically um and like what's the desire to to be moving stuff to us is it is it porting old
stuff is it writing new stuff like what's that yeah yeah yeah okay so i can talk about things
as they were about a year ago right so um uh my role in fact our whole team uh suffered from
um we we made it through to the third round of layoffs in 2023 essentially so um inside amazon
there is one group that has responsibility for developer tooling across all of amazon so this is aws amazon uh a couple of
and its subsidiaries as well like twitch for example and this includes its build system so
rust has a proprietary build system that is weirdly not talked about anywhere um and so sadly i can't
really reveal any details except for the fact that it controls your entire build.
So you describe like for every single commit, Amazon essentially knows the entire provenance of all lines of code, which enables it to do things that are really amazing like hot patch every single production server um pretty much
give or take like some pretty significant s like there's some caveats there that are pretty serious
but um in principle it um it's a it's a very very good system although it's showing its age it was originally developed in the late 90s anyway the my job was a uh originally to support support rust build so this was to support the mirror of
creates that i owe as well as other projects that we discussed about you know having things like an internal playground
so that we weren't leaking proprietary code like to the public uh public playground and uh
bits and bits and pieces like that and then eventually teams like let's uh some of the
projects that have been like it's public knowledge that S3, for example,
is moving, looking really heavily to Rust.
EC2 has components.
There are actually multiple very large service teams.
So when we talk of Amazon or AWS
or any of these large companies,
once you get behind the curtain,
it becomes very obvious
that it's not really one company anymore.
Any of these large services, in particular Amazon, because there's a very strong philosophy that each team chooses its own tools and its own training and a whole bunch of other stuff. The Amazon way is that Amazonians,
is what they call themselves, are strong owners,
and individual teams are the best place to make decisions
about the tools that the team should be used,
with the exception of things like security and build.
So this is a very privileged position,
centralized inside the entire company, including Amazon.com.
So it's a team inside
physically housed in AWS, although it
predates AWS existing. So it was originally
part of Amazon. And hugely
fundamental with the other um and they took a strategic bet on Rust
they're like we're going to stand up a team in 2022 we're going to hire some of the world's
largest like most prominent Rust stations like myself uh john genset was already working there but he got them
to agree to bring me on as well as luca palmieri and several others who are less prominent but
probably more competent actually and uh so we had about a dozen of us building uh some pretty neat stuff, including a...
So my role eventually morphed into much more of an education focus
because lots of teams started looking at us.
And so I wrote a doc, which you do because you're at Amazon,
you write a six-page doc and say,
hey, we should be the world's best place to write Rust.
That means that we should support builders.
So Amazon, inside Amazon, you're a builder.
You're not a developer.
We should support builders wherever they're at
and we should be able to teach them Rust.
And we should have an education program
that draws in expertise from across the company
about building services at scale.
So we're not teaching the language per se.
We're saying that if you want to serve traffic to a billion people or more,
or if you want to create a service that has single millisecond response times,
and you want to do that at like ridiculous scale,
then we need to teach our teams that.
Because one of the downsides about Amazon,
this is my sort of experience,
is that AWS and Amazon have this issue where they...
I need to be pretty careful with how I express this.
It's really a common story is that people, they can just chew through lots of enthusiasm from relatively junior developers.
Let's say fresh out of college, they get a job at a fan company
and then they essentially are just thrown away when they it's a meat grinder like at least that's
how it feels and especially at the junior levels once you like i came i entered amazon as a senior engineer. And so I was essentially not exposed to that mentality.
I had a wonderful time.
No one speaks at reInvent in their first year.
But I got invited to speak at reInvent.
I was a bit of a rock star inside that company.
And so I was in a very privileged position,
but most people are not.
And most people in, let's say,
they're like fresh out of college are not.
And there is, and I think my,
but I don't actually,
I think that rust at scale or last of these rust at these large companies is
is really strong but the enthusiasm for spending millions of dollars a year because essentially
that's what a team costs uh if you want to have a dozen engineers there, you're looking at like, I don't know, a $5 million investment or something, probably more.
Like the enthusiasm at like a senior management level
starts to decrease very rapidly if you're under pressure.
Now, I don't know what the situation would be like internally.
In the last 12 months, the share price has rapidly ticked.
It's gone nuts.
The profitability has gone through the ceiling, sorry, not through the floor.
And my personal belief is that they made a very short-sighted decision about getting rid of our team.
I get really angry about it whenever I think about it in depth.
I think that they had an opportunity to essentially demonstrate leadership in probably the most impactful programming language that is going exist in the next couple decades and
they i should say they still have a rust team so they have they had two they have they had a rust
team uh for example nico matsakis is lead of the or co-lead i think think, of the language team. And so the people working on the compiler,
like Esteban, Kuba, and Felix Koch,
he is lead of the compiler team,
are extremely senior people inside of AWS
and inside the Rust community.
And they are very, very impactful in what they do.
Are they contributing back to Rust?
Are they building internal tooling for AWS?
They are doing the...
I can't speak about what they're doing internally.
Like I'm not really privy to that.
But presumably there's some mix.
But they are definitely very active inside the Rust community at large,
developing the language.
There is a, for example, Kyle Lurch,
the lead maintainer of Tokyo, is an AWS employee.
And so AWS essentially is funding the development of Tokyo
and lots of the Rust compiler itself.
And the idea that you're going to have a team focused
on internal tooling or direct, you know,
and in addition to that was like a very heavy lift.
For like, because of reorg and stuff,
it turned out that these were both,
both of these teams ended up being
under like the same part of the org chart and so at some level it was just like what the heck i've got two rust teams um they're both extremely expensive and they're not they're not generating
me any revenue because they're not service teams in the traditional sense like um so like from like
the spreadsheet we just looked redundant and then that yeah hard
hard to align those incentive incentives correctly even though like it i'm sure it was beneficial to
aws and amazon as a whole but it's not beneficial to whoever's line it went to on that on that chart
you know yeah yeah yeah yeah and i think that, it gave me a very, like, even though my tenure there was pretty short, actually.
I think I was, but it's been one of the most, it's been one of the most instructive periods of my career because it finally gave me the confidence of saying like wow
you're really good at this like like and one of the things that i've struggled with is that
i have been like feeling like every side project sort of fails.
Like essentially the book took way too long.
Like it took way too long.
I was working three or four nights a week plus time on the weekends for nearly four years.
So this is like nearly 2,000 hours.
Because the thing is, at Rust in Action, you like is at rust in action you like build a database
and you like build a cpu emulator or you build an ntp client and it turns out that if you want
to teach this you actually need to implement the thing and that took a couple of iterations
and then you need to write the chapter and then sometimes you need to whittle down the
implementation because you can't introduce two introduce two language concepts at the same time.
And the book was horrific.
And now I look at my YouTube channel and I think,
oh, look, you only have 8,000 subscribers.
What the hell is the point?
There are other people that have 800,000 or whatever.
And so this confidence thing has been really, has been the big shift because now I sort of don't believe it.
Like this week I'm getting flown toland because people want to listen to me speak
that's a very strange feeling for someone who has always felt that i wasn't quite good enough like i
mean i did python data science like i was i, I felt like I got the book contract essentially by accident because
I was contributing on the forums and I got a random email saying, hey, do you want to
be a co-author of a book?
Because we've got one in the pipeline, but the lead author is just really underworked
and overworked. And eventually they pulled out and really underworked and overworked and eventually
they pulled out and i and you became overworked yeah i became the soul yeah that's right so anyway
like and now starting my own business and and like and doing it profitably and so i've now
i'm now contracting some to to some of these like huge
companies and essentially like pull like like holding my own is just has been has been the most
it's just been the most crazy 12 months or like and think that, you know, Rust is part of that.
Like Rust is an empowering technology.
Like the reason why I give a, like the reason why I care about this is because Rust is going to make a difference in the ability for the industry to create stronger,
safer, more energy-efficient programs.
Is everything going to be written in Rust?
No.
But is everything that we write from now on
going to be influenced by Rust?
You bet.
And I think that means that everything is going to be stronger
and everything is going to be more secure and more memory,
sorry, more energy-efficient.
And let's do better like as
an industry we're awful like like and that is uh that's yeah so that that's kind of my my spiel
yeah i love that like i think it's so helpful to see that sort of thing like the internal doubt doubt and like, I'm sure people look at you and you're just like, you know, everything,
like they look up to you, like, you know, sort of like a God in this rest community. You've written
this book. That's amazing. You've done all this, all this stuff. And you still have like that doubt
or like the disbelief of like, you know, people want to find you out in here and give a talk and
things like that. So I think that's helpful. Like, you know, two other people get it out there.
Like two questions I want to ask you about your teaching and sort of what you're doing now is
number one, you mentioned how much of just how much work that book was. I'm sure Manning's like,
so, so happy with it. Like they got their money's worth out of you for sure. But like, number one,
are you even looking back at all the work it took? Are you glad you did the book? And number two,
what sort
of advice would you give folks that want to go in this sort of maybe like education training
consulting coaching type thing any advice you have from them that you've picked up over the last year
and five or six years as well writing the book has been absolutely pivotal to me being able to
essentially springboard out of like the developer track into tech influencer in the
good sense of the word and that is someone like i have been able to like there is that book
and really actually not the book direct although the book is nice like the book gives like the
reason why i went with the traditional
publisher rather than self-publishing was because of essentially the isbn like essentially because
you could say like there is some credibility behind it and that in my case has been hugely
true i would not be speaking to you if it was not for that book. Like I would have just been some random Rust developer,
probably mucking around.
And even if there was some other person who like had worked at AWS before
and so what, like what the heck, that's not interesting.
Now I, so it was hugely instrumental
and it was awful it was it was one of the most difficult things that i've ever done
it it was i don't even know how to express how close i time i gave up a lot i gave up my health i was very
active i used to really enjoy running and lifting i had this goal for i don't know what the imperial
units are but like lifting 200 kg so i think it's 500 pounds and like as a deadlift and running a four-hour marathon like
i really wanted both of those in one year and i have still got that as a goal but it's now
seven years later or something and i also had kids and and i really wanted to prioritize that
like i became a father as new city new job uh but i hated just working in a job like i'm too outspoken and i found myself always fighting
the fact that people had this expectation for what a software developer does or what a data
scientist did so i were i was kind of on the software side or day of
data science um i would and um that people like oh no no you shouldn't you shouldn't really care
about that i was like i i really do and the and i one things that i really appreciate about amazon
actually is that like they like people to be outspoken.
In fact, they expect people to speak up.
It's one of the internal tenets that they follow.
So it's one of the things I actually respected about that company a great deal.
But what my advice for someone now would be that
you need to start today.
And that doesn't mean start big. It means start really, really small because your success will compound.
And the compounding effect is going to be much more important than your like current velocity.
So essentially, don't worry.
And we're not, people are probably listening to this.
Don't worry about like your position in like, let's say we're at zero and we're going up to like expertise.
Like don't worry about where you are in that level.
You will grow. What you need to worry about where you are in that level you will grow what you need to worry
about is your rate of increase and the thing that is going to give you the most return is small
investments regularly and essentially allow compound like it's impossible to practice regularly
and do things like and choose your space so you don't need to space. So you don't need to be a YouTuber.
You don't need to be a blogger.
You don't need to do whatever you want.
But the process of creating is going to be.
And find.
And is up to you. Like you choose your medium you get to choose
this is actually up to you you should uh be very mindful of youtube as a platform and like my i I hate it, I've got to say, because I find myself clicking refresh on the analytics page way too frequently.
I was like, oh, YouTube is addictive as a viewer.
You know what?
It is way more addictive as a creator.
And the whole thing is gamified.
It's like, oh, just one more video.
And every time you publish something,
it doesn't matter how terrible it is,
the stats go up.
And like, it's like, wow.
And then I think, oh, I only had a thousand views
on that thing.
I'm like, well, actually,
if I was to give a talk,
let's say at a meetup,
that's like, let's say, at a meetup, that's like, let's say, 30 people.
But YouTube has this reach.
And so it is actually quite nice.
But be so mindful that you understand why you're there.
You are there because you are sharing, because you have something to give do not try you're going to and i apologize to
doing something asking you something it's impossible but try not to compare yourself
against the people that you look up to because you will constantly feel as though you are failing.
You won't believe it when someone says,
that really helped me.
You'll think, I mean, I think that now.
Whenever I, someone, so in fact, here,
you talked about self-doubt.
Here is something absurd.
Like I'm actually surprised at myself for doing this.
I had a live stream this week.
So I try to stream on Sunday afternoons for those people in the state i watched some of it it was great i just like pulled up twitter and
i saw your stream i'm like i'm gonna pop in and see what he's doing you're building the web framework
but uh oh yeah yeah yeah i was like let's let's let and uh it pops up on youtube and
youtube has this feature on live stream called super chats.
We can essentially give a tip. I've never had anyone give me a tip before.
And I got this really weird notification. Someone has tipped you a hundred bucks.
And I was like, I didn't even say thank you because I was convinced it was a glitch.
Like, I was literally like, oh, this must be some weird spam.
Like, I've been able to figure out how to psych me,
and that is something that I am constantly trying to convince myself.
Like, the reality is that I am highly successful.
The reality is that people really appreciate my approach.
The fact that I intentionally make mistakes and talk people through my thought process
of like essentially digging myself out of the hole.
Like that's actually part of the vibe.
And people like me people
trust me i'm a very good coder like i have been able to like like meet the bar or exceed the
and and and multiple places and like i but yet my brain has got this thing where it says it's not enough
you're not gonna no yeah it's it's not you need to build more you need to do more you like this
and and so and in particular with youtube i find a really corrosive space for me mentally and i wish that i could kind of like hoist myself out of it
um but i like it there because at least i accept that i accept the downsides given the fact that
it's easy for people to just like find me and there are other things that I do. For example, even though I always use a free editor,
that's pretty basic.
It's just a pretty stock standard VS Code
with almost no extensions.
Because I want my streams and my material
to be as accessible to people as possible.
If I was to use a crazy crazy Vim config or like some,
uh,
proprietary editor,
this suddenly creates a distance between myself and my audience,
uh,
that I really dislike the,
the last thing.
I mean,
maybe not last,
but nothing that popped in my head.
It was that the majority of your audience as an educator are people who
speak language speak english as a foreign language it's actually and so be very careful
with the way that you speak so for example one thing i like to kind of point out to to north
to people from the northern hemisphere in the UK,
I'm sorry,
um,
Europe and the States and also our friends in Canada is that,
um,
I have no idea what a North star is.
Oh yeah.
Like a North star metric type thing that you hear like that turn of phrase.
Yeah.
It's like,
well,
that's our North star.
I heard this because I've worked at an American company and I was like,
what does that mean like
like i i know what the like what symbolically does the north star even mean like this is not
something that i know like like and and so and like i've been i've been trying to find
and i've heard people in where I'm from say guiding star,
which is almost kind of sort of the same, but different.
One of the things about the North Star
is that it's in the same place in the sky
the whole year round, right?
Like that's why it exists.
And so we know where to go.
We can essentially anchor ourselves to that.
But there are no stars like that in the Southern Hemisphere.
So we don't really have the same ability and and like there are some other things as well uh for people that are in the
states i like the the due to you by the way if you want to focus on an american audience
and own the fact that you are an american that's absolutely fine but
there are some things that i think that people say without realizing it um and so the the
the choice here is to be intentional about what it is that you're saying and for example, analogies to baseball and basketball.
These are quite American sports.
And even just before in our conversation, I talked about like university, like students and professors. from professors actually are quite rare because we call the the rank in the university system here
for what in america is known as a professor is actually called a lecturer and so a professor
is several ranks higher and there might be one professor per department for example and uh before that you have associate professor senior lecturer lecturer so the there
are you can't escape who you are as an individual you can't escape your culture you kind of can't
really decloak that but the one thing that will really benefit you as you try to educate others is lots of self-reflection
and understanding like what it is that has uh because if you are able to understand what has
influenced you you're going to be in a much more empathetic position to be able to
discover like what influences others for example you know talking about cultural influencers one
that's quite just like very stark would be using cars as transportation like personal transportation. This is a very Western modality.
It's to be the very first choice.
And even in a lot of Western countries,
cars would not be the first choice.
Denmark has 90% penetration of bicycles and only 40% penetration in automotive, like in motor vehicles.
And so if you're in Denmark and you think about going to the shops, I probably would take, or even going to school, I'll take the bike.
And I wonder about, you know, it's very difficult for me to see what is essentially invisible to me.
And there I have some really very obvious mannerisms and quirks, which I kind of like cringe at when I see recordings of myself.
No, people love it.
Yeah.
You know, it becomes part of it.
Yeah.
People want to get to know you instead.
And that's actually absolutely right.
That your audience is connecting with you and part of you needs to figure out like push through
the doubt push through the fear and one of the so there's a couple of ways that need that there's a couple of things to do that have helped me one is
i don't need to be prepared i just need to act as though i'm prepared i can't get over that sorry i
can't get like i have to like prepare like a psycho because i'm like too nervous about not
being prepared so but you know i'm so i'm excited to hear this one yeah so for example last year i get i would probably spend between i don't know up to 100 hours per hour of
like like physical presentation like if i was to like i could find myself spending devoting weeks
and weeks and weeks to a talk and a lot of the time i find myself up on stage ad-libbing a little bit and
actually relaxing and the audience responds a lot more it comes across as much more genuine
and so what i was saying about the the preparation side is that you actually have got this.
You're better prepared than you believe that you are.
And the other thing about helping others is that making mistakes is part of the help. If you feel as though something, I mean, I worry that,
so the big thing about me is like people say,
oh, look, Tim's an expert Rust developer.
It's like, you want to bet?
I mean, I kind of can't shy away from the fact that like I'm a,
I suppose I am an expert Rust developer,
but I still spend plenty of time interpreting compiler
error messages and part of that is inherent in the process and actually explaining okay well
this is actually what the compiler is saying when it generates this particular error well well it's like i detect that um people want to people will respond to you being genuine
and you being empathetic with them i don't actually like entertainment as
in the guise of education so the masterclass kind of approach where you've got extremely high production,
but essentially it's like...
You're skipping over all the...
Yeah, everything that can get...
That will go wrong
as you're sort of making that development process.
You're going to run into bugs.
Yeah.
Yeah, and like...
Yeah, and you're changing the... What I like to do when i work um even remotely is try to
remove barriers or at least the perception of like i'm trying to like say that
i'm trying to remove the elitism in the room or like remove the um and i say that like in a group of 12 of us there's bound
to be people that know about a particular topic let's say memory safety or like address space
layout or box in the heap and a whole bunch of other things than i do like i uh and so actually
sharing knowledge as part of that story and like in a live stream i'm very encouraging like a very very welcoming of people suggesting changes to my code as i go and
um yeah i don't know hopefully i've answered a couple of those questions that you were asking
yeah yeah i think so i think the big thing that i was like sort of coming back to is like early on
you mentioned oh i have this many subscribers, and I see other people with,
you know, 800,000 or something like that. And the two things I tell, because I've had other people
ask me about that the two things I tell people, or I try to tell myself is number one, you might
just be at a different part of the process, you haven't, you know, you're still early in that sort
of journey of growing that thing. But two, you might be playing a different type of game, right? You know, like people that have
8,000 subscribers, I'm not like, you know, dogging on them or saying anything bad about them, but
like, they might just, you know, they're, they're maybe they're more entertainment or different
things like that. But I'm guessing that, you know, you have 8,000 subscribers, you have this book,
Rust in Action, you have a consulting and training company where like, people are like, you know, you have 8,000 subscribers, you have this book, Rust in Action,
you have a consulting and training company where like people are like, you know, you are very well
known of if I want to upskill my team on this thing, Tim is the person to go to for that specific
thing. And I don't think that's going to be true of the person with 800,000. Like, you know,
they're, they're playing a different game and, and, and just have to realize that sort of thing. And like, tell yourself, you know, like,
what am I trying to do here? What's, what's the goal? And also where am I at in the process?
Yeah. Yeah, no, absolutely. So in, in, in, in, yeah, to just kind of reinforce that there's a
couple of things that I have done. One is that I don't play the thumbnail game so I know that
I could do better immediately like doubling my click-through rate
by creating thumbnails which are kind of more traditional they don't need to be kind of like
like screaming like the kind of like face and like whoa yeah it's like borrow checkers got me now
and the other thing is and like i kind of maybe i think it would be kind of good. And so maybe I could do that. But I've tried to actually create a thumbnail theme with kind of blocky graphics and kind of this retro computer thing.
And I'm trying to just say, like, oh, this is a Tim Click's video.
If I've got time, let's kind of like check it out.
I don't want to add pressure.
I don't want this sense of urgency
to come it's like it's okay for you to take your time like the video is going to be patient it'll
be there when you get back um so yeah this is definitely trying to play a different game
and the other one is that i'm still learning i feel like like youtube or like video content
is a craft and i think it demands a lot
of respect and i haven't got enough time in my day well at least i try to produce like a 12 minute
video and like it's taken me three days i'm like holy shit that's a lot of time and it's like you
know what i'm just gonna like upload the thing if i don't
do it i'm gonna drop another three days on this it's gonna be like 20 better and that's not really
enough for me and so i should probably just take it like cut and run and so for me yes i would love
my production quality to be higher i would love the sound editing to be
like i'd love the there's so many things that i would love to do
but right now where i am in my kind of my journey or my starting my business and like
it just doesn't pay off i could pay an editor like a grand or something per video i'm like
well that's going to cost me shit loads of money over the course of a year like holy moly and um and so but it's
been wonderful even and like even a video that reaches 10 000 people like do we realize do we
recognize how many people that is that's a lot of people that's like my hometown i grew up in you know yeah yeah
yeah yeah absolutely and like that that's crazy and so i need to remember that i'm not actually
competing with people like i'm not competing with fire ship like fire ship makes the most
wonderful videos and i love them and i would love to include like
memes and like a whole bunch of other fun stuff but it would totally jar with everything else
on my channel and so yeah i don't know um at the moment i'm just trying to produce stuff that's
good it's helpful and it's good enough essentially i'm that's my that's that's my bar good enough and um yeah nice well tim this
has been awesome um this is the longest i've chatted to anybody so i love it this is this
is great stuff and i love like all the stuff i learned about rest but then also just like the
independent journey and and creating and doubt and self-doubt which i you know i have myself and
a lot of people do as well so i appreciate you talking about that um for people that want to
find out more about you
read your book watch your channel like what's the best way to to find you honestly probably
twitter still well x i suppose uh so tim clicks is the easiest thing to search for um i'm there
on youtube x twitter um mastodon even and github if you feel like that too but um the uh and it's timclicks.dev is the
website where i try to um essentially create like curations of my playlists to kind of enable people
to walk through at their own time yep yep great stuff i watched some of the videos as prep for
this episode it's it's great stuff like i i learned a lot stuff there. So we'll link all those in the show notes.
But Tim, thanks for coming on.
This is great.
I know so many people that really love you in the Rust community.
So thanks for all that you've done.
Hey, that's honestly my sincere pleasure.
Thanks so much, Alex.
Bye-bye.
Bye.