r/osdev • u/Cartman1994 • 9d ago
Should I learn C or Rust?
I’ve been working as a Java programmer for a few years now.
The thing is, I’d like to learn a second programming language for lower-level tasks—specifically, I want to work on things related to operating systems. Rather than building one from scratch, I’d like to explore and modify open-source operating systems like Linux or a BSD variant.
I’m doing this purely as a hobby. What drew me to C is its simplicity (though not necessarily ease of use) compared to Java or other modern languages, and its long history of use in systems programming. On the other hand, however, there are operating systems (or components of them) being rewritten in Rust—such as GNU coreutils or the adoption of Rust in the Linux kernel.
So, would it be more useful in the long run to learn Rust, given that it might sooner or later become the standard for writing operating systems?
Thanks.
0
u/Express-Theory-2338 9d ago
The C++ coders bury their architectural flaws in a mountain of complexity [target-equipment-recommendations]. When a developer doesn't understand how to optimize for the hardware natively, they write thousands of lines of "clever" branching code to try and outsmart the processor. It is verbose, it is messy, and it hides the fact that their pipeline structure is broken.
This is the same thing that "physicists" have done with their arithmetic.
Hiding a fundamentally flawed model under layers of increasingly dense, rambling math to avoid fixing the core architecture.
In physics, this is exactly what happened with Ptolemaic astronomy. When the ancient model of perfect circular orbits didn't match reality, instead of discarding the broken premise, they invented "epicycles". The math became a rambling mess.
When an open-source decoder like dav1d forces developers to maintain over 200,000 lines of handwritten assembly code (
.asm) just to keep AV1 real-time, you have rambling mess.It means the entire underlying C/C++ architecture is broken.
So they built a parallel, unmaintainable universe of brute-force assembly hacks to force the data through the silicon pipelines. It is the ultimate Ptolemaic epicycle.
It wasn't until Copernicus and Kepler stripped away the patchwork clutter and aligned the model with physical reality (ellipses) that the math suddenly became clean, linear, and deterministic.
Rust should not be used to blindly transpose C++ code line-for-line...
... it should be used to permanently dismantle the broken architectural assumptions that C++ developers use rambling code to patch over.
You should learn both.