How to start learning rust?


#1

Hey guys, i would like to learn rust and use it for some personal programming stuff.
I have some experience with c/c++ and java but not too much, just what i learned at university. Now im wondering what would be the best way to start.
The Book is probably the first resource to look at? And do the RustbyExample at the same time.
But how do i progress from there? Are there some good and updated tutorials?
Greetings


#2

While I haven’t done this myself I got it recommended a while ago so it might be worth taking a look at https://zsiciarz.github.io/24daysofrust/


#3

Depending on your programming experience in general, you might want to just jump into a new pet project and learn as you code. That’s what I did. :slight_smile:


#4

@kondrak, I’ve also done the same but it’s been hard thus far. Not to scare anyone, but I started programming around 20 years ago and Rust is definitely among the hardest programming languages I’ve been learning thus far. The learning curve is steep, at least for me, probably largely because it’s so different (the ownership model being a particular stumbling block in that area). Then again, my use case is rather complex with trying to run it in non-std (without the standard library), integrating it in a custom C-based operating system… It’s probably a lot easier to just try and write a random Rust app for Mac, Linux or Windows.

This guide I’ve found extremely useful, when it comes to understanding the ownership model, and “why” stuff is so different from most other programming languages: http://blog.thoughtram.io/rust/2015/05/11/rusts-ownership-model-for-javascript-developers.html


#5

I saw somebody say that it is actually easier to start with Rust by Example and then go to read The Book because The Book is hard to grasp at the beginning.
I cannot vow for this way of learning, no idea which way is better. And also, doesn’t mean that person knows "the right way"

What I did:

Result: I am probably the worst at writing Rust code.
When I try to write some code, the compiler lectures me that I do things the wrong way.
Although, writing just a bit of code already got me a bit better on agreeing with the compiler.
I’ve learned a good amount of programming languages and frameworks through the years, every new one feeling easier and easier to learn(because many things overlap), this(learning Rust) feels the hardest at the moment, the learning curve seems huge.
Note that I already have 9 years of experience with C++(taking university into consideration) and my issues are not with the understanding of the low-level “mechanisms”.

My guess would be that practice is the best way:

  • Practice with “Rust by Example”
  • Write some actual code in Rust with the Rust Standard Library API side-by-side…

I went top-to-bottom with Rust and it seems like it didn’t work for me. Actual practice should be a good way to learn.

Edit:
I think it’s important to mention that this might be a problem inherent to me, highly doubt all the people will have the same experience. I think my issues are mainly because I didn’t write much code yet.
If my job would of required this, or at least allowed me to write Rust code(we use GCC 4.4, what to say about Rust…), I think this would of changed a lot.

It kind of hit me right now.
I am like that guy that understands the language(lets say English), he can watch easily any movie in English and understands everything they say in the movie but when it comes to talking in English, because he didn’t practice with anyone, he can’t collect the right words to express himself.
Taking programming aside, even people that were born with a language, when they live in another country for a good amount of years(lets say: 20 years - native, 10 years - new language), because they don’t practice, they have difficulties expressing themselves in their “native” language. I’ve seen some even forget it, which is strange to me.

So, yes, practice :slightly_smiling:


#6

You can start learning Rust from community curated resources - https://hackr.io/tutorials/learn-rust


#7

I’m reading the O’Reilly Book. My goal is to learn rust over the spring where I can develop an application to pitch to my software department at work weighing the advantages/disadvantages of Rust compared to C++. I drive to work early every morning Mon-Fri and spend on average 1 to 1.5 hours/day learning Rust. All my work is version controlled. On the weekends I spend on average ten hours. In these blocks of time…

  • I read through my O’Reilly book highlighting specifics to come back to or take notes on
  • I compare my notes to other online content arriving to a central idea/understanding
  • I sign in to the IRC channel daily and clear up any major confusion
  • For every example in the book I write five to ten more examples
  • I visit Rust by Example and exlicitly type them out

Over the spring I’ve been keeping a daily metrics (Excel sheet) of various stuff like…

  • Lines of code I wrote for the day
  • Amount of time I’ve spent each day learning Rust
  • My ever changing interest/skill set in the semantics/theory
  • Number of posts I’ve read and have created
  • Number of IRC chat sessions
  • What chapter I’m on in my book

These metrics don’t really help me learn the language but they provide some data points I feel are helpful in remaining consistently active and engaged when tackling a new language.

  • Visualization (graphs) of my improvement over time to serve as self motivation in overcoming the initial learning curve
  • My community involvement showing what resources I’m leveraging the most or least

Example
image
image

I’ve tried to stay away from the crate system and just focus on the std libs in order to grasp some of the most fundamental concepts first (Ownership, Borrows, Lifetimes, Moves). I’ve also sparked some interest in my surrounding area to get any Rust meetups back up and going again. All this may seem like overkill but for a young single guy like myself with OCD it’s just right :wink:

Most importantly, do not let others destroy your morale or interest in learning Rust because they had an awful experience. I think it’s important to hear out others opinions but more so in drawing your own conclusions through experiencing the language yourself.

Cheers~S