Intro to Rust programming episode artwork

EPISODE · Jan 24, 2020 · 44 MIN

Intro to Rust programming

from Changelog Master Feed

We teamed up with some friends of ours at Heroku to promote the Code-ish podcast so we're sharing a full-length episode right here in The Changelog’s feed. This episode features Chris Castle with special guests Carol Nichols and Jake Goulding talking about the strengths of the Rust programming language. Learn more and subscribe at heroku.com/podcasts/codeish.

NOW PLAYING

Intro to Rust programming

0:00 44:40
of MATCHES

TRANSCRIPT · AUTO-GENERATED

What is up everyone? I'm Stucovia here at our Chief of Change Law. We teamed up with some friends of ours over at Roku to promote their podcast called Codish. You can check it out at roku.com slash podcasts slash codish.

Check this out for links to that show and how to subscribe. And today we're dropping a full-length episode of Codish into the Change Law's feed. This episode features Chris Castle and special guests, Carol Nichols and Jake Goulding, and they're talking about the strengths of the Russ programming language. Here we go.

Hello and welcome to Codish, an exploration of the lives of modern developers. Join us as we dive into topics like languages and frameworks, data and event-driven architectures, and individual and team productivity. Paul Taylor to developers and engineering leaders. This episode is part of our deeply technical series.

Hello, welcome to Codish. I'm Chris Castle, a roku developer advocate, and this episode is all about the Russ programming language. Russ is often categorized as a systems programming language, but it's really much more capable than that. And you can see Russ is being used to build web applications, command line interfaces, re-implement JavaScript libraries in web assembly when performance, more performance is needed, and even for programming memory constrained embedded devices.

And because of this flexibility and a host of other reasons, Russ is gaining in popularity quickly. I did a quick review of the results of various developer surveys out there like Redmunk and Tiobi, T-I-O-B, and they showed Russ as one of the fastest growing languages by a number of developers. And even Stack Overflow's developer survey has listed Russ as the most loved programming language for four years running. But personally, I found Russ interesting because it has made low-level programming more accessible to me.

I never learned C or C++ when I learned a program 20 years ago, started in Java and went to Ruby and Node and Python. And Russ has kind of shown me that I can write lower-level code, but still kind of have this human-friendly developer experience or user experience. For sure, Russ has a steeper learning curve than Ruby or Node or Python, but it's tooling, it's documentation, it's community, and learning resources out there have made learning a delightful experience. And that brings me to today's guests.

Joining me are Carol Nichols and Jake Golding, who've contributed much to the Russ community. Thanks for joining me, Carol and Jake. Welcome. Let's start with Carol.

Can you give us a little intro about yourself? I'm Carol Nichols. I am the co-author on Russ programming language book. I got interested in Russ.

I used to do Ruby. And I got interested in Russ because I was working a lot on improving Ruby performance. And there's a point you get to when you really have to, to make Ruby go faster, you have to drop into C. But I'm terrified of C.

And yeah, same. Around that time, Steve Cladnick, who was, and is still a luminary in the Ruby world, he just kept talking about this brand new language called Russ, and how awesome it was. And he actually wrote a book called Russ for Ruby. And I was like, oh, cool, I can do this.

And I started checking out, and it was a way to write faster, low-resource usage code without the segfolds and the memory problems, and use after-free, and all the problems that come with C. And I was like, oh, this is just what I need. And I started sending Steve a lot of pull requests for his book. And that actually eventually led into me co-authoring the Russ programming language book with Steve.

Which is kind of like the canonical Rust learning resources, is that correct? Yeah, we were trying to be. Yeah, it comes with every Rust installation. The book is on your computer with installed with Rust.

You can also buy a dead tree version from no search bus. It's not completely comprehensive because Rust is a really big language, but it's aiming to get you productive in Rust, and give you what you need to be writing most Rust code. So what about you, Jake, what's your background and kind of entrance into the Rust world? So I kind of came at it from the other direction from Carol.

My first big job was a lot and a lot of C code and a little bit of Java, a little bit of Ruby as well. And when I was introduced to Ruby, I was amazed, like, this language is so nice to write compared to C. But I always had that thing in the back of my head where, oh, but what am I giving up by switching to Ruby? And I was introduced to Rust through Carol and I kind of just took to it and it was like, this is great, this is a wonderful high level language that allows you to express ideas concisely.

