Jump to ratings and reviews
Rate this book

Programming Rust: Fast, Safe Systems Development

Rate this book
Rust is a new systems programming language that combines the performance and low-level control of C and C++ with memory safety and thread safety. Rust's modern, flexible types ensure your program is free of null pointer dereferences, double frees, dangling pointers, and similar bugs, all at compile time, without runtime overhead. In multi-threaded code, Rust catches data races at compile time, making concurrency much easier to use. Written by two experienced systems programmers, this book explains how Rust manages to bridge the gap between performance and safety, and how you can take advantage of it.

619 pages, Paperback

First published November 25, 2015

641 people are currently reading
1343 people want to read

About the author

Jim Blandy

2 books12 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
386 (67%)
4 stars
161 (28%)
3 stars
24 (4%)
2 stars
0 (0%)
1 star
1 (<1%)
Displaying 1 - 30 of 63 reviews
Profile Image for Ben Hughes.
36 reviews
January 18, 2018
Outstanding deep coverage of a complex language that is not easy to learn. I started learning Rust by reading the online documentation, but found the explanations in this book far more approachable, especially on the Rust-unique topics of lifetimes, borrowing, moves, etc. I also hugely appreciated the author's careful attention to showing memory layout of various data structures. Even though these are behind-the-scenes details to some extent, understanding memory layout provides a lot of context to how some of these structures work, particularly when you start talking about the types of references and slices, etc.

The chapter on concurrency, which really showcases the power of Rust's memory safety semantics, was probably the most illuminating. I remember the "ahah" moment I had learning about Elixir's concurrent data pipelines with channels, yet Rust supports this just as easily - and several other concurrency models to boot.

Just about my only criticism is that I thought the chapter on Generics could have used more and simpler examples, to build a better mental model of how they work. I still feel a bit weak on some of the more complex generic type definitions, and will have to read a bit more about this. This and a few other areas lead me to believe that this book is probably better approached by someone with an extensive background in systems programming (particularly with C++), which I do not really have (have only used C++ at a basic level years ago).

Highly recommended to anyone making a serious attempt at learning Rust - a seriously impressive language that has a lot of promise at modernizing systems programming.
Profile Image for Sebastian Gebski.
1,175 reviews1,309 followers
February 16, 2018
I'm truly impressed - this is a one-stop-shop for learning Rust. Period.
Very detailed, comprehensive & descriptive, not easy to grok through, but helps you truly embrace what's behind syntactical constructions that may seem simple, but have a lot of depth to offer (in fact).

It's not the kind of book you're read end-to-end on one go. More like a reference manual you'll keep getting back to each time you reach a higher experience level. I've tried to find any significant flaws that are worth mentioning, but ... I didn't found any - this book seemed to perfectly fit my expectations: I had more in-depth analysis when I needed it, I had graphics & pictures when I needed them, I had more examples exactly when I needed them (as well). I haven't read such a good technical book in several months.

Strongly recommended for all Rust (& system programming in general) fans (current & futures ones as well ;>).
Profile Image for Willian Molinari.
Author 5 books121 followers
May 5, 2021
I'm migrating all my reviews to my blog. If you want to read the full review with my raw notes, check it here: https://pothix.com/programmingrust/

