Pine from Aofeisi Quantum Bit | WeChat Official Account QbitAI
How to learn Rust? An article on Hacker News has gone viral.
Unlike similar crash courses available online, this one points out a path to learning Rust through personal experiences.
After the tutorial was published, users on Hacker News also shared their learning experiences.
Finding books and tutorials related to Rust is very convenient, and I could learn even without internet access. I learned the basics of Rust during a long flight without WiFi. It’s indeed a good way to pass the time!
Reading related books and writing code are both essential for learning a programming language, and alternating between the two is crucial for mastering Rust.
Experienced developer Eli Bendersky has written many blog posts about programming languages on his website, including one about his year-long journey learning Rust.
Let’s take a look together.
Recommended Reading List for Rust
First of all, Eli evaluated the Rust-related books he has read in the tutorial.
Programming Rust is generally seen as an introductory book; it was the first book Eli read while learning Rust.
The book provides an overview of Rust and includes a comprehensive reference for Rust 1.50.
Although it is an introductory book, some programming background is still needed, especially familiarity with low-level programming and memory management.
Overall, for an experienced developer (preferably with a C++ background) who knows how to use alternative resources in projects, this book provides a great and comprehensive overview of Rust.
Next is The Rust Programming Language. Compared to Programming Rust, Eli believes this book is a better reference. Although he hasn’t read the entire book yet, he has browsed through its main parts.
This book ranks highly on Google, and many consider it a Rust beginner’s guide, written by two members of the Rust core team with feedback and contributions from 42 community members.
Similarly, reading this book also requires some programming background, meaning the material is useful for developers with various programming backgrounds.
In summary, to read these introductory Rust books, one must have a certain level of programming foundation.
Next, let’s talk about Rust in Action, which is an intermediate book about Rust that includes several important projects in the field of systems programming.
The methods introduced in this book are interesting and suitable for those who have a basic understanding of Rust.
Additionally, it focuses on systems programming and contains a lot of genuinely useful code.
However, the downside is that this book is quite new, and it contains many typos, confusions, and significant mismatches between the code listings and the accompanying repositories.
Finally, let’s talk about Rust for Rustaceans. To conclude, I do not recommend reading this book.
Eli liked some previous videos released by the author Jon Gjengset, but was disappointed after reading this book.
This book mixes materials better explained in the official Rust book and overly specialized content, presenting layer upon layer of text with almost no charts or code examples, and very few compilable projects to do anything useful.
Having understood the related books for learning Rust, it is also essential to practice coding appropriately while reading.
Coding Practice
So how can we practice effectively? Eli also recommends some channels based on his experience.
If you’re starting to learn Rust, you can begin with rustlings, which are small exercises for reading and writing Rust code snippets. Although not very comprehensive, it is quite useful for beginners.
The website is linked at the end.
Next, let’s talk about Advent of Code, which is very suitable for practicing Rust in 2021. It includes 25 problems that instruct you to write code to complete tasks.
By solving the AOC problems, you can effectively learn and practice the programming language.
Eli has completed the first 18 problems, and he mentioned in his blog that he might tackle AOC2022 in Rust again to keep his skills sharp.
The Ray Tracer Challenge book consists of a series of “unit tests” and pseudocode that can be easily translated into any language, guiding us in implementing a ray tracer using a programming language.
While learning a new programming language, we can also build some visual things to avoid quickly feeling bored.
However, the book spends much time explaining why the formulas and pseudocode it provides are effective, which does not help cultivate intuition.
This leads to serious errors when debugging issues. Without developed intuition, the only way to debug is to meticulously compare the code with the pseudocode in the book to ensure nothing was lost or input incorrectly during transcription.
Overall, it is still worth reading.
Finally, let’s discuss Crafting Interpreters. In this book, the author develops two complete interpreters for the language from start to finish, including all frontend and backend parts.
In the book, all the code for the two interpreters is fully contained in the text and presented in segments. There is no need to flip through external repositories. You can read directly and copy the code into your editor to run it.
Eli has high praise for this book, considering it the most practical among many compiler books he has read so far.
In addition to the above, Eli has also conducted many experiments, writing code to explore various fields of Rust.
If you’re interested, you can click the link below to visit his website for more~
Reference Links: rustlings: https://github.com/rust-lang/rustlings AOC: https://adventofcode.com/ [1] https://eli.thegreenplace.net/2022/how-i-went-about-learning-rust/ [2] https://news.ycombinator.com/item?id=32104764
— The End —
Join Our WeChat Group on AI and Smart Cars!
Welcome to join us to discuss and exchange ideas with AI practitioners and not miss the latest industry developments & technological advancements.
PS. Please be sure to note your name – company – position when adding friends~
Click here👇 to follow me, remember to star it~
One-click triple play “Share”, “Like”, and “View”
See cutting-edge technological advancements every day~