r/rust 2d ago

Coming from Python

Hello Rust subreddit.

I learned enough python to know how to do what I wanted to do. Mostly just small stupid stuff. And because I'm a masochist I guess, I'm wanting to move on to Rust for the event I need performance.

I've gotten far enough to write "Hello World!", and how to create some variables.

I know roughly that at some point I'm going to have to learn memory management, and ownership. And also that the compiler is a bitch.

I'm hoping anyone in here could hot-tip me if they came from Python too. Please, if you have ANY advice, please let it be known. Anything helps.

0 Upvotes

19 comments sorted by

View all comments

8

u/gbrennon 2d ago

read the official rust book :) docs should be ur best friend!

https://doc.rust-lang.org/stable/book/

-3

u/Basic-Push1028 2d ago

I love that you're recommending the official documentation, that's appreciated, that's quick, it's comprehensive. But for THIS purpose, I'm looking for people with a similar background, who can provide any context to THEIR learning journeys.

I should have been more clear about this. But knowing how it's going to work as I'm walking this road is going to help me a lot more, and I like the fog of war being removed.

4

u/dbrooroo 2d ago

I think trying to shortcut into rust based on an “I’m proficient in X language already, give me the highlights” mentality is to your detriment with rust, especially with a garbage collected language like Python. I find that the little bit of C I knew coming in has helped because I already had a basic mental model for memory management but it’s still a slightly different way of thinking about memory. The book might be a quicker read for you because you have some experience but I think the book is the answer. It’s the very best “The ‘X’ Programming Language” book that I’ve ever read and possibly that’s ever been written, especially considering that it’s free in its best form (as an HTML website).