But you still get a lot of performance. You have that ability of writing that hard core C program or code, but you don't have to give up the things that you normally have to give up when you choose to write C or C++ code. So that really just kind of rang true for me. And because of my background, I see a lot of similarities of kind of a fusion of C and Ruby.

And obviously there's a lot of other influences in Rust. But to me, those two things are kind of like a beautiful marriage and Rust is kind of the offspring there. Yeah, that's cool. So, and Carol mentioned she and Steve are kind of the co-authors of the Rust book, but you also have some pretty major contributions to the Rust community.

What are some of those? Yeah, so whatever it is about my brain, I really enjoy answering questions. And so when we started with Rust, it was about Rust 0.13, I think. And at that point in time, there was not a lot of content for it on Stack Overflow.

And I kind of saw my chance of said, I can get in at the ground floor, I can learn a bunch of things by answering questions. And I might be slightly addicted to answering questions. Definitely addicted. It has, I saw your little pink Kirby character at the top of the list.

Yeah, so I'm the number one answer on Stack Overflow for all things Rust related. And it's really been great for me because I've learned a lot, but hopefully I've also helped a lot of other people learn things. And through that, one of the tools that I end up using the most there is taking people's code and testing it. And so I would copy and paste a lot of that into the Rust playground at the time.

And over time, I kind of how Carol started contributing pull requests to the book. I started saying, oh, well, this part of the playground needs to be better and this part needs to be better. And I actually ended up re-remplementing it. And then now I'm with the maintainer of the Rust playground.

But yeah, so back up a little bit. The playground is play.rust-lang.org. And it's a website where you can just type in some Rust code and then send it off to a server that runs it and then spits the alphabet. So you don't have to have Rust installed to be able to try it.

And you can share links to programs and things like that. Yeah, big goal of it is to make it so that people who are interested in Rust can very easily see what Rust is, kind of see how the compiler interacts with you, and be able to try some things out. It's obviously a great resource for people to report bugs or just communicate ideas. But in my mind, one of its biggest goals is to make Rust really accessible to people who want to try it and don't want to spend the 10 minutes to install it or whatever it takes.

So that's great. Interesting stuff that you used to work on in the Rust world. What is kind of the current big Rust project that you're working on in Rustland? So we've got two things that we've been working on currently.

One is the Rust Belt Rust Conference. This will be our fourth year. It's going to be in Dayton, Ohio on October 18th and 19th. It's like it's around sale now.

So we live in the Rust Belt in Pittsburgh and we like showing off that there is technology stuff going on in the Rust Belt. We're no Silicon Valley or New York City or anything like that. But there are a number of us here and there are benefits to being in the Rust Belt. So we've had a conference in Pittsburgh, Columbus, and Arbor, and this year is Dayton.

So we'd love to have any of your listeners join us for any levels of Rust knowledge. Jake is actually giving an Intro to Rust workshop on the first day. Yeah, we've done a few conferences over the years and that's always been a strong component of them as an attempt to make them very accessible to first-time conference goers, as well as people who don't even necessarily know the language. I think you had one more thing that you guys are working on right now, right?

A pretty kind of a big project that you've been working on for Rust and Rust Education. Yeah, so the second thing we've been working on is the Rust in Motion video series, we're Manning. It's a video learning course that we're aiming to get you up to speed on the parts that make Rust the most different from most other programming languages. So the topics we cover in the course that we think make Rust the most different.

We do a unit on syntax and basic things. Things like variables are immutable by default in Rust and the way you call functions and have structs. And the second unit is on ownership and borrowing, which is a huge difference with Rust that very few languages make an explicit first-class idea. And what this is that in Rust, there is one owner of every piece of data.

And when that owner goes out of scope, then the data gets automatically cleaned up. So this is the part of Rust that lets you not have to have a garbage collector running while your code is running and cleaning up after you. And also not have to manually think about where you should call free, like you have to see, which everyone gets wrong and leads to problems like cycles and use after freeze and things like that. And borrowing is how you can, the owner can let other parts of code use that data without taking over the responsibility of cleaning it up.

Most languages don't have that. There are some that do C and C++ have concepts of ownership and borrowing. And then the thing that Rust adds on top of that that is basically you need to rust. There's a few research languages is this concept of lifetimes where the compiler checks and makes sure that the way that you're using this borrowed data is always valid.

You're never going to get into a case of memory on safety. Where you borrow something and then it's been cleaned up, like the compiler makes sure that you aren't doing that. So all borrows must be shorter than the lifetime of the actual data you're borrowing. So I'm most of the way through the Rust book.

