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.

  • soulsource
    link
    fedilink
    arrow-up
    3
    ·
    11 hours ago

    I think you have done way more work than would be needed to learn Rust. I mean, it certainly is useful knowledge if you want to do any of those things in Rust, but it’s definitely not needed to learn Rust.

    The Book (the Rust language guide) assumes that you know some other language first, but you don’t need to be an expert in anything in order to start learning Rust. If you understand the basic concepts of branching, loops, recursion and function calls, you are good to go.

    There are of course other concepts you will encounter in Rust (like Algebraic Data Types, Polymorphism, Ownership,…), but those are all explained in the Rust Book, so there really is no need to learn them in advance.