There are many things I like about this book. The first is the comparisons with C and C++ since both authors are/were C/C++ developers. This kind of experience helps you understand how Rust is useful and what practical problems it's actually solving. I always hear about the theory, but the practical examples are gold.
Profile Image for Stefan Kanev.
125 reviews235 followers
June 25, 2021
Pretty good coverage of Rust. A lot of useful stuff and a lot of great detail. Where if falls a bit short is the examples – some of the more complex things are treated a bit too briefly. You'll have to come up with some things to code while reading this book to try out the ideas, otherwise you may struggle with retaining everything.
18 reviews
February 18, 2021
Absolutely fantastic introduction and guide for Rust. I had tried other resources for learning Rust but this one was the most effective for me. I likely need to go through it again, but I will wait for the second edition which is supposed to come out this year!
Profile Image for Shrey.
4 reviews2 followers
February 2, 2024
First technical book I've read cover to cover in a while. It filled in a lot of the gaps from the rust book by going deeper into the internals, laying out the rules explicitly and sharing common idioms that would be hard to discover just from documentation.
Profile Image for BobA707.
793 reviews17 followers
September 22, 2024
Useful compliment to the online Rust resources - the only real problem is the online resources are excellent and quicker to look up things ... but I like having a physical copy and this fitted the bill nicely with some really great worked examples
Profile Image for Jay Cruz.
146 reviews15 followers
February 13, 2022
This book is in depth and it’s meant to showcase Rust as a systems programming language. So the last half of the book ramps up in difficulty, depending on your mileage. If you’ve never done lower level coding, maybe start with official book. But overall this is an excellent and comprehensive guide for the language.
Profile Image for John.
317 reviews30 followers
June 13, 2024
I think I'm sold: for any new coding project where I don't have any other constraints (which, in all due honesty, might have to wait for retirement), Rust will be the language I try to use first. Moreover, while the online book will be my quick reference (https://doc.rust-lang.org/book/ch00-0...), "Programming Rust" will be the definitive one. Let's first talk about the Rust programming language itself, and then consider the book.

Rust, as a programming language

What is special about Rust? In short, it delivers on the promise made in the early pages: fast and safe systems programming with all the nice features of modern languages.

It often accomplishes this "no trade-offs" quality by, when choosing between the apparent either-or choices of programming language design, finding a third option that changes the rules of the game:

* The canonical example is memory management: instead of requiring the user to manage memory, or requiring a garbage collector to run in the background to see what can be freed, memory is simply freed when the variable it is associated with goes out of scope, with very careful rules about how variables move between scope.

* We often have a case where some kind of other outcome is useful, whether there is no result or an error happened. Instead of either elaborately guaranteeing an outcome or creating some kind of null or exception that can be ignored, Rust redefines enumerations so as to be able to attach data, and then uses those to indicate other outcomes, requiring that result patterns need to be checked.

* Instead of either not providing any type abstraction at all, or requiring that to use an abstract type requires the performance penalty at runtime, the default behavior is to find all the implementations of the generic trait that might reach the functionality in question, and compile versions of all of them.

* Instead of restricting itself to being a functional language or giving up on all of the functional-language favorites (map, filter, fold, etc.), it defines them as extension of iterators, and then goes full-bore on supporting iterators everywhere possible. By everywhere, I mean that the only definitions of _for_ loops work on iterators.

In addition to the smart "third-way" choices of the language, the basic development experience is exceedingly nice. You do basically everything with cargo, which provides package management, syntax checking, testing, documentation generation, formatting, publishing, and so forth out of the box. The result is to feel like hypermodern, robust Python without requiring the additional army of additional tools cluttering version control and deployment pipelines.

"Programming Rust", the book

"Programming Rust" this book is not only a reference: I read all of it except to skim the last two chapters (on unsafe Rust and cross-language library support). That is not to say that some sections didn't read like a reference. After some brief motivation and a broad tour based on some very nice sample programs, the sections on fundamental types, ownership, and references push the basic expressions of the language back, so that it takes almost another hundred pages before we see the humble _if_ statement.

However, from expressions onward it takes on a much brisker though no less inclusive pace, first covering the language-like features of error handling, modules, structs, enums, patterns, traits/generics, operators, closures, and iterators. It then transitions through collections and strings into a section that has more of a systems-programming feel, including I/O, concurrency, asynchronous programming, macros, unsafe Rust, and foreign functions.

Occasionally, some of the latter material feels more reference-like (I am looking at you, built-in Traits and Operator Overloading), but for the most part, the exposition is really compelling. The chapter on modules and crates is particularly good at showing you all kinds of essentials not covered in the online book.

Now, is "Programming Rust" a suitable first introduction to Rust? Is it a good first tutorial, or even structured well enough as not to confuse the reader by using concepts long before they are introduced? I honestly don't know, as that wasn't the way I read it. Having said that, I wouldn't be afraid to try, knowing the online book is still there for a second opinion.

Conclusion

Overall, Rust is a titanic achievement in programming languages and this book is a wonderful way to appreciate it.
6 reviews5 followers
January 15, 2018
This is a fantastic book and a must read for anyone looking to push their Rust skills forward.

My background is mostly in dynamic programming languages such as JavaScript, Racket and Python. After doing a course on Operating systems as well as from NAND to Tetris - Building a Modern Computer, I've really started to appreciate programming with full transparency into the memory. I've written C and C++ but never felt any confidence... in fact I always "feel lucky" when the programs work. This is completely different in Rust. Rust has the memory safety and the explicitness to get you into Systems programming safely. The compiler pair programs with you and constantly nudges you in the right direction. This book helps you get on your feet in Rust extremely fast. The introduction is a concurrent/parallel Mandelbrot fractal image generating program!

This book drastically lowers the difficulty of Rust with very good explanations and analogies. Thanks to this book I feel Rust is quickly becoming my most productive language. This is thanks to the extensive chapters on important Traits and the explanations of asynchronous and concurrent techniques.

If you're looking to start your Rust journey or get a fundamental grasp of the language, don't miss this book.
Profile Image for Julio Biason.
199 reviews28 followers
May 22, 2018
First off, this is not a book for learning Rust: This is a Reference Book. A good one at it, but not for learning.

My inclination to learn Rust is how it deals with errors (it's
Result
enum), something that most languages seem to drop out of context or accept some "catch all" which let developers ignore such errors. Rust doesn't; you have to deal with errors.

And, in such small thing, which I thought it was very simple and straightforward... is not. The
Err
part can be very complex, specially if you want to keep in line with the rest of the system. Which is good.

Although a good book, it's not great. The explanation for generics is very convoluted and complex and doesn't help grasping the whole context -- maybe it's easier if you're already working with a language that has generics. And then, when you are almost getting how they work, they throw lifetimes in it and the confusion grows.

Several topics are started and then become "beyond the scope of this book". So it just brushes some pointers at it and then completely forget about it. I, personally, would drop some of those -- it could mention that they exist -- and expanding for not being "beyond the scope of this book".
Profile Image for David.
134 reviews22 followers
February 10, 2023
Done! If you were stranded on a desert island and could only have one definitive reference guide to Rust (and for some reason felt like learning some programming before you starved to death) this would be it!

The writing style is top-notch and dives into the "why" behind many language features, as well as provides you with well thought out (and usable) code examples. Despite it's length (700 pages!) it's a smooth read with excellent prose.

Comparing this to the community's familiar book "The Rust Programming Language" it is a better book. Many features are taught more clearly: lifetimes, traits, iterators, collections, raw pointers, and working with external programs. Maybe the nod goes to the "The Rust Programming Language" on concurrency and borrowing/ownership concepts, though the latter is brought up so often that it makes up for the lighter overview of the topic in the early chapters.

"Programming Rust" is probably the best reference guide now for Rust because of what it covers that the earlier books have not: asynchronous programming. The way it dissects futures, polling and pinning serves us much better than simply showing how to use asnyc/await.

This is an excellent resource on Rust; well worth the time and effort.
Profile Image for Тим.
17 reviews
January 2, 2022
Nice and concise overview of the complex language, I enjoyed reading it and would also keep it as a reference that has got more detailed explanation than, e.g. Rust book.
Profile Image for Marko Kunic.
20 reviews1 follower
April 8, 2019
If only I started my pet project after this book I could have saved hours. Awesome book with great examples, you have to read this if you are interested in Rust.
Profile Image for Bugzmanov.
231 reviews92 followers
November 26, 2021
Read this as a refresher. For some reason liked it more than the rust book. It's thick but very captivating.
Profile Image for Peter Aronson.
395 reviews18 followers
February 10, 2022
Four-and-three-quarters stars; review applies to the 2nd Edition. This is a damn'd thick, square book, and honestly, it could easily have even longer than its 700+ pages, and I would still have read it cover-to-cover and not regretted it.

This book serves both as a reference book and as a tutorial -- and I was glad I had a print copy as I was frequently flipping back to earlier parts of the book as it definitely builds on what been presented earlier. The Rust language is not a simple language, and this book not contained syntax and behavior, but also some implementation and philosophy of the language and some discussion of its idiomatic use.

Are there places where I would have liked more information? Yes, there are, but given the length of the book, I can see why those topics weren't covered. The only topic I felt was really missing was a brief discussion of how best to write Rust libraries that can be called from C or C++ (yes, that information is available on the Internet, but so is every single other thing in this book). I feel this is at least as important as how to call C/C++ libraries from Rust, which is covered.

One thing that did bug me a little was author's explanation about how much better some Rust feature or another was so much better than what you had to do in C/C++ sometimes sounded a bit like a hard sell to me, although it was probably just authorial enthusiasm. No one writes a book this long without a whole lot of enthusiasm!

The examples are full of nerdy in-jokes and I had fun looking for the references.

Did I learn to program in Rust from reading this book? No, I did not -- because I only read it and did not code along with it. But if I end up working on a project for which Rust is the appropriate language, having read this will have given me a very good start.
Profile Image for Ilya Kalimulin, PhD.
24 reviews
July 19, 2023
I give this book five stars:
- Comparing with the official Rust book (TRPL): I read about owning and borrowing in both books and found that this book gave me a better understanding.
- I managed to read front-to-back fully. So, this means that it is interesting, well written, and with a good balance between comprehensiveness and conciseness :)
- Examples in advanced chapters (concurrent and asynchronous programming) show how to reimplement things from libraries, which gives a better understanding of how it works under the hood.
- The example in the last chapter about Foreign Functions draws a fine case of taking an unsafe library written in C, learning contacts about safe usage (e.g., a lifetime of objects), and implementing a safe interface in Rust. Just to codify contracts hidden in documentation in Rust types and features. These codified contracts will be checked automatically every time a program is compiled! It is an excellent example to finish the book.