I'm actually on, is it lifetime annotations? Is that the correct name? Yeah, yeah, so chapter 10. Yeah, yeah, that sounds about right.

I'm at the point where I feel like my brain is full or needs like more exercises or things like that. So I'm kind of excited to check out Rust in Motion and maybe a few other things to kind of like layer on top of my work through the Rust book so far. One of the goals with Rust in Motion was to cover this different stuff because we've watched a lot of people who are good at picking up new programming languages. Are you soon just being able to pick up programming and just pick up the docs and kind of start typing and get into rewriting their favorite problem and be off and running with Rust.

They try and do that same thing and they hit this brick wall and they kind of freak out because you really have to stop and think and understand what the bar checker is doing and what it's protecting you from and what it's telling you with the error messages. There's a lot of work put into the error messages. So I think sometimes people don't read the error messages because they're used to error messages not being helpful. But when Rust, they're actually really great.

I think that even those super helpful messages, like even if you don't know the terms in that error message, you're still gonna start a little bit if you don't know what lifetimes mean or ownership means. I can't really use the phrase and it's a common one among the community of finding the bar checker. I understand it. I'm always a little disappointed by that choice of words because like the truth is it is the compiler is attempting to help you.

It's trying to say, hey, this thing that you are attempting to do could introduce security vulnerabilities to your code. Hey, this thing you're trying to do might crash in production. You don't want to do that. And it's really it is like you're having a nice, well-reasoned discussion with the compiler.

With your pair, your pair programmer. Right. They're always right. They're right 99% of the time.

But the vast majority of the time, they're right. Which can get a little annoying. They're really trying to help. Yeah.

Jake, you mentioned the Rust community and there's a fun word or name that's used to describe the Rust community. Do you know, do either of you know if there's a story behind that? Or so what is the word for Stalin? Is there a story behind where the name came from?

The word is Rust station. And it's kind of like crust station without the seat. Our fun mascot is Ferris the Crab, who is a Rust station. I'm not really sure of the origins of it.

I think we were just looking for a fun name and someone suggested it and then someone drew a cute crab. And there we are. So speaking of the community and other users, what are some examples of interesting uses of Rust or like Rust in production in maybe big deployments or maybe like innovative or unique or interesting ways? So the most obvious example of Rust in production is through Mozilla in the Firefox browser.

And it's the most obvious because Mozilla is a huge sponsor of Rust. Rust came out of Mozilla research now. And if you remember two years ago, when Firefox released Firefox Quantum. And that was the first public release that had Rust as part of the browser that everyone was running at that point in time.

And they integrated Rust into the, it's called Stylo. It's the part that parses the style sheets and deals with styles inside the browser. And they were able to be very free about using references and especially using references in multi-threaded context. And because of that, they were able to get pretty sizable speedups in that portion of Firefox.

And Firefox still has quite a lot of CNC++ codes. So it's not by any means all Rust. But the pieces that they have been able to port to Rust have gotten really sizable and noticeable gains. As you spend many years as a software developer, speed is great.

And like delivering that thing the first time is great, but then maintainability is always a concern, a question and can be a big problem. If it's not kind of planned or thought about, what is, or how do people talk about kind of the maintainability story with Rust? I compared to C++, it's way better. A big part of that I think is Karga, which is the build management and package manager of Rust, which lets you add dependencies really easily, way more easily than in C++.

So that lets you break your program into lots of little components, which can be easier to maintain than one big monolith. And I think the compiler being a constant kind of pair to everyone who works on a codebase, I've heard this anecdote from a lot of companies is that more junior developers are, you can trust them to write Rust because the compiler is always checking that. You don't have to review their code quite frankly with more senior developers too. Like you don't have to review the code quite so carefully.

You can review it for like logic problems, which are still very possible in Rust. But as far as like the memory things and security vulnerabilities and side faults and crashes, that sort of thing, the compiler, so if you, it compiles, then you know the compiler instructs all of those things. So it makes it a lot easier to bring more people in and more people over time because the compiler is like constant and it really helps out. And then what Kel was saying about crates there, like Rust definitely is on that side of let's push a lot of stuff into the ecosystem.

