Rust is gaining popularity fast, and is a language loved by many (including myself). It has recently been used for device drivers in the Linux kernel. While many early adopters did more low level code, it is gaining popularity in higher level problems as well (e.g, writing REST APIs and CRUDL database applications). You might want to learn Rust, and wonder about some resources to use. That is exactly what we will look into in this article! While books are the main topics, links to other useful resources are also provided.
You might also want to check out my other posts on Rust, like this list of what I love about it!
As an Amazon Affiliate I make commissions on qualifying purchases. The links to the books below are affiliate links (images and titles).
The Rust Programming Language by Steve Klabnik and Carol Nichols
What is it about? This book teaches you the complete basics of the language, its syntax and how to solve various problems. Concepts include the build tools, the ownership model, pattern matching and more.
- The book itself, available online officially (for free in HTML). Yes, the book is available for free. It might change at times, and differ slightly from the physical (and Kindle) book releases. If you don't have a lot of money at the moment, it is good to have it for free (legally!).
- rustlings. Interactive exercises on the basics of Rust. Works great as a supplement to the book!
- Rust documentation. For when you are unsure on concepts. (not necessarily good as a standalone resource)
- Let's get Rusty. Videos with walkthroughs on basic concepts, changes from version to version, libraries and more! People new to Rust will probably want to watch A Tour of Rust.
Who should read it? People who want to learn the Rust programming language, but who have written in another language before. If you are clever, you will probably be able to pick it up without knowing other programming languages as well.
Rust Brain Teasers by Herbert Wolverson
What is it about? Various small problems that might have unexpected results. If you have read something like Java Puzzlers there are certain similarities. While the title makes the book seem advanced, it is really not. That is also the main complaints people have with the book. If you are not super experienced with Rust, and fairly new to it, you will probably learn a thing or two. Some of the problems might be obvious, and if not you will hopefully learn something new.
Additional resources: See the suggested resources for the previous and next entries :)
Who should read it? People who have read the previous book (or learned the basics in another way), and want to look into code examples that might at first seem peculiar. If you are a group of people learning Rust, this book might be fun to read together. You can look at the issues, and guess together what will happen.
Rust for Rustaceans by Jon Gjengset
What is it about? Now that you know the basics of Rust, it is time to go deeper! Yes, exactly that. This is a book for intermediates who want to learn more advanced concepts needed to be a more professional Rust developer. Some topics covered include:
- Writing good idiomatic Rust code
- Ideas on how the compiled code will look and behave, considerations to be made etc. Useful to understand that the compiler is in fact a compiler, and not magic…
- Different perspectives to understand the ownership model. (also relating to the previous point).
- Concurrency (async/await) and parallelism.
- Macros, both declarative and procedural. This was one of the selling points for me, as I had been missing macros a lot from my time coding various Lisps.
- Unsafe Rust and Foreign Function Interface (interfacing with non-Rust libraries)
- The authors YouTube channel. Contains deep dives into many different concepts in Rust. If you like to watch videos, his Crust of Rust series goes into some of the concepts from the book (e.g, unsafe Rust, macros, and concurrency). There are also various walkthroughs of projects, videos on implementing specific concepts, and just more casual Q&As.
- Let's get Rusty. I know I mentioned this one above as well, but it provides good videos on Rust for both beginners and intermediates. For people who are more well versed in the language, there are videos on specific libraries and more advanced concepts. There are also videos that goes through the new features in new versions of Rust.
- Low Level Learning. YouTube channel about mostly low level coding and embedded devices. It has a lot of nice videos on embedded Rust, and good practices for writing better and more idiomatic Rust code.
Who should read it? People who want go deeper into the concepts of the language, and also understand how everything works. There can be many reasons you may want to read this book, some of them include:
- You are an API developer who want to know better how to write your APIs and related code.
- You write embedded code and need an understanding of unsafe Rust.
- You want write a Foreign Function Interface for a C/C++ (or similar) library in Rust, and therefore need to understand unsafe Rust. You might also want to write a crate wrapping the unsafe code into "safe" operations and need more details on how that should be done.
- You want to understand how concurrency and parallel programming work in Rust. Not just the complete basics, but how the scheduling etc. might work.
- You want to work with Rust as a professional, and therefore want deeper understanding to make yourself more attractive in the job market.
Probably more as well, but if you feel close to any of these points, then I would recommend reading the book (and/or looking into the resources specified above).