I also have some wishes for 3rd edition:
- To separately describe what means `Some(v)` means, why it is needed, and how to use it. This syntactic construction raised questions for me at first.
- To mention in the chapter about traits that there are not only Haskell which has the same functionality, but also more languages, like Swift/JavaScript, just with different names.
- To add related references in chapters to design papers and discussions about decisions about the language and the std library design.
- To write a chapter about language history and evolution will be good. I hope that knowledge of why it was implemented in a way would help to appropriate usage.
Profile Image for Marin.
5 reviews2 followers
March 22, 2020
Excellent in explaining iterators, lifetimes, utility traits, deref coercions... all things that really help you to get a proper grasp of how to use Rust. For me, Rust's rules seemed simple enough at first, but understanding how to decode what compiler type errors are really saying about generic type constraints - and how to elegantly solve such problems - was the most engaging regular challenge in working with the language that this book really helped with.

Written with a certain precision and not overly verbose despite its 500+ pages, it kept me continuously interested. The authors sometimes employ subtle humor in the examples and phrasing that I found occasionally hilarious. I enjoyed reading it cover-to-cover, and referring to it later.

Rust is a continuously evolving landscape, and new constructs have made their way into the language since the time of writing, but most are peripheral enough that simply reading up about them separately is enough (like async/await). Some are hinted at in the text (impl keyword) before they stabilized. Some are mentioned as a good workaround available as an external crate (error_chain) that have evolved (failure) but are not yet finished. The most important parts are unlikely to change radically, though, and this text explains how and (importantly) when to leverage these tools to write pleasant software.
Profile Image for David Castillo.
54 reviews2 followers
April 1, 2018
I started reading this book out of curiosity but started a personal project shortly after and it helped a lot to get up and running.
Rust is a very different language from the ones I'm used to, and so it was not enough to read a short tutorial on it to grasp the basics. Programming Rust does a great job in describing the language at different levels: its philosophy, its syntax, its type system, its famous memory ownership model, and even how many things are represented in memory. Because of that, it can be read in many different ways, and I really appreciate that.
The only thing I didn't enjoy was the constant and plentiful comparisons with C++, as I'm not a C++ developer. If you are, I guess they will help.