And there are some people that are not big fans of this concept. Might go to example for this, that always kind of surprises people is Rust, the standard library does not have any mechanisms for generating random numbers. Random numbers is actually offloaded to a, I'll say third party crate, it's a crate that's maintained by people that are close to the core ecosystem of Rust, but still it's just a crate that is distributed on crates. I know there's been a lot of work recently in futures, for example, with Rust.

And all of that work has mostly been in the third party ecosystem. So there's a lot of, do lots of little things, some of the work from Firefox, like there's a URL crate and I'm pretty sure that that came out of the Firefox work because they're like, you know what? Everybody needs URLs and we are really good at URLs because we do web browsers. So they're like, let's make that public.

And that's part of that community there is trying to share and trying to have good quality. And that's helped, I think, with maintenance as well just because people are cognizant of that. This is something that we do. We try to make good quality crates that people can use.

Yeah, so that's cool. I actually want to talk more about crates that I owe, but before that, I want to hear some more examples of other companies or other kind of interesting uses of Rust because I think we, like me in the intro in the beginning and you and I have chatted about CLIs and embedded devices and all these other different uses for Rust and I'm curious to hear about some other examples of how those things are being built or who is building those things. Yeah, so a lot of the big end tech companies are using Rust in some projects. Amazon recently announced their Firecracker MicroVM, which is written in Rust.

Google is using Rust for their Fuchsia operating system, which they're still kind of secretive about what they're doing with it, but it's open source. So you can like, oh, see it. Sell myself. Yeah, so you can see that it's written in Rust, but we're still not sure what they're doing with it.

Facebook is using Rust for a number of projects. They've written a Miracurial server in Rust that can handle their humongous monorepos. They recently announced Libra, their blockchain cryptocurrency is written in Rust and actually a fun trivia fact. There was recently a congressional hearing where a representative asked an executive from Facebook about why they were using the nightly Rust compiler and what features they needed the nightly compiler for.

And which is, this is like a very technical detail. And so this came up in congressional text running because they are related to using Rust on Libra, which is aiming to be like a global currency. Rust has proven to be a pretty strong case for blockchain. In general, there's quite a few projects that are fairly large and fairly immature with regards to blockchain technology.

So I think that's a very interesting thing about Rust. Actually, I thought you were gonna say, I thought you were gonna mention something about like WebAssembly because Visual Studio Code's still an electron app, which is written in JavaScript. To my knowledge it is, yeah. I thought you were gonna say they re-implemented the search in Rust to make it speedy.

Can you speak a little bit more? Do you know of any examples of useful and real examples of Rust and WebAssembly and JavaScript being used? The most real one that I'm aware of, and I don't know exactly where they are in the process, is the Ember framework has at its core, it's called the glimmer engine, I believe. And it's kind of a diffing algorithm.

And that is a piece of that library that is 100%, like needs to be performant, it's at the core, it doesn't touch any DOM, really, it's all pure data structurally. I know that there was a lot of effort to get that in Rust and then compile the WebAssembly. I don't know exactly how far they are on that. Obviously with a library like that, you're gonna have the issue of, WebAssembly is a newer technology.

And so if you start making that decision, then you have to have some amount of fallback capability for all the people who may not have the WebAssembly enabled browser, for whatever reason. Yeah, I haven't done too much WebAssembly myself, but Rust is one of the few languages that can target WebAssembly. If you have a choice of what to write your WebAssembly, I would highly suggest considering Rust. But in general, WebAssembly is a really exciting technology.

If people out there have seen Gary Bernhardt's JavaScript talk, I'm not sure if you're familiar. That's not, it's different from the WAT talk, right? Yes, yes. It's a different talk where he predicts that the browser will become the operating system and you kind of run everything within the browser.

And that's kind of what WebAssembly is doing. So he kind of predicted WebAssembly in this like joke talk where he misrances JavaScript. It's incredible. One other thing is that even that's called WebAssembly, the actual virtual machine there is across platform and conceptually can be used for lots of different things.

So I've actually also heard of there's Linux kernel, I believe a module that allows you to write WebAssembly that then gets read inside of the kernel. I think some of the blockchain technologies as well actually use WebAssembly as kind of their base layer for when you're writing blockchain-based applications, they actually get compiled down to WebAssembly. So it's not necessarily WebAssembly is not only the browser. It obviously has Web in the name, but it is an assembly language and can use in lots of different contexts.

Is it the new JVM? That is, I've heard something like that because the idea is, you know, you've got a set of assembly mnemonics that fit and there are interpreters that you can run it. This time, this time it really makes something cross platform. Well, let's jump back to Rust and the cargo utility and crates and specifically like crates.io, which is a project that you're one of the maintainers of Carols that write.

