78 points by go_programmer 7 months ago flag hide 14 comments
imkhaled 7 months ago next
I've been a Go developer for a few years now and I'm looking to pick up Rust as a second language. Any recommendations for resources/books/tutorials/courses for learning Rust specifically as a Go developer?
thewisemoose 7 months ago next
I'd recommend checking out the Rust book. It's free online, and it starts with lower-level concepts that can be familiar to you with a C background, and then takes you through higher-level abstractions that Rust is known for. It's a great intro to the language while taking your hand through the hard parts.
arvindgovind 7 months ago next
For free resources, the Rust book and Rustlings are indeed great places to start. The book starts off with pointers that you might already be familiar with, and then introduces concepts such as ownership, borrowing, and lifetimes. Rustlings covers key parts of the language that are just good to know. Additionally, the language’s documentation is well-maintained and thorough, so I recommend checking that out as well.
boscop 7 months ago next
If you're looking to follow a learn-and-code-at-the-same-time approach, I can recommend joining the /r/rust_beginners subreddit. The community is helpful and well-focused on helping newcomers learn the language. The weekly posts that aim to 'implement something' with Rust can provide a helpful practice.
swizec 7 months ago prev next
If you're already familiar with Go, this free Rustlings course is a great way to get started with Rust. Small exercises that take ~5min each to complete will teach you the ground rules of Rust.
yuliaisgone 7 months ago next
Rustlings is good, but remember that it's only meant as a very basic introduction to the language. I'd recommend following up with either the book or a more comprehensive guide, like the Rust Programming Language course on Udemy.
justintime 7 months ago next
You might also want to check out this Rust Programming Language tutorial on Exercism Rust Track; it’s quite comprehensive and helps put in practice topics you’d learn. They offer a site where you solve various problems/exercises at your own pace, providing immediate feedback. Each solution can be reviewed by mentors, making sure you're digesting the facts well.
typester 7 months ago prev next
For videos, I found the Rust-101 series by Philipp Oppermann to be extremely helpful. He starts with a 'from scratch' mentality and covers all the key details of the language. Highly recommend.
ilikejhanna 7 months ago next
@typester, thanks! I watched the trailer for the Rust 101 series, and it looks great - def adding that to my list. For concurrency and performance optimizations, what resources do you recommend for someone with Go background?
bobfhead 7 months ago next
Two resources that can provide some good parallelism and concurrency lessons are 'Concurrency in Rust' by Nell Shamrell-Harrington, and 'Async Programming in Rust' by Steve Klabnik. The Rust community has also built the async-std library, which is a sort of a 'std' for async Rust, comparable to the std package in Go. Definitely check it out.
jdfollin 7 months ago prev next
To answer your question on performance optimizations, Rust does offer a concept called 'Zero-cost abstractions' that can help optimize performance using various methods, such as moving data instead of copying it. I also found that Rust's strong typing makes it easier to find and fix performance bottlenecks. You might find the 'Profiling basics in Rust' article by Lizzie Bai helpful as well. It's a good intro into profiling.
notacat 7 months ago prev next
Another helpful resource is the 'Rust by Example' book. It covers various Rust library features, concepts, and best practices through examples. I wouldn't recommend reading it cover-to-cover but skimming it for something specific you need help with, and it's a great place to pull from.
steveklabnik 7 months ago prev next
@imkhaled I'd like to add that it is worth understanding the underlying architecture design that Rust is based on. You might find my article 'How Rust’s ABI works' helpful and fundamental to understanding Rust's performance and usability in general. This should help you compare/contrast with Go's approach as well.
jacobo_gd 7 months ago prev next
Once you're done going through the Rust fundamentals, consider contributing to open-source projects that interest you. It’s a fantastic way to apply what you’ve learned while getting feedback from the Rust community. Rust has a variety of projects on GitHub, covering a wide range of capabilities and interests, so you'll see something that matches what you're after.