During the development of my project, I've also run into other problems like error handling and telling idiomatic code from code that isn't, but I guess those patterns and conventions are not really the book's focus, and that's ok.
All in all this book was great for wrapping my mind around Rust's exotic bits, and I'd recommend it if you'd like to start a project using Rust.
36 reviews5 followers
June 15, 2018
It's a good introduction to Rust. It goes through the language well and introduces the main concepts and the features that makes Rust unique. A also very much liked that the book gives some insight into best practises and things you might not have found yourself in the online documentation.

It is just an introduction though, covering the basics. Some things are covered briefly, like how concurrency is done, and Rust's take at the concurrency primitives. Other things are discussed in needless detail, like going through for each of the collection modules HashMap, Vector, etc, the .insert(..) method which of course behave exactly the same for all collections. Mentioning it once would have been enough - save the pages for more interesting topics.

The book covers enough ground to be a good introduction. I do feel like I've got a much better understanding of how the language works. I also got an understanding of how the common tools work, like how to compile and run the code.
Though of course some things will only be learned by using the language for some time.
I do recommend the book as an introduction.
Profile Image for Jean.
1 review
May 6, 2019
A great resource that takes you from the Rust syntax, its type system, the borrow checker, all the way to “unsafe Rust”, and everything in between.

The examples are clear and to the point, already explained concepts are briefly reiterated at strategic points throughout the book, and it is clear the authors have in-depth knowledge on both C and Rust, allowing them to clearly explain both the similarities and differences between the two.