Yeah, yeah. So crates.io is kind of like the npm.js or the RubyGems.org of the Rust world. It's the package registry website for open source packages. The backend is written in Rust.

The frontend is Ember and it runs on Heroku. Nice, that's cool. So many people probably don't know that you can run Rust on Heroku. Rust is, I guess it's not one of Heroku's officially supported languages.

No, it's not. We have to use an unofficial build pack. So maybe Heroku can get on that soon since so many other cool people are using it. Maybe you can join us and join Heroku and help me be the dedicated language engineer that makes deploying Rust on Heroku a smooth process.

It's pretty smooth even with the unofficial build pack because the build pack like installs Rust gets the right version then calls cargo which downloads all your packet. Actually, this part is really meta because when we build a new version of crates.io, it downloads the packages from crates.io and then builds them and then into a single executable, or actually we have multiple executors, but the main server is one executable and then we have a bunch of utilities. And then you just kind of run that executable and then your server is running. Is that using any popular Rust web framework?

And if so, like what is, well, I guess in general, what are some of the advantages of using Rust for an application like this versus using say Python or Node or Ruby or Go? Because Rust is so young, there isn't a Rails for Rust yet. There isn't like one good web framework yet. There's lots of like pieces of web frameworks being worked on and different ideas being experimented with.

Crays.io was probably one of the first web applications written in Rust so it uses this framework that I don't think anyone else uses and no one else should use because it was pretty much written for Crays.io and it's not even, I wouldn't even call it a framework. It's like barely a small layer over the network code stuff. So. But there are a bunch of different web frameworks that are kind of, yeah, different stages of maturity and different levels of use.

One of the most popular ones is called Rocket. It has a pretty amazing developer experience when you're using it. It's biggest downside right now is because the maintainer really wants to have such a wonderful developer experience that they require usage of Rust's nightly builds because there are features that they want to use that are not yet stabilized. There's a couple other big ones.

So the Rust playground uses an iron framework. There's another one. If you've heard of the Tekken Power benchmarks, Rust tends to place pretty highly in those. And one of the ones that does really well there is called Actix web, which is an actor-based framework built on top of another library called Actix.

With the recent stabilization and continuing stabilization of futures in a sink away, I think there's going to be a big renaissance in web frameworks. And people are looking for things to try trying these new ideas, like Carol mentioned, experimenting, figure out exactly what style works best with Rust code. A lot of the existing frameworks have copied ideas from other languages, which is a great place to start. But then you need to explore within how idiomatic Rust code works and how does it work in a strongly typed language versus a dynamically typed language.

And what is just the right way of putting together these types of apps? So I think there's a lot of experimentation still going on. Yeah, so if you're looking for a really easy, smooth kind of Rails experience, I would wait for writing a web up in Rust today. If you are excited by experimentation and trying new things, and maybe you want to try writing your own, and maybe you want to try writing a piece of Rails is made up of so many gems, so there's an opportunity for writing a piece of what might become the Rust web framework.

So that sort of thing excites you. This is a great time to get in and try and experiment. What is, I think in the Rust book, the first bigger, maybe non-trivial thing that you have the readers create is a CLI, is that correct? Yeah, the mini-grap project.

Yes, yeah. It seems like CLI's are a good fit for Rust. Not just in general, but kind of in the state that Rust is at right now also. Are there any CLI's that I would or others would recognize that are built in Rust?

So ripgrap this one. Right, yep. Zola is a static site generator that's written in Rust. Oh yeah, yep, I think I saw that, okay.

There's like a lot of little ones. The reason that Rust is a great fit for this is it's cross-compiling capabilities. Whereas if you wrote a command line tool in Ruby because it's interpreted, you would have to make sure that the person you're sending the tool to has a compatible Ruby version installed. Whereas with Rust, you can cross-compile and then just hand off the binaries.

Yeah, which we kind of alluded to earlier with deploying of Quits I-O, but Rust is a, everything gets statically linked at build time. And so when you have this thing, it is just a single executable that you're very likely to pass around. And I've heard some from people who were writing kind of some smaller tools for like their own companies. And they were like, I actually just checked it out on Windows and it built the first time.

