over 3 years ago Syntax Podcast
Supper Club × Rust In Action with Tim McNamara
- 02:30 Rust teaches low level computer concepts
- 03:43 Rust in Action aims to make Rust more approachable
- 08:04 First learned about Rust in 2012
- 13:04 Rust can have a steep learning curve
- 22:02 Good first Rust projects are command line utilities
- 24:09 Interactive games are a great way to learn Rust
- 25:16 Rust provides performance and efficiency benefits
- 40:47 Crates are packages, Cargo is the package manager
- 44:33 WebAssembly allows running Rust code in the browser
Rust can have a steep learning curve
Guest 3
and also, you encounter some really weird terminology, the crate count that has, Okay. So, one of my hobbies that I'm really, really bad at, which you don't have access to as a programmer. You don't even know like Like, even as someone who, like with, If is Or just like it enough that that justifies buying it. And, like, I just wanna, like, amplify what you just said. The and then expand upon or maybe give a couple of extra features or break and kinda tear apart.
Guest 3
the compiler does all of that work upfront, And so I kind of thought, well, why don't I create, like, a web server, which is kinda like this honeypot thing where you could sit the thing might still exist in memory, and kinda like I kind of had this idea that sometimes the website is the API. I love that. Yeah. Big fan of cigarettes. Yeah. That's very Wes. And then I was like, well, actually, Essentially, it's 32 bits.
Guest 3
with with, say, like, a JavaScript or TypeScript, like, let's say we're writing things in Node.
Guest 2
a native like, for those who don't know, there's lots of node modules that are written in CC plus plus, and there's just a thin little JavaScript layer to interact with it. And anytime there's one of those, I I throw my hands up, and I say, okay. That's not me. There's no way. But then when we were looking into Tori, I had to write a little bit of rust to to do a little bit of extension stuff, to put some settings in, to make a custom nav. And I was like, Oh, I I don't know, Russ, but, like, I I could I think I could actually do this. Like, do you think Russ is a lot more approachable in that fact? I know you just said people fall off cliffs, but Is it better than other stuff? running Rust in different places. Obviously, it can run on Linux and on your Mac and and on Windows, but, it can also run-in other
Guest 3
data. But all it does is when it gets to the end of its scope, your, Right? It's like, this isn't like the other books.
Guest 3
Now is Russ more approachable? And,
Guest 3
Right. Okay. So, and then match those numbers to operations within a program just is like a sequence of linear steps from, like,
Guest 3
it's it's essentially It's still illegal to access. So you kind of get these weird problems where things kind of linger on in the background in memory, but they're they're actually no longer valid.
Scott Tolinski
somebody who's a JavaScript developer, they say, alright. I hear everybody talk about rust.
Guest 3
And, It doesn't quite work exactly like that by default, And that's because which would be like It's It's like a car license. It's a name error. I'm like, there's no name error in here. Like, I am right, Python. Like, what a and then you'd, like, look and be like, oh, no. Python was right. It's like like there really is a bug. Or like, oh, it's like, oh, hello. Today is type aero day. And, in the software space for a little bit of Time now. I actually started as a, a year or 2 ago. Like like, it's time to things that you might run so it's just marked as garbage.
Guest 3
This is one of the reasons why I personally believe that Rust is On the accessible It's called an instruction set.
Guest 2
I have never been 1, just a lowly web developer, never been 1 to try to dip my toes into c or c plus plus. Anytime a node module is,
Guest 3
is why is it a trait? Like, is it a Strong type? Like, And, essentially, potentially And you're asking the Python is interpret you need to read in a file okay.
Guest 3
Thinks other parts of the program can only reference the variable there was some software that was running alongside your application.
Guest 3
at compile time what is that? okay,
Guest 3
essentially a scope. Let's say it's like a plate But, essentially, And And you could send people to this kinda crazy thing, which I called Rust, like this corrosive web server.
Guest 3
safeguard the pitch for me Cargo is the package manager for Rust.
Guest 3
Your program gets in the entire, And this is why if you have A program under very heavy load Yeah. You'll sometimes notice latency spikes, has is doing a lot of work. What we like, essentially, add build time.
Guest 3
like, every couple seconds, And it's in this kinda weird like, it's almost like a metronome going off, like tick tock, tick tock.
Guest 3
And the other thing that that that really bugged me was that I tried to compile some native extension, and then I get comes crazy linker error. And I'm I do not know What to do here? Like, I do not know how to get myself out of this hole. I don't even wanna touch the code. I just want it to work, and it's not working. So why not? and that A crate is a package, essentially.
Guest 3
is that like, you go to the you go to the event, and it's like, well, I'm really underdressed here? Because what you don't want is to be learning about, Let's say a problem domain? Like, you don't wanna be exploring the problem while you're also ex like, learning a programming language.
Guest 3
So if I'm a variable, Tim, At build time, I wanna bundle all of the dependencies, all of that runtime stuff,
Guest 3
Really tricky to figure out because once you've kind of gone down the road of relying on access like, being able to refer to another variable, to move forward. Now the reason why this is, the same, because things that are super trivial, Let's say, like, addition or some mathematics, a kind of you don't really need all of these opcodes. Right? How many times do we need to Yeah.
Guest 3
Get asked for access. It's there to CPU has firmware, There was a an article from a company called Tencent We know that because we, dusty.
Scott Tolinski
Okay. So let's talk about, like, building things in rust Specifically,
Guest 3
My impression
Guest 3
there are some things that I really appreciate about Rust, But there are some really And I guess my pitch is, like, I was really into writing scrapers, itself is I've already muddled things up. That's great. That's a good start.
Guest 3
Now I like, my but the prob the the the problem that I face Like, that feels like a very loaded term and, like, how is anyone ever going to learn? And so Those other 2 also need to go to bed.
Guest 2
they also exist within, like, those 2 time stamps. So that's, what a live type is. Is that kind of like like type checking in TypeScript where You're not allowed to write code that can reference something that doesn't exist in that scope,
Guest 3
interesting niceties, especially if you And the other part of that is often, you're wearing the wrong clothes And, Maybe a little bit slower or is a little bit less, We are getting better at teaching Rust.
Guest 3
But it's been declared as kind of, like, which is that computing I'm pretty sure it's gonna be 4 bytes wide.
Guest 3
what we call the runtime or the, You're actually 64, bud. Like, it's like hello. It's like it's like, happy birthday. It's, like,
Guest 3
of super annoying.
Guest 3
This enables But in Rust, that And, We'll pause your program to have lots of specialized dependencies Rust compiler is going to say, oh, you're on, presumably, like, let's say, a Mac machine,
Guest 3
not as as poorly named. Russ actually inherited this terminology, so I don't necessarily blame the the the Rust community for this.
Guest 3
is a scope that has, But it turns out that writing software and writing a book is, like, doubly difficult.
Guest 2
of Russ, I'm curious. I think you you kinda went into that. Maybe go a little bit more because,
Scott Tolinski
given on this show. So it's because you off We often, in in our world, talk about the garbage collector, packages and and them sucking or not is a It's a a constant Was it difficult to write
Guest 3
Big spikes where And I was like, this is this is this is my client's fame. It didn't go anywhere, but I still am paying for the domain name. When I started development, well, I guess, it was about 2015, Whatever reason Yeah. Domain squaders. Yeah. That's right. It's like, you know, that's a fun name. I I've got a I've got a project idea. I can I'll, Like, I'll backfill that at some stage.
Guest 3
irritating Now you've gotta refactor your whole program to fix the bug, And that is kind so I really wanna buy write a book that is different, And, as a Python developer in the data science space, machine learning, and natural language processing.
Guest 3
no longer in scope.
Guest 3
With Rust, It's easier to operate from, like, a systems engineering point of view, like,
Guest 2
but it it it takes a step further and, like, literally, this thing might not exist in memory when you call it, and Rust will stop you from writing code like that? Yeah. No. Exactly.
Guest 3
of programming Rust is that it's super quick. So you kind of the idea is that,
Scott Tolinski
if someone like
Guest 3
Programming languages don't have a lifetime.
Scott Tolinski
or just that process existing. But, to hear it explained that way, I think, was was really nice.
Rust provides performance and efficiency benefits
Guest 3
Intel still has opcodes that are a single byte.
Guest 3
You, consumes significantly more resources than it needs to.
Scott Tolinski
crate.
Guest 3
And so some of those number well, they these are called op codes for operation. So, they and, in fact, and interpret and let and and let's say match the numbers that are there to, like, We could say, oh, look, we're dividing by an, like, As someone who's putting in all of this time, if I compile on a Mac, I can't just send the thing to Linux. This is probably a problem that people live in could and we get these really obscure warnings.
Guest 3
And what they mean is, like, they they kinda totally nerd out Yeah. It kind of feels,
Guest 3
is written in Rust now and not in JavaScript So all of your up codes need to be 1 byte.
Scott Tolinski
and for a long time. And JavaScript is is really like
Guest 3
So you have 64 bits look through like empty packages, and then and a little bit further on the boot sequence, it's, like, well, actually, no, no, no.
Guest 3
you've got some new superpowers.
Scott Tolinski
our our audience and and I don't wanna speak for our audience, but me personally, like, it's super fascinating for me to get this Lower
Guest 3
It turns out that that that, like, Intel and Arm and a bunch of these other CPU vendors have thousands of opcodes.
Guest 3
or, yeah. It's like, oh my god. No. They've They've got another one. It's like it's kinda like the zombie combo.
Guest 3
The Intel computers but it also has opcodes that are 8 bytes wide. So the computer or the the chip actually needs to figure out, like, is this a 1 byte thing or a 4 byte thing or, like, an 8 byte thing? I don't know. I don't know by, like, by definition, like, I'm the thing figuring this out. Whereas an arm machine Like, break them.
Guest 3
And, but Rust will say, That's an awkward feeling. It's like, well, I Yeah. I don't want People would have come into the Rust community, like, oh, I'm I'm I'm I'm just a web developer.
Guest 3
you started in the seventies But, That is not the plan. Nice.
Scott Tolinski
you're just you're just tossing darts, but you're not even throw in a dart board. You're just throwing them at the wall, wherever. And then TypeScript, you get, like, the little target here. You get you can you can get a little bit more accuracy with what you're doing. And this is, like, really pinpointing things a lot more, which honestly,
Guest 3
Intel machine boots up thinking that it's a computer in the seventies.
Guest 3
So you kind of have, like, cost Savings is gonna be good for the business.
Guest 3
the same every single Like, essentially, domain name squad is inside the Rust community what does this mean? and and really good. And the other thing was, like, I really like examples. Like, I really want to be able to give people a thing have been, it's a technology I can't remember exactly how this happens, but very, very early in the beat the the boot up sequence, There are some really mature libraries That was had a, like, a little proxies metric server thing that they had written in node.
Guest 3
Now, I'm seeing Weez's face and, like like, slowly so when you write build, Like, about 6 weeks prior to that public announcement.
Guest 3
a a game dozens of terabytes of text every month.
Guest 3
There are huge amount of engineering trade offs in all of this stuff. So it turns out, by the way, so people are gonna start getting annoyed at you at work because you'll just mention, bits of, of bookkeeping to your software, which is called a garbage collector. Mhmm. The reason why this happens is because those And so what they do is, like, when you delete something, is a trait a class? Like, what what So the This will become you actually encounter far fewer kind of runtime bugs that are Irritating.
Guest 3
And
Guest 3
Like and almost, Right. So so no one is going hopefully, not too many people are going to care that their formatter like Another check. And, in fact, it's even slightly more sophisticated.
Guest 3
And and or the Ruby package manager, and so he had quite a lot of experience on for example, WebAssembly is, like, really interesting, but I've actually used WebAssembly more on the server side, which is kind of silly. But browsers
Guest 2
all or part of your
Guest 3
the previous thing where you might have, like, with that's laggy? No one not not many people. It gets really frustrating. And I think development is similar.
Guest 2
the benefits on this podcast before. If anyone's listening for the 1st time, they might be thinking, like, What's the point of learning this entirely different language, and why were they talking about this on a, like, a web development podcast? So, like, Why would you ever want to offload
Guest 2
in Rust, which is twenty
Guest 3
You kind of you're,
Guest 3
executable and I've got my buddies Wes and Scott, And I have references to them. So, like and I own them in, like, the Russell view.
Guest 2
all of this Rust can run on my computer with me not ever having to do anything?
Guest 2
I think going through 200 template files took 1.1 seconds in node,
Guest 2
And right now, it's in node, and they he showed,
Guest 2
TypeScript to JavaScript without ever I've never installed Rust on my machine. Like, how is it possible that
Guest 3
In Rustland This works because
Guest 3
You the but it
Scott Tolinski
Wow. I think that was explained really lucidly.
Guest 2
in the past, I've had to use Python tools, and I groan every time it needs to happen because it's like, do I have the right version of Python installed? And do I have Python on my server as As well as note like, why is there no Rust hosting? How come I can just,
Guest 3
So read in.
Guest 2
But they still get the benefits. That was my next question is,
Guest 3
all it is is some memory
Scott Tolinski
So does that mean, like so oftentimes, when we talk about, like, different architectures and CPU architectures,
Guest 3
an integer. We're dividing by, like, floating point, but you don't actually So they were spinning up, And, like, a hidden you are like, a a hidden link with, like, let's say, like, display, let's say, the front end community, been asked to, like,
Guest 3
performance improves, so your users are going to benefit.
Guest 3
in
Guest 2
like,
Guest 3
In Python land, you're sending the script to the server
Scott Tolinski
Some some language in in the rust,
Scott Tolinski
Just 101, what's what what is a crate,
Guest 3
And it's like, well, The other reason so, like, one of the other motivators That has been marked by the operating system as executable.
Guest 2
2 times faster, which is
Scott Tolinski
Like, I I I got that I got that way better than I have before.
Guest 3
these primitive old opcodes, and then, like, something says, for the year it turns out that CPUs, never Yeah. No. I your program takes add on.
Guest 3
you might I I I just said before that We're still, like, ship something in Tori, for I presumably, hundreds of these machines.
Guest 3
Intel has decided that they want to be backwards compatible with every single line of chips.
Guest 3
industry that is significantly more environmentally sensitive.
Guest 3
But, I don't wanna lose too many people here, but I'm gonna give this one a go. Yeah. Do it. Like, what is an executable file? I don't know if that makes any sense. So that's ownership. No. I think that tracks. Rust variables don't just have a type. They also have a lifetime.
Guest 3
more environmentally, Like, it was actually and this, I mean, it was as funny as it is, like, it was genuinely really difficult. So Mhmm. And it was pretty successful.
Guest 2
basically, what they have to do is they have to run through all your template files,
Guest 3
was a deliberate decision. They basically took on the technical debt Was And And made it The cargo is still, like, and there's kind of nothing running alongside your program.
Guest 3
we talked about when we talked about the garbage collection thing, we said that there was some, that they can take And one of the things about 8bits is they take 1 byte.
Guest 3
The business like, boot sequence Do not write is, And there are, like, 6 of these. Right? So we, like, or in, like, native extension land, Yeah. That's right. It's like, oh, no. So, involved on the responsibility Still interested in the language, but have, like, decided that they are with all the revisions. It's kind of Like the Ruby Gems To basically enable their customers Rust's compiler to guarantee I didn't really care about what was happening, that all of those opcodes are correct, Less than half a second. It's unreal. Look, every time that you've gotta wait for, like, more than a couple 100 milliseconds, like, it just feels like lag. Like, who enjoys playing For the CPU. And so a, the 2 things that are being added together.
Guest 3
be the same width? the entirety of the computer all to itself.
Guest 2
unbelievable. Like, you think, oh, a second. But you start looking at, okay, not 200 template files, but What about 2,000 template files or or 10,000 template files? Now all of a sudden, your build is taking 10 seconds when you were just sitting on your hands versus
Guest 3
that your CPU can do.
Scott Tolinski
But, yeah, let's take it back to rust a little bit.
Guest 3
16 bytes are sorry. 16 bits, so 2 bytes are okay. So you're now in the eighties.
Guest 2
the folks from Tailwind were Playing around with rewriting their
Guest 3
in the manual Rust was what taught me what a pointer was.
Scott Tolinski
is that, like, if something runs on ARM but doesn't run on this So that does that is that because the op codes between those 2 architectures are different? Is that Yeah. Not anywhere. It it it So, this is like this is, like, warning lights here. Like, there's a big refresher Yeah. I know. This is fascinating. Because,
Guest 3
What you what you're doing is is sending executable files. So I know that this is kind of,
Scott Tolinski
You might hear introductory to rest. You might hear cargo. You might hear
Guest 3
is And it it might be a little bit And so we, like, write an NTP client, and you connect to at least time servers all around the world, and we do that from scratch.
Guest 3
is some memory.
Guest 2
from an NPM module and compile
Scott Tolinski
We write JavaScript,
Guest 3
Mhmm. And then asking the server, hey, man. Figure this out for me. It's like, look, I've got all the I've got all the stuff that you need. I've got all of your Python dependencies. Hopefully, they're the right version. Like, I I think that I ran upgrade, and 2016.
Guest 3
you now are wasting space
Guest 3
an a 64 bit machine and and the thing about Manning books is that if you pick them up before they're released, you get a chance to kinda, like, talk to the author. And that's awesome from, like, the readership point of view. But, like, from the author, you're, like, getting all these comments from everybody.
Guest 3
occurs. It's like I start, and all I know is, like, Evidence suggests, like, that about 90% of people that read it That, and its responsibility is not to kind of, like, be you it doesn't there was,
Scott Tolinski
side of things.
Guest 3
Like, I know that's a little bit weird.
Guest 3
Your program. You don't send over a script that gets, it might just be object in in an array.
Guest 3
just,
Guest 3
And it's told, Don't be like, oh, look. I also wanna learn, like, this Nix So this thing as well, like, but, The reason why we can do that is because apps written in Rust But I'd say I'd say yeah. It it it it's it's really nuts. And so they're actually like, there's a kinda crazy subcommunity So there are some concepts so the syntax is kind of like, it's just a programming language. Right?
Guest 2
import SWC
Guest 2
and look for tailwind classes. And then And then they look at them, and they they get rid of the ones that aren't in that list.
Guest 3
And what I what I really like is that all a lot of this tooling Yeah.
Guest 3
With these command line utilities, a tendency some sort
Scott Tolinski
and what is cargo and rest? Right. Okay.
Guest 3
And you probably therefore wants to have something that runs on Mac that you can't ship over to your Linux server. But with a couple of tweaks, Essentially, the more that I've worked with these systems, the more that I could, summer's gonna rage in the comments that I get this wrong, all has uniform sizes And then to operations.
Guest 3
Especially in parents if, like, you have, like, an m one or m two, which is a a Mac, which is an ARM device,
Guest 3
So the downside of that so the is that In the ARM world, I think that's one of the worst things about the ecosystem And, this is, like, One of the most amazing topics to kinda, like, geek out on. So there's kinda like there's there's no end to the rabbit hole. So this is the warning sign right at the front.
Guest 3
to service all of their customers.
Guest 3
Rust and just delete anything from memory.
Guest 3
editing away, and you hit build, and then you wait.
Guest 3
Like, the number 50 means addition. So there'll When I go out of scope, like, when I go to bed, And Rust has always been into the executable file itself.
Guest 3
They rewrote the thing in Rust and, like, were able to, like, remove
Guest 2
stack application tooling off to Rust? What's the benefit there?
Guest 3
And the planet benefits because fewer compute resources are being used. Totally. Like, I I just saw, Give me here's my here's my, like, 90 seconds on those topics, there are also, use You can never bootstrap yourself to, like, an, just in just just just make your Python faster. And I was, like, well, actually, kind of unsatisfactory.
Guest 3
The the terminology that we call is the Now,
Guest 3
if you really wanna, kind of, like, go completely crazy, You dig in and figure out that and fun.
Guest 3
that And we came late to, like, the programming Yeah. You'll also find that a lot of them will, like, bolt on,
Guest 2
Let let's talk maybe about some of the benefits as well. So we've talked about
Guest 2
and 40 milliseconds
Scott Tolinski
level appreciation.
Guest 3
that's good for the planet.
Guest 3
Okay. This is gonna sound strange.
Scott Tolinski
Do do you wanna give a quick rundown?
Guest 3
the executable
Rust in Action aims to make Rust more approachable
Scott Tolinski
Entertaining
Scott Tolinski
I love it. Yeah. Absolutely love it. So okay. So You wrote this book on rust. You've clearly been working in rust a long time. When did you first pick up rust, and what what drew you to it? Right. Okay. So
Scott Tolinski
And you make it
Guest 3
is that I had this I kinda the CPU.
Scott Tolinski
Just for a book. Right. Right. Right. Well, see,
Guest 3
3 or 4 nights a week, plus a chunk on the weekend. Gosh. And you do that and you calculate
Scott Tolinski
Yeah. You know,
Scott Tolinski
or enjoyable
Guest 3
on their learning journey. That was always, always there.
Guest 3
It's worth it for me can I provide some sort of input, so I have, like a big overarching goal, whatever else to actually interpret
Guest 3
It was horrific.
Guest 3
I probably 25 actually, no. The very first time that I encountered it, I think, like, a good 20% You you the problem with learning Rust is, like, you start talking about it. Everyone's like Not teach you the stuff, but at least kind of give you enough of the knowledge to be able to, like, Now if you are Intel, For ensuring does better because they don't have to spend as much money to get to provide, let's say, the equivalent level of service, but and there was 8 bit computers.
Guest 3
And the reason why Don't learn 2 or 3 things at once. Don't, like, change your editor at the same time.
Scott Tolinski
a book like that? Like, especially when at the time, you I don't know if there was a ton of Rust books out that were were especially focused on,
Guest 3
Like, why didn't you write this like, why didn't you write, like, this like every other TikTok? the, those op codes or matching numbers to operations Actually drawn a little bit of inspiration, I think, I kind of, like, found my way into this rust space.
Scott Tolinski
Resource.
Guest 3
There's a essentially, text analysis jobs, I was processing, let's say,
Guest 3
Why on earth is the book like, why why why why is there so much stuff? and now you have, like, x8664.
Guest 3
Database. We write a CPU emulator. We actually go in and say, happens.
Guest 3
that TikToks had kinda become, like, content marketing have touched c plus plus, to write something that can convert your script But let's go there. Okay. So, And then eventually, And so,
Guest 3
good 5% of people who it just does not land with.
Guest 3
like, how does your computer how does your computer tell time? Like, what is the network time protocol? that,
Guest 3
I did this thing where there there were 2 goals for the book. 1 was to prove to myself that you could write
Guest 3
Essentially 4 years work, a really technical book, And that was kind of it. Like, I didn't really know a lot about sort of fancy data structures and things.
Scott Tolinski
you know, practical application.
Scott Tolinski
I I picked up Rust in action a little while ago. I'm, like, one of those Manning sales that they have Black Friday, whatever, and I've just had it for a little while. And it it's one of those ones that everybody talks about is, like, the the thing to pick up if you wanted to learn, Russell. Congratulations on having, like, such a successful
Scott Tolinski
as as much as well, as much as it can be. Yeah. Yeah. Yeah. So there there's there's, like,
Crates are packages, Cargo is the package manager
Guest 3
a bad thing. Really, you wanna be able to kind of have And, And at some point later, if you are and, like, a little bit of fluff. And I was like, I don't like that. Like, Rust via Waz? I actually I actually have a talk from, like, the New Zealand JavaScript conference and do it really well. So So I'm kinda noticing this trend that, We have Node running our JavaScript program and it is what we call interpreting. So it's kind of running alongside
Guest 3
or, like, someone just went through a dictionary and, like, got them all. Presumably because they wanna receive an email somewhere down the drain of, hey. Can I buy this off you? Yeah. Yeah.
Scott Tolinski
Mhmm. People just grabbing a name and holding on to it for
Scott Tolinski
So and, no, I think because in in JavaScript
Guest 2
other places as well, including the browser. Have you done anything with running
Guest 3
this it's like a a crazy circus, essentially.
Guest 3
my impression is, like, this is like like, say let's say we we initialize something at at 0.20, that made it okay for me to learn are really quick.
Guest 3
It's like like, people, like, left laugh at left pad, for example. But, anymore. Mhmm.
Guest 3
one thing I quite like about it is that there are, like, Millions of micro packages.
Guest 3
The systems world would say, no. Dependencies are dangerous.
Guest 3
just generally. But helping you on that journey. You know, if there are any problems, maybe we can kinda, like, do some live debugging or something. I don't know.
Guest 3
And so can I so developers Extensions, much more the way that things were done kind of in the systems world.
Guest 3
from the front end community.
Guest 3
And very early on,
Guest 3
you don't they're kind of like the the BIOS, I'm pretty sure, tells the CPU, no. No. No. It's okay.
Guest 3
Keep everything in house.
Guest 3
In BM, we're, you know, essentially, like, dude, well, I been people that have just said, you know what? This is way too hard. I just do not get it.
Guest 3
which kind of About the prospect of kind of, like,
Scott Tolinski
conversation, I think,
Guest 3
and has learned a lot of lessons, I think. One of the lessons that it didn't learn was name spacing.
Guest 3
in the Rust world, or and so I was like, I really wanted to go fast, and I really wanted to fix this kind of irritating runtime bug problem.
Guest 3
They built a good, every single access across the entire
Guest 3
culturally When it starts, that's kinda crazy to think about because they And I try and ship the executable binary, like, the file to something that's on an Intel architecture.
Guest 3
There is around about the time,
Guest 3
of the, But imagine you're a computer, and for example, you could say, like, oh, maybe
Guest 3
where you have, like, an automated script, like, register 10,000 packages Drizzle something. Oh, wow. Oh, that sucks. If it was that bad, but it was, like, basically, every common word, that means I really wanna say absolutely, Wes.
Guest 3
like, a few a smaller number of However, a lot of
Guest 3
we're vulnerable to name squatting.
Guest 3
finding something on NPM Or whichever package manager would you would prefer.
Scott Tolinski
world,
Guest 3
our package manager systems? Yeah. So so so so so Rust is actually interesting because it has That people refer to an instruction set architecture.
Guest 3
with kind of Figuring out, like, why this sometimes these really suck.
Guest 2
Let's talk about
Guest 3
Rather than having, Or if you are in the figure, 64, but they're all 8 bytes.
Guest 3
So it's kind of the equivalent of running,
First learned about Rust in 2012
Guest 3
I didn't even know my CSS anymore. So I wanna it's like a hidden anchor in the page that a bot would find, but like a human would never click on.
Guest 2
the approachability
Guest 3
I spent too much time on hack and use.
Guest 3
And, towards this kinda systems to those
Guest 3
what an like, let's say, like, an array or, like, in Python name, we talk about lists, and in Python, we talk about dictionaries, but in in in, like, I am not a like a neutral observer in this discussion To me? Yeah. And now that I program So all of that I, I'm also super excited to talk about Rust. The not only because I happened to notice that one of your goals And so from my point of or, like, as someone who teaches a reasonable amount of The stuff.
Guest 3
Yeah. So I I I had this idea that I our program.
Guest 3
n c. Write it, You have, like, these really, then someone is gonna say, well, these CPUs are sometimes buggy.
Guest 3
like, on the chip inside my computer. Like Mhmm. Like, the memory didn't really matter the the data access will always be valid. So you could imagine let's let's ignore control flow And just say that, it's alive until 0.30.
Guest 3
and a lot of people kinda, like, fall off the cliff.
Guest 3
a reasonable amount in Rust, the pattern
Guest 3
no. It's index aero time. The if you'll forgive me. Right? So ownership But hey. But that's I think one of the things that I like about it in some sense is that it's really programming Install this Python thing.
Guest 3
okay for me to The Python, Java, JavaScript, PHP.
Guest 3
there was this thing, like, back in 2012 where Mozilla, like, announced This new language Like, CPUs have bugs.
Guest 3
and, 0 to n.
Guest 3
So Hello? The and also something that you actually have probably already implemented.
Guest 2
Woah. Really?
Guest 3
so I was in Python land doing data science stuff, and we would have these big Python, very early on. Like, really big, bulky dependencies, And it's like, well, actually, this takes time to respond to. So you're kinda doing customer support while trying to edit your thing. And I would only have, like, a couple hours in the evening. So I try and, like, block out, like, from 8 to 10 PM, Right. So to answer your question, is that if you look about the people that have fallen away, So Then, the the book All it gets given oh, no way. You can now interpret 16 bit.
Guest 3
we have community surveys which have a section for people that have actually that, The the Rust compiler can reason but but you kind of get this kind of, like, triple threat of the Every single thing needs to I'm pretty sure, package manager. In fact, I think you download a version of Python, I there are some there are some really
Guest 3
because I really understands 8 bytes at a time.
Guest 3
it really matters to me. I look at my Python code, I'm like, what on earth are you doing?
Guest 3
Everyone told me that you should not write native extensions in c. Like, that's for experts. Mhmm. That's, like, dangerous.
Guest 3
let's say, expert.
Guest 3
not part of the like, they didn't they decided to drop the language. Yeah. Let's talk about that for a second. Like, that I like. For example, pattern matching and a bunch of the software that is running alongside your program And then you get told later, sorry. That variable was illegal.
Good first Rust projects are command line utilities
Scott Tolinski
some of the the concepts down without necessarily
Guest 3
for yourself, Like, that's the that's the nice way of putting it. But I think the What you get is some source code, and About half of those Yeah. Or TypeScript.
Guest 3
You kinda what we're we're we're building up to is, like, we wanna, like, Play with I I recommend games.
Scott Tolinski
types of projects that are good introductory
Scott Tolinski
Do you have, like,
Guest 3
try to take like, pick 1 battle at a time. I like that. Yeah. Implement something you've you already know.
Guest 3
But I kinda like toy with is is computer generated art. Oh, cool. Yeah. Things that respond to user input, the UI is often really, really easy. It's just you know, it might just respond to the x, y coordinates of the mouse position, for example, but you have a screen there, and the package manager was built Like, a trait. Like, I language party.
Guest 3
also,
Guest 3
that runs
Guest 3
Things are kind of changing because of what's happening underneath.
Scott Tolinski
I want to pick up and try to build
Guest 3
Destroying someone's confidence. I would start with kind of command line utilities
Scott Tolinski
getting
Scott Tolinski
to
Guest 3
It's like Like, it's like you've always known that it's a problem. And then the next step, once you kind of like, you've you've gone through this a little bit, is Picking off, like, bits of projects that are not on the critical path.
Guest 3
it might be something Need a lot of sophistication there.
Guest 3
Things that are interactive.
Scott Tolinski
something with Rust. I want to explore topics in Rust.
Rust teaches low level computer concepts
Guest 3
is is this interesting? Like, this is not me. Like, I'm a web developer. Right? And so the I I guess The idea was, I might have broken a couple of things, answer to that. So the couple 100 or let's say several 100 CPUs I'm I'm a little bit worried that your listeners are gonna be, like, okay, I'm out. So do we wanna try it? Like, I'm happy to, like oh, no. It's interesting. No. I think this is all fascinating, especially because you don't you know, as web developers, Let's say, like, a Go or Java or c sharp or like, name your programming language.
Guest 3
The pitch for the book Is, coming to,
Guest 3
that the Rust community uses Like, this would be and, like, you say this enough times, and then people kind of take you seriously. Interesting.
Guest 3
was that The this was a problem because each of our runs would take several hours, and then, like, something would blow up halfway through, be addition and 2,
Guest 3
terminology if I can get a 1000 people to read it and they can save a 100 hours each, Well, actually, that's like a net gain for the world's productivity.
Guest 3
The language and kinda, like, unpick a lot of things so that you don't feel as though
Guest 3
to the community that would kind of, like, Bobcoats.
Scott Tolinski
I know. I did notice that too. Right? It's all about this higher level stuff. Right? And I think people can look at that and say, well, that's Maybe not what I'm interested in. Right. It's like,
Guest 3
thing. Like, what what what the hell is that? I the reason why I remember that is because I actually registered the domain name rust.i0, just be someone that knew about, like, is we can actually create a computing, I'm pretty excited Owner users just aren't getting the same level of responsiveness from your application, and that's Because the garbage collector is generally under pressure, and it needs to actually stop execution of the rest of the program. Oh, that's I think that was a a really good explanation of garbage collecting beyond what we've ever, let's say, the semantics. And one of them is this, you kind of encounter this thing like Ownership and lifetimes. And you're like, what is that? In practice, there's a couple of, like, command line flags that you need to Like, rust is the language and the ecosystem and community significantly is, like let's say in the worst case, like a very horrific learning curve. Like, people can kinda like, they're kinda, like, facing the learning cliff, And It deletes anything that it owns.
Interactive games are a great way to learn Rust
Guest 3
for playing around with the stuff. And and one's called Bevy, b e v y, that has a very welcoming community so what they nerd out on is things like, should all of the opcodes because you've got fewer service to run. But If you did that for approximately 4 years, which that's, like, 2000 hours.
Guest 3
kind of interactive the memory as numbers so my goal or the other goal so one was, like, to write this really amazing technical book. It always like to save readers a 100 hours And compilers or people that are building compilers, what they're doing is matching your source code to these opcodes and the on all possible invocations of the language or when it, sorry, of of the program, and put it on put your that same file on any Linux machine.
Guest 2
Yeah. We lost them.
Scott Tolinski
Yeah. It feels like it's a lot like that with a lot of projects. Right? Like TypeScript, For instance. Right? You try it, and it's so exciting. You're telling everybody about it, and everyone's just like, come on. Get a grip.
Guest 3
like, it'd be really good if we could try out rust here.
Transcript
Guest 3
which, And a CPU is, in some ways, very unintelligent.
Guest 3
I'm,
Guest 2
a 1000 episodes of this podcast. So, I I think 2023 is a big year for it, and I'm excited to learn more. Yeah. Likewise.
Announcer
so buckle up and grab that old handle because this ride is going to get wild.
Guest 3
kind of figuring out exactly how computers work.
Scott Tolinski
Rust, the author of The ever popular Rust in Action,
Guest 3
You're in, New Zealand? Yeah. That's right. It's stupid o'clock here in, Wellington, New Zealand, Scott.
Guest 3
And then over time, kinda developed this itch
Scott Tolinski
which is a mainstay in the Rust community and anybody wanting to pick up Rust. So We're gonna dive deep on all things Rust, and, we're gonna be talking a lot about how it relates to development. My name is Scott. I'm a developer from Denver, Colorado. With me, as always, is Wes Bos. What's up, Wes?
Announcer
the Syntax supper club.
Scott Tolinski
Welcome to Syntax.
Announcer
I sure hope you're hungry.
Scott Tolinski
We have a really great Supper club today for you. We have Tim McNamara on, and he's gonna be talking all about
Announcer
Wash those hands, pull up a chair, and secure that feed bag, because it's time to listen to Scott Tolinski and Wes Bos attempt to use human language to converse with and pick the brains of other developers. I thought there was gonna be food,
Guest 3
I'm I'm Yes.
Announcer
This is
Guest 2
Not too much. Excited to talk about Russ. Feels like we've mentioned Russ on the last
Scott Tolinski
Tim, how's it going, man?
Guest 2
Hey.
Announcer
Oh, I'm starving.
WebAssembly allows running Rust code in the browser
Guest 3
Not a lot is gonna be my honest, productive side, by someone who had worked on, the I I I I'm gonna hit my beats a little bit. But, essentially, you could run like, build for Linux And then, like, by the nineties, you have, like, 386, it contains everything that it needs. There is no you don't Require, like, a node or a Python of people that find they they hunt for, like, hidden op codes, things that are not documented It's kind of, like, all oriented And, essentially, just then asking the operating system to feed the stuff to the CPU.
Guest 3
Can take a essentially, have well,
Guest 3
Like, it's time to, like, take a look at web assembly.
Guest 3
you can have a dependency So in the front end community, execute that. And so what execution means and without and it's and it's invisible.
Guest 3
oh, what is it entitled? Of people that are probably also learning Rust, wanting to learn Rust in a way that that is, a programming language community that has supported open source because either really, really like it This kinda comes down a little bit to how computers work and how programming languages are implemented.