As a developer who has only worked with higher-level languages before, I’ve come away not only learning Rust, but also with a deeper understanding of systems programming, memory layout, CPU caching, and more.

Reading this book has given me a thirst for more knowledge on functional programming and learning other lower-level languages such as C and C++, if only to get a deeper understanding on why Rust exists, and to validate my belief that learning Rust is an investment into the future of systems programming.

Well worth the read.
Profile Image for Arvydas Sidorenko.
76 reviews
December 15, 2021
“A language with Rust’s ambitions was, perhaps, not destined to be the simplest of tools.”

Rust is one of those languages that have a steep learning curve even for experienced programmers. Even though I write programs on a daily basis for over a decade, I ended up reading this book from cover to cover not skipping even basics, such as how to assign value to a variable. Do yourself a favour and follow the same approach, because the things we think we know too well actually can function so radically different. I can't imagine the pain and frustration it would have caused if I approached Rust my usual way - trial and error.

It's a brick-sized book, but it's also one of the best written books on a programming language I have ever read. Even complex ideas are relatively easy to understand. Also loved their sense of humour. Deep thanks to the authors!
37 reviews2 followers
August 28, 2018
I read this out of academic interest, without much time to actually practice coding in rust.

With the exception of a few parts that dove deep into api trivia (mostly about strings), the whole thing was engaging and easy to read. The explanations of the language features were very clear and felt complete. If I did start programming in rust, while I would obviously still spend a lot of time coming to grips with its complexities, I feel that this book pointed me in the right direction to figure it out.

I learned exactly what I was hoping to learn: what level of language complexity and expressive restriction is required to produce a memory safe language without a garbage collector, and what additional features (concurrency safety) come with it.
Profile Image for Tom M..
29 reviews
July 12, 2022
Excellent and very didactic book to learn the Rust language.

The authors have a consistent and thorough style throughout the whole book. It's not an easy read because the language has a steep curve compared to most others - I'm quite familiar with C++, Java, Kotlin, Python, C#, Tcl, and some other scripting and older languages. But despite the difficulty, each subject is carefully introduced and explained with good and relevant examples. The style is rather relaxed and not empty of occasional humour, but rigorous at the same time due to the nature of the language's philosophy.

I found very few typos and superficial mistakes, none of which making the comprehension any harder. It is one of the clearest programming books I ever read, I highly recommend it.
Profile Image for Francis.
9 reviews2 followers
February 4, 2018
One thing that makes this book stand out is that not only does it tell you what's going on the surface, but also explains why certain things are done or what goes on in the background to enable a feature. For example, in the section on doctest, it explains the prelude that was added in order to convert partial code into compilable code.
Even though I may not be using unsafe block soon, I still enjoyed the last chapter on unsafe code. They showed that the concept of lifetime and contract were already standard concepts in C/C++, but they are managed by programmers. On the other hand, a safe interface offloads lifetime management to the compiler.
Profile Image for Daniel Gill.
15 reviews2 followers
June 27, 2018
This was an exceptionally capable introduction to a very clever programming language. This book is probably intended and best utilized as a reference work, but I found it very profitable to read it cover to cover, and I think anyone learning Rust for the first time will be well served reading the vast majority of this book—really only the final two chapters seem optional, touching on language features (macros & unsafe code) I suspect you'll be able to go without for a while before needing. And after all, when you do finally need to utilize those aspects of the language, this book will waiting for you.
Profile Image for Sean McBride.
21 reviews2 followers
November 28, 2021
This book is specifically for experienced systems programmers coming from C or C++ that want to learn Rust. It assumes mastery of the fundamentals of programming, which makes this book a quick and efficient read for its target audience. This one volume should get you fully up to speed and able to use Rust in new or existing mixed language projects. I read the second edition, which added an excellent new chapter on asynchronous programming. If you know C or C++ and the basics of computer architecture, pick this. If you’re coming from garbage-collected languages / coding bootcamps, go for “The Rust Programming Language” for a book that assumes less prior knowledge.
Profile Image for Aiden.
8 reviews1 follower
January 7, 2018
Amazing walkthrough of Rust. Although I've been aware of Rust for a couple years now, I'll admit that the borrow checker and some of the strange syntax has scared me away from learning the language so far.

This book is simultaneously approachable and deep; it's definitely targeted at experienced systems programmers which is exactly what I was looking for. It strikes a great balance between holding your hand through more advanced concepts while diving into the deep end of the language's powerful features without spending much time on the assumed prerequisite knowledge.
Profile Image for Pablo.
2 reviews1 follower
August 25, 2024
Great for experienced developers

If you’re new to Rust, but not to programming, and in particular to C/C++ on Unix, this may be a better resource than the “official” book, The Rust Programming Language, since IMO it makes a better job at describing all the language features from a C point of view, while TRPL is more “abstract”. It’s not low-level but it makes it a bit easier to understand what’s going on under the hood, and includes lots of small but realistic and functional examples to showcase the features.
Profile Image for João Paiva.
44 reviews6 followers
May 28, 2023
One of the best technical books I've ever read. It is very comprehensive, and took me a long time to complete. But this is also what I like about it: explanations are very complete, usually include examples, and often have some repetition to really drive their point through. Overall I really recommend it as a follow-up to the rust book, or even potentially as a complete replacement if you have the time.
Displaying 1 - 30 of 63 reviews

Can't find what you're looking for?

Get help and learn more about the design.