I've read 'The Book' and plan to re-read it, but should I read another book after that to get better at Rust? Or would it be better to just start building projects? Right now, the only area I feel lacking in is Async Rust.
Re-reading the official tutorial book can be a bit of pain, as it is quite wordy and verbose. Alternatives are the freely available The Rust Book (Abridged) | The rs Book, or perhaps also my https://rust-for-c-programmers.com/. Jim Blandy's "Programming Rust" was a quite good book for the second edition -- the third edition should be available soon, but the official list price is quite high -- we have to see if it is justified.
My personal view is, that to really learn Rust, one would have to write code in it. After reading a lot, I have still problems remembering all the details of the complex Rust language.
"Effective Rust" (Preface - Effective Rust) is also freely available and is a good book to learn some advanced Rust concepts and get a deeper understanding, but personally for me, I have the impression that instead of reading that book, I should have written some code.
Jon Glengsets book, "Rust for Rusteans" is often recommended as a book for advantaged learning, and looks indeed quite good, but I have read only the first 30 pages yet. The books "Command-Line Rust" or "Secrets of Rust" might be candidates to read as well, both seems to be an quite fast and easy read -- I do not really intend to buy them. I collected a few learning resources at Appendix - Rust for C-Programmers including Quinedots lectures -- unfortunately a few links have changed, so I should update that list.
We should re-think how to write and read book after LLM. So far, reading all books was a clear wasting time for me since now I just ask LLM how to implement this or that feature. So books should just tell me what Rust can do for more accurate asking LLM after.
While I partly agree, it would be very difficult to learn Rust language just by asking AI. It is the same for physics, mathematics, and most other stuff. But yes, if we know the foundations, AI is now a very helpful tool. I can just hope, that kids in school will use the AI for learning, and not only for doing the homework.
I'm similarly in the learning stages, and I can vouch for coding out small projects even if you're continuing to read other resources. I've learned a lot more (and faster) trying to implement functionality and using the standard library documentation, The Book examples, and compiler messages for support than while I was just reading through The Book.
Rust for Rustaceans is a great book that's worth getting... after getting a bit of experience. I'd give a rough guideline of 6 months using Rust somewhat seriously before it's really effective but really it's more about "ok I can use Rust fairly confidently but there's still some things that are weird and annoying... surely there's a better way?"
It wouldn't be wrong to pick it up immediately, to be clear, just most of the guidance might seem fairly arbitrary and hard to memorize without that moment of "oh that's so much nicer than what I've been doing!"
There are many ways to learn Rust. One thing, above all, is a fundamental part of all these approaches: just do it. Reading about a programming language is nice if you want to learn more about specific features. Unfortunately, though, it won’t do you much good if you don’t have a concrete use case where you can apply that feature. Another thing you can do is look at all your past projects and then think about what could be improved in them and how that could be implemented.
Examples
- Right now, my program processes everything sequentially. But if you look closely, you’ll see that processes A and B don’t actually have to follow one another, because, for example, I only need the result from both of them, or the initial value from process A isn’t processed further in process B -> multithreading/parallelization/asynchrony
- I have this one function that only accepts
i32values. However, it would be better if I could use types that tell me why I’m using them there -> Newtype pattern. - I just implemented the same trait for 5 different objects -> macros.
You continue to grow with every new Rust project. At the same time, you can apply all the knowledge you’ve already acquired to older projects.
In my experience, Rust for Rustaceans is a very academic book. It’s helpful if you want to understand, on a theoretical level, how something works in Rust. It’s a good reference book that also covers program architecture. It’s less suitable as a workbook.
The question should be less about “How can I get better at Rust?” and more about “What do I want to implement next in Rust?”
Programming Rust is more an alternative[1] to The Rust Programming Language than a complement. Anyway, it's unclear when the 3rd Edition will finally be available, seeing for how long the publication date has been slipping. If you want / need a second pass on the language, and if that 3rd Edition becomes available soon, I'd still recommend it. Not that the 2nd one is outdated, but I'm not sure it makes sense as a second reading today.
A worthy complement is Effective Rust, already mentioned above. This book really brings home the important notions. You can't go wrong with that one.
Rust for Rustacean is pretty good, too, but it may be difficult to understand without a little bit of practice first. I'd keep that one for last.
Personally, I much prefer that one to the "official" Book. Its 2nd Edition was covering more topics, too, but I don't know if that's still the case vs TRPL 3rd Ed. ↩︎
Once you start getting into the weeds I would recommend Rust Atomics and Locks as well as what has already been mentioned.
Where did you get 'The Book' programming in Rust?
It's available online.
What people call "The Book" is The Rust Programming Language (TRPL). The online version is linked on the main website (and above).
Programming in Rust is another book, written by other authors. I don't think there's an online version.
Thanks
I am a little old-school in that I do prefer actual books when learning something new - so I started with the O'Reilly Programming Rust book and have found it to be a great resource and I go back to it constantly. I haven't necessarily compared The Book and PR deeply but I have found topics that Programming Rust covers very well that weren't covered as well in the Book, but then I have also found explanations in the Book that are really helpful. I guess it probably comes back to whether there's a specific area you are focusing on learning more deeply and then you can look to see what resource supports you best.
For a fun and sassy introduction to deeper rust topics, try: