Someone once told me somewhere, that if I am trying to learn rust, I should learn C first, so that I know how to shoot myself in the foot, learning to avoid doing so, so that the borrow checker of rust doesnt seam to unforgiving (since you somewhat know, what happens if you dont follow best practices). So thats what I did (somewhat) for the past 6 months. I wrote some stuff in C, but mainly I had quite of a deep dive into operating systems (mainly linux), working mechanics of memory and the CPU and a lot more (I will try to make a list of the stuff I learned and the ressources used below). My question to you is, if there are any additional concepts/things I should learn beforehand, to start learning rust.

The (somehwat complete) list of things learned for the past 6 months:

  • Stack Behaviour (Why its so fast, what its used for,…)
  • The heap (why its useful, but dangerous)
  • Theoretical Concepts of threading (Concurrency vs. paralellism)
  • Theory of race conditions (how and why they occur, and some tricks to avoid them)
  • Concepts of Memory allocation on an OS level (Address Spaces)
  • System calls and the separation between kernel and user space
  • Signals
  • Basics of Inter-Process-Communication
  • CPU-Scheduling (CPU-/IO-Bursts, context switches, different scheduling algorithms up to ROund RObin (based on complexity))
  • How loops, conditions and function calls get implemented in Assembly / how the CPU performs these
  • Bitwise Operations

I probably forgot a significant part of the stuff I learned, but its quite hard turning it into a list, without writing a whole book, and trying to remeber everything.
Most of these things are mainly theory, since I havent gotten around to code that much in C. However I definitively have some experience in C. This includes on how to handle pointers, basics of handling the heap, strings (even if I absolutely hate them in C) and some system calls (I played around with sbrk for custom memory management without malloc).

The ressources I used for learning is primarily the YouTube-Channel CoreDumped (I highly recommend), LowLevel and some other ressources, but these were the most helpful ones.

So, feel free to send me down my next rabbit hole before starting rust.

  • Jayjader@jlai.lu
    link
    fedilink
    arrow-up
    2
    ·
    6 hours ago

    I agree with the many others who say you’re more than ready to start learning rust. I would add that if you’ve brushed up against manual memory management in C, then you might find the following a great introduction to rust and the borrow-checker: https://rust-unofficial.github.io/too-many-lists/

    As usual for discussions about starting to learn rust, I would also recommend the “special”/experimental version of The Book maintained by Brown University: https://rust-book.cs.brown.edu/title-page.html . It has little interactive quizzes that help check your understanding, and some fancy diagrams in the sections on pointers and the borrow-checker.

  • Kissaki@programming.dev
    link
    fedilink
    English
    arrow-up
    4
    ·
    8 hours ago

    I don’t see anything as having to come before learning Rust.

    If something about Rust requires more technical knowledge, then that learning is part of learning Rust, even if you could have learned it separately beforehand.

    Better start learning Rust to get in there instead of delaying, which adds risk to never arriving, loss of interest, or lack of progress on the goal of learning Rust, with a lack of satisfaction.

    Once you learned Rust, you can look around to gain broader knowledge and expertise, if you want, but that’s not necessary to learn and make use of Rust.

  • fruitcantfly@programming.dev
    link
    fedilink
    arrow-up
    17
    ·
    12 hours ago

    These are all very useful things to know about, but besides maybe the difference between stack and heap, they are not things you need to learn about before getting starting with Rust.

    So if you actually do want to learn Rust, then that’s your next rabbit hole

  • red_tomato@lemmy.world
    link
    fedilink
    arrow-up
    16
    ·
    12 hours ago

    The next rabbit hole is to start learning rust.

    As long you understand the stack you’re good to go. It will help you understand why the borrow checker is like the way it is.

  • tiredofsametab@fedia.io
    link
    fedilink
    arrow-up
    4
    ·
    10 hours ago

    I’ve been a developer for over 20 years now and I’ve never done anything meaningful in c or c++. My c was mostly working through an old book as a kid and later 1 uni course and my c++ mostly some limited game modding. I had no particular issues learning rust and writing stable production code in it. I don’t think there’s a wrong time to start

  • TehPers@beehaw.org
    link
    fedilink
    English
    arrow-up
    5
    ·
    12 hours ago

    You can learn Rust whenever you want. There’s no rule that you must learn anything (including C) before learning Rust. Of course, knowing C will make the basic concepts, especially around memory management, a lot simpler.

    If your goal is to eventually learn Rust, your next rabbit hole should be the book ideally. If you prefer a video format, I don’t have any specific suggestions since I don’t learn through videos usually, but I know there’s some good video resources on YouTube.

  • Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 hours ago

    I would also definitely recommend to get started with learning Rust. You will need to learn more concepts along the way, but you can still learn about them while you’re coding Rust.

    Or rather: I always found it most productive to learn about concepts, while I’m actively using them in a project. So, I would even recommend to jump into Rust now, try to tackle a few smaller projects, and then continue learning general concepts later.

  • theherk@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    12 hours ago

    Learning C first is great, just because C is a great language. But learning to avoid shooting yourself in the foot is not a good reason. You could do that with rust, where you can also shoot yourself in the foot, or assembly where it’s even easier.

    The list you put together is great and Core Dumped is an awesome resource.

    Number one suggestion from me as always and as many others… write something. If there is anything about which you have domain specific knowledge, write something related to that, so you can focus on growing your expertise in programming, not in another primary field at the same time.