And I didn't ever think about it until somebody asked if there was one to download. So like, that's a really powerful ability. Now, I mean, you can opt into platform-specific things and say, well, I want to make use of something Linux-specific or Mac OS-specific or Windows-specific. And then obviously you have to deal with that at some point.

But Rust, the standard library is fairly cross-platform and most libraries, except for ones that are specific to a platform, tend to be pretty good at being cross-platform as well. Speaking of cross-platform and cross-compiling, Rust is also good for writing code for embedded devices. But Jake's actually done way more of that. I mean, so I've played with Arduino and this little device called the ESP8266 and ESP32 that has Wi-Fi stuff.

Are any of those devices compile targets, I guess, or the processor on those compile targets for Rust? So the biggest one right now, generally when people kind of say embedded in Rust, they're talking about the Cortex M3 ARM processor. That's pretty much the best target right now for Rust. To me, that chip ends up being a little bit more than embedded, it's got all this space, it's got all this abilities.

I'm interested in Arduino, like you mentioned, using the EVR processor. Unfortunately, right now, Rust is built on top of LLVM and LLVM doesn't actually have great support for those chips. And so I'm actually part of a project that, in my copious free time, I try to help where they are supporting that inside of LLVM with the intent of getting it into Rust. And so every few months, we update the compiler and try things and figure out where new bugs are.

But that's my end goal as well. I think the same thing is kind of true for the ESP that you mentioned. The VM support for it is not super great. And I think there's another pair of local people who are working on getting that support, as well as getting support in Rust for it.

It's funny because most of the work is all in LLVM. Basically, the amount of work inside of Rust is supporting your platform, at least for the ones that I've seen has been very minimal. It's basically telling what LLVM settings to use in your 90% of the way there. I mean, one thing that seems interesting, too, is I sometimes think of Raspberry Pi as not embedded, kind of cheating embedded, because you get this whole Linux environment or OS to work in.

But it seems like a $35 Raspberry Pi still has constrained memory. Like you're still limited to a gig or actually, I guess, two or four gigs now with the new Raspberry Pi 4s. But they have GPIO pins, and people do very often use them in projects that are kind of more associated with embedded work. But it seems like that thing still has constrained resources.

And so using Rust for those types of projects would still be valuable and useful in using constrained memory, but also officially using that CPU that's on the Raspberry Pi. Yeah, and when you start to get into the beefier hardware, like you're talking about, there are some operating system projects in Rust, the most well-known is called Redox. But there's actually a really great tutorial about creating your own operating system in Rust. The person producing is called FillUp.

And I forget if that's their online name or their actual name. But you could do something like that with a Raspberry Pi, where you basically, you are the entire operating system. That's the best way of getting as much memory as you can, right, is don't let anything else run whatsoever. But yeah, one of the other benefits of using Rust for a web service, there's some of the white papers on the Rust website talk about this, but there's web services that were written in Java using 8 gigabytes of memory or something like that, and it was rewritten in Rust.

And now they take on the order of 50 or a couple hundred megabytes of RAM just through the ability that you get. And so that kind of thing would also apply on something like the Pi. Just you'll be able to make much more efficient use of your memory and those resources. And even on Heroku, I used to work for a company that ran in Rails app on Heroku.

And there was just a base amount of memory that Rails always needed. And we would hit memory limits, and we'd have to bump up to bigger dinos. And with Christiio, I sometimes just look at our graphs at memory usage and I laugh because it's just so tiny compared to what a Rails app uses. The stat there is that you actually pay more for law.

Paper trail for storing our law than we do for dinos. Wow, yeah, so you can say learn Rust, save money. So we've talked about something that Rust is good for. What are some examples that Rust is not a good fit for?

So I think Rust isn't great for prototyping, and just writing something real quick that you just want to run once or twice, or you're doing a demo, or you're trying out an idea, and then you're going to rewrite it for production later. Like maybe Ruby or Python or something like that. If you're going for pure development speed, and if you want to ignore the things that the compiler is trying to help you remember, then Rust will get in your way a little bit. I think it's good, and I do use Rust to prototype because often prototypes end up in production, but it can get in your way.

I think Rust also has kind of that chicken egg thing going on right now. If you want to do some machine learning, right, hands down basically people are going to use something based on top of Python and a bunch of under the hood tools. And so if you want to do that in Rust right now, it may not be pragmatic. Yeah, the ecosystem's definitely still growing in a lot of areas.

So it might not be like in Ruby and JavaScript and Python, there's probably a library out there that will do what you want to do. There's probably 10 of them in Rust. There might be half of one. We'll get there.

