HACKER Q&A
📣 poletopole

Resources for Learning Idiomatic Rust?


I have more or less learned Rust from nostarch's book (which took about a month). However, I am far from being proficient with the language, not because I'm new to programming but because Rust is quite different than other languages I know. Is there a book or resources online that teach how to use the language effectively, such as patterns and best practices or even a cook book with examples?


  👤 bennyz Accepted Answer ✓
I learned Rust from the book as well, the only programming book I actually read cover to cover (though a lot of stuff went over my head, so I am occasionally revisiting).

I found some complementary resources like the following: https://blog.burntsushi.net/rust-error-handling/

https://fasterthanli.me/ has a lot of very good Rust posts in varying levels

There are also some resources that are still incomplete, like the async book (https://rust-lang.github.io/async-book/) and Rust patterns (https://rust-unofficial.github.io/patterns/)

And there are youtube channels like: https://www.youtube.com/c/JonGjengset - He has videos about super advanced stuff (like implement a concurrent hash map), and the Crust of Rust which is more suitable for beginners Another one I like a lot is Ryan Levick (https://www.youtube.com/channel/UCpeX4D-ArTrsqvhLapAHprQ)


👤 Mihalis
If you don't mind watching long videos Jon Gjengset's channel [0] is a great choise.

Then there are two books by Gankra

- The Rustonomicon [1]

- Learn Rust With Entirely Too Many Linked Lists [2]

Also there are three early access books on Manning

- Rust in Action [3]

- Rust Servers, Services, and Apps [4]

- Refactoring to Rust [5]

Lastly, if you're into security you may also like Black Hat Rust [6], also early access.

[0] https://www.youtube.com/c/JonGjengset/videos

[1] https://doc.rust-lang.org/nightly/nomicon/

[2] https://rust-unofficial.github.io/too-many-lists/

[3] https://www.manning.com/books/rust-in-action

[4] https://www.manning.com/books/rust-servers-services-and-apps

[5] https://www.manning.com/books/refactoring-to-rust

[6] https://academy.kerkour.com/black-hat-rust

Edit: formatting


👤 steveklabnik
Co-author of that book here. Thanks for reading. :)

I think overall you are at the part where Rust's documentation is at its weakest. Several people are working on more things here, but really, the basic advice I'd give you is to read and write a bunch of Rust code. The more you read, the more you'll absorb stuff like this. The more you write, the more things you'll need to figure out how to do, which will involve you looking at existing solutions, which will lead you to figure it out.

I wish I just had a second book to point you at, but alas, that doesn't really exist right now.


👤 miccah
I was in a similar position a few months ago. After reading the Rust Book, I felt I knew the concepts but still lacked the experience of writing Rust programs.

That being said, I have found the Rust track on exercism.io the best way for me to become more proficient with the language. It is great working through a challenge, getting mentor feedback, and also seeing how others solved the same problem.