Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

What’s Different About This Book?

This book is an experimental fork of The Rust Programming Language created by researchers at the Cognitive Engineering Lab at Brown University. If you’re curious, this page explains what makes this book different from the original TRPL book. But if you just want to get started learning Rust, then feel free to skip this page and come back later.

Interactive Mechanics

This book introduces mechanics for you to actively engage with Rust while learning. First, you’ll see quizzes like the one below. Try it out by clicking “Start”.

If you get a question incorrect, you can choose to either retry the quiz, or see the correct answers. We encourage you to retry the quiz until you get 100% — feel free to review the content before retrying the quiz. Note that once you see the correct answers, you cannot retry the quiz.

Second, you can also annotate any piece of text to record your thoughts about it. Once you select some text, click the ✏️ button, and leave an optional comment.

👉 Try highlighting this text! 👈

Note: your highlights will disappear if we change the content that you’ve highlighted. Also, your highlights are stored as a cookie. If you block cookies or change browsers, then you won’t see your previous highlights.

Content Changes

This book’s content is mostly similar to TRPL, and we synchronize the books every few months. The biggest difference is the chapter on Understanding Ownership. This book explains ownership using ideas and visualizations that our research has demonstrated can better improve your understanding of Rust compared to the original book. You will see many diagrams like the ones below, which visualize the compile-time and run-time behavior of Rust using Aquascope:

Beyond ownership, we’ve made a number of small edits to the book to target misconceptions observed in the quiz responses. If you spot an issue in a quiz or other part of the book, you can file an issue on our Github repository: https://github.com/cognitive-engineering-lab/rust-book

Interested in participating in other experiments about making Rust easier to learn and use? Please sign up here: https://forms.gle/U3jEUkb2fGXykp1DA

Publications

Thus far, this experiment has led to two open-access publications. Check them out if you’re interested to see the academic research behind this book:

Acknowledgments

This work was partially supported by the DARPA under Agreement No. HR00112420354, partially supported by the NSF under Award No. CCF-2227863, and partially supported by Amazon Web Services. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not reflect the views of our funders. We are grateful to Carol Nichols and the Rust Foundation for helping publicize the experiment. TRPL is the product of many people’s hard work before we started this experiment.