It's still early. It's always driven by somebody who says, it's almost there if I just put in that little bit of work to get the next thing. Or wow, if I wrote this in Rust, then I'd get all this other benefits. Let's go ahead and bite the bullet.

There's genomics companies out there who are like, we can process that much more data if we do Rust more pervasively than what we're currently doing. Let's go ahead and try and get some of that ecosystem out there. Let's go ahead and encourage some of these great authors to expand on this or that. If your code is working, if you have code written in some other languages, working is doing what you need to do.

It's making you money. Absolutely do not rewrite it in Rust. I want to be very clear about it. There are people who go around saying everything should be rewritten in Rust.

We disagree with that. When Rust benefits would be useful to you, we encourage you to look at Rust. And there are foreign function interfaces that can help you incrementally rewrite in Rust because wholesale rewrites are always risky. Don't use it just for the sake of using it.

Have a reason to use it. We talked about a few learning resources, but what are some other resources or what's a good path you would share with someone who's interested in learning more about Rust and potentially learning to be proficient in the language? Yeah, so we talked about the Rust programming language book. There's also programming Rust is the O'Reilly book.

And I've heard there are good compliments to each other. So if one doesn't quite resonate with you, the other one might. Rust in Motion, the video course, if you like video learning more than that. If you like trying out code and learningly code, there's Rust by example is an official resource.

There's also Exorcism, which gives you little programming problems to try and then you submit for review, which is good for lots of languages, but there's also Rust track. I started a project a long time ago that I've since kind of passed on to the community called Rustlings. And it's lots of little pieces of Rust code that intentionally don't compile to give you that practice of reading compiler messages and trying to fix them. So you're given this code that's broken and your job is to figure out a way to fix it.

I like that. It's always easier to jump into solving problems than to starting with that blank page that you have to start writing from. Also, the Rust cookbook is kind of trying to be like, I want to parse a URL in Rust, how do I do that? And so it gives you kind of a little recipe of how to do common tasks like that.

For the different areas like embedded and WebAssembly, there are books just for those areas. So documentation has always been something really important to the Rust community. We're really proud of the work that's gone into documentation and that we see documentation as a first-class citizen as an artifact that we need to produce or else, like the technical, if you can't explain how to use something, it doesn't matter how technically great it is. So we take documentation very seriously.

And touching on that, we talked a little bit about cargo and that's actually part of cargo. It's a build tool, it's a dependency management tool. It's also a test runner and it's a documentation build tool. And that's all been there since Rust 1.0.

Like, these are all things that we take seriously. And we say there needs to be documentation. There's actually a link that you can add in the compiler that will fail your builds if your public API is not documented. And that's something you opt in for, but it is not unusual to see that in well-regarded crates.

One thing that I remember looking for is idiomatic Rust. Like, I knew I wanted to solve some little problem, but I kind of just wanted a little bit of a nudge or guidance as to like, what is the Rust way to do this? And then, not only do I know it for that thing, but I can also kind of repeat that pattern in other places that are similar. Do you know of any good resources of things like that, or maybe Rustlings is a good resource for that?

Rustlings, I feel like I mostly brought those to be broken. So I don't know if I'd look to that for good signals. But there is the Clippy tool, which is named after Microsoft's Clippy. It's a set of links that are not appropriate for the compiler for a variety of reasons.

But it will do things like encourage idiomatic code. It does find things like, if it notices you've written a floating point number that's awfully close to Pi, it'll be like, hey, the library has this constant for Pi. You might want to use that instead. So it has a lot of hints and nudges and checks for things like that.

And it can often teach you about Rust patterns that you don't know about. In the realm of idiomatic style, there's also a Rust format tool. There's a community agreed upon general style for Rust, and Rust format enforces that by default. It is one of the configurable tools.

So if you are strongly opinionated, that needs to be two spaces instead of four spaces or tabs instead of four spaces, it's kind of you can change. But I've been pleased to see that most people who use it tend to stick basically to the defaults, which gives a really nice ability to read a random piece of Rust code and not have to jump all over with your eyes. That's something that I understand is a touchy subject for a lot of people. That's my code style.

Don't touch it. But I'm appreciative that there's mostly a standard. Cool. Well, thanks for joining us for the CODIS podcast.

I just wanted to mention Rust in Motion, your video series, video learning series again. And we'll have more details about that in the show notes. Are you guys still working on that? Rust in Motion?

