DEV Community

Jonas Brømsø
Jonas Brømsø

Posted on

Blog post: Learning Rust

I was evaluating whether to attempt to learn Go or Rust an decided to check out Rust first. At the time of writing this is very much work in progress, but I can however shed some light on the resources I have found and the process I am following in picking up Rust.

The Rust language is well documented the plethora of different resources at times it is a tad difficult to decide on what resource to use. The main resource is of course The Rust Programming Language website, which hosts the book: "The Rust Programming Language Book". The 2018 Edition at the time of writing, you might find links to older editions when googling, but the pages are often referring to newer editions when and where possible and update has been made.

You can generate a local version if you have Rust installed and the following command does all the work including opening the book in your default browser:

$ rustup docs --book
Enter fullscreen mode Exit fullscreen mode

From the website you can also find "Rust by Example" with a lot of useful examples and a pragmatic approach.

Well I decided to start with a paid video course "Rust in Motion" from Manning. It is by @Carol Nichols and @Jake Goulding. The video course is recommended, there are free previews for you to get an insight to the form and contents of the course and the example source code is available online.

In addition to following the course and using the resources mentioned above I use Codewars.com. Codewars offers small coding challenges grouped by difficulty and organized as Katas, it's is like the small exercises you sometimes find in technical books at the end of a chapter - anyways the Katas are plenty and from a variety of different authors and give a great variation in problems and challenges.

My process with the Katas is currently doing one at a time. I then use the above mentioned resources to get an understanding to come up with a working solution in Rust. I am still at the 8th. kyo (the lowest) on Rust, but I am having a lot of fun.

Earlier I wrote up a TIL/blogpost on setting up a Rust development environment (dev.to). So when I go over the Katas (or other programming assignments for that matter), I get extensive feedback from my development environment, this leads me to looking up extensively in the Rust standard documentation and my own repository of completed Katas and Rust examples, no matter where you get your assignments from the process is somewhat the same.

When I occassionally run into a challenge, which is taking too much time or it requires additional thinking/showering/sleeping, I skip to another and then return wiser and more experienced in Rust.

The Rust toolchain is very informative and I have heard many speak highly of the level of the error messages emitted by the compiler. Which leads me to the list of Rust compiler errors.

Alternatively you can use the compiler itself:

$ rustc --explain E0200
Enter fullscreen mode Exit fullscreen mode

There are other resources like Codewars.com and recommendations are most welcome, But if you are not so much into the Kata things and displaying your solutions publicly I can recommend @Carol Nichols "Rustlings".

I have never seen anything like Rustlings before, it is a GitHub project organized as a chain of error prone pieces of code organized as build, every time you get a step to compile you move on to the text - it totally feels like a game. I can however offer a small tip without spoiling anything. Do READ the displayed error, since when you get a step to compile, it automatically moves on to the next assigment and sometimes you do not see that you have succeeded and should evaluate a new piece of code.

If you run into some more sticky Rust code @Jake Goulding has made an online playground (REPL).

Finally I can recommend IRC for Rust assistance, but unfortunately it is being decommissioned at some point in the future. There are also Rust user groups, my local groups is Copenhagen Rust Group, I have not yet attended a meetup, but I would love to go to one of the hack nights to boost my Rust learning.

As a small extra bonus, I can present you to a resource just rediscovered a Cheat Sheet, I had bookmarked, but forgot to put to use - it looks incredibly impressive and hope to put it to good use.

Have fun with your Rust adventure and please send me recommendations for Rust learing resources if you have any you think would benefit my Rust endeavour.

Good luck and stay safe (intended Rust pun)...

Cross-posted from my TIL collection

Resources

Top comments (8)

Collapse
 
tuned profile image
Lorenzo (Mec-iS) • Edited

For me the best resource has been O'Reilly's Programming Rust as I preferred to have an overview of all language features. Examples in the book are also very interesting. You can see my first experiment at github.com/mec-is/loopscape

I am open to start any learning project in Rust with other fellow learners.

Collapse
 
jonasbn profile image
Jonas Brømsø

Hiya,

I have always been a book person myself, but for Rust I decided not to invest in a book, even though I miss a hard copy at times (it is still softer to bang your head against a book than the tabletop). My worry has been that the book would grow obsolete too fast, but perhaps now is the time. I will definitely check out the title you recommend, I have good experiences with other titles from O'Reilly.

I am not sure how much I can give being a fellow learner, since I am very much a n00b, but I am always up for a peer/code review. And I will try to write up some more on dev.to as a reflection and perhaps it can be of benefit to others.

I tried to get a mentor, by writing to a more prolific Rust developer I had found via GitHub, but the person was unresponsive, which is perfectly okay, we all busy.

I think you often need somebody to bounce ideas and stupid questions off - too bad they are planning on closing the IRC fora, since the channel for beginners is actually quite welcoming.

Collapse
 
tuned profile image
Lorenzo (Mec-iS) • Edited

My worry has been that the book would grow obsolete too fast

not really, most of the content is about design choices and well established patterns that are "native" to Rust and won't get stale.
Ping me on the dev.to/connect chat, I will try to be responsive according to my timezone.

Thread Thread
 
jonasbn profile image
Jonas Brømsø

Thanks, I have a Safari subscription handy so I can read the book online and evaluate whether it is worth purchasing a hard copy - and it would look good on my shelf :-)

I will ping you on the chat, thank you for the gesture

Collapse
 
my profile image
Mindaugas Sharskus

Have you tried Exercism? It is nice and quite unique chalange hosting site, well at least I didnt come across anything else like it.
+1 for CodeWars.com it helped me learn JS, and improve Java and Rust.

Collapse
 
jonasbn profile image
Jonas Brømsø

No, I have been meaning to for a long time, I just got started with Codewars.com instead and decided to stick with that. The size and difficulty of the katas and my level seems to be a good balance - but I will give it another look - thanks for the tip.

Collapse
 
bmitch profile image
Bill Mitchell

Nice post. I'm in the same boat as you. Looking forward to following your progress!

Collapse
 
jonasbn profile image
Jonas Brømsø

Thank you, as I just commented. "I will try to write up some more on dev.to as a reflection and perhaps it can be of benefit to others", thank you for the kind words of encouragement.