It looks like it's ready to be used and consumed by people. But it's also still changing and expanding over time. We've finished the first draft of the content. It's still in Manning's Early Access program.

So it still might change a little bit. But all the content is now there. Cool. Well, thanks very much for joining us on CODIS, Carol and Jake.

And also, if you want to check out Carol and Jake's video series, the Rust in Motion video series to learn Rust, we've got a 40% off coupon code here. It's PODIS19, P-O-D-I-S-H-19, all one word, all lowercase. So yeah, check that out. It'll actually get you 40% off on anything from Manning publications who they partnered with for the video series.

Thanks for joining us for this episode of the CODIS Podcast. CODIS is produced by Heroku, the easiest way to deploy, manage, and scale your applications in the cloud. If you'd like to learn more about CODIS or any of Heroku's podcasts, please visit Heroku.com slash podcasts.

PodQuesting Dwight J Randolph- WolfShield Media PodQuesting: -By WolfShield Media and Dwight J RandolphJoin us on an exciting journey to master the world of fiction podcasting! At PodQuesting, we document our quest to improve and innovate, sharing valuable insights, strategies, and behind-the-scenes tips along the way. Whether you're an experienced podcaster or just starting your first show, our podcast is your go-to resource for everything podcasting.Discover practical advice, creative techniques, and lessons from our own experiences as we explore the ever-evolving podcasting landscape. Ready to level up your skills and embark on this adventure with us? Tune in and join the quest!Have questions or feedback? Reach out to us at [email protected] and visit our website:WolfShield.Media The PFN Cincinnati Bengals Podcast Pro Football Network The PFN Cincinnati Bengals Podcast is where you can stay up-to-date with the latest news and analysis on the Cincinnati Bengals! Our hosts, industry experts Jay Morrison and Dallas Robinson, provide weekly coverage of all the latest rumors and updates about the Bengals. Don’t forget to follow the show to receive new episodes directly in your podcast feed and leave a rating and review to let us know your thoughts. The 48 Laws of Power by Robert Greene (Full Audiobook) Robert Greene Amoral, cunning, ruthless, and instructive, this multi-million-copy New York Times bestseller is the definitive manual for anyone interested in gaining, observing, or defending against ultimate control – from the author of The Laws of Human Nature.In the book that People magazine proclaimed “beguiling” and “fascinating,” Robert Greene and Joost Elffers have distilled three thousand years of the history of power into 48 essential laws by drawing from the philosophies of Machiavelli, Sun Tzu, and Carl Von Clausewitz and also from the lives of figures ranging from Henry Kissinger to P.T. Barnum.Some laws teach the need for prudence (“Law 1: Never Outshine the Master”), others teach the value of confidence (“Law 28: Enter Action with Boldness”), and many recommend absolute self-preservation (“Law 15: Crush Your Enemy Totally”). Every law, though, has one thing in common: an interest in t Mind Force Radio.com Mind Force Radio.com Natural Strength Night is an informative, humorous, sometimes a little raucous, good-time of myth busting and honest training information from the trenches. We strive to help everyone involved with old school strength training (without steroids) to not make some common training mistakes. Along with great information, you'll hear a fair share of steroid bashing, flamingo sightings, breaking goons, iron game history, and honest drug-free training information from various leaders and strength coaches in the field to help you get real results! If your primary training information comes from reading "Muscle & Fiction" magazine we'll help get you straightened out. If you love high-intensity strength training, dinosaur style training and just like lifting heavy weights ... or loved Jack Lalanne, Sandow, Grimek, Peary Rader's Iron Man magazine, Brad Steiner's articles, Stuart McRobert's Hardgainer, Iron Nation, Osmo Kiiha's The Iron Master, you will love the show.On The Rugged Individual, we

Frequently Asked Questions

How long is this episode of Changelog Master Feed?

This episode is 44 minutes long.

When was this Changelog Master Feed episode published?

This episode was published on January 24, 2020.

What is this episode about?

We teamed up with some friends of ours at Heroku to promote the Code-ish podcast so we're sharing a full-length episode right here in The Changelog’s feed. This episode features Chris Castle with special guests Carol Nichols and Jake Goulding...

Can I download this Changelog Master Feed episode?

Yes, you can download this episode by clicking the download button on the episode player, or subscribe to the podcast in your preferred podcast app for automatic downloads.
URL copied to clipboard!