by sitkack · 4y ago · 0 comments
Someone else mentioned The Compiler Explorer, which is a great resource. I would second that.
Questions I would ask yourself are
1) How is a low level language different than the languages you are coming from? What do they solve for you vs what do you have to solve yourself?
2) What are the qualities you are solving for? Latency, predictable performance, memory bandwidth, IPC (instructions per clock cycle), etc?
All of the issues you would like to learn about can be learned directly in Python. So you have to figure out what exactly you want to learn and then learn that thing. Just learning about lower level compiled languages is like learning about rakes and shovels if you are a gardener.
I completely disagree that C is no long relevant. The amount of new C code written today across the world dwarfs the amount of new Rust, D, or Nim code combined.
It is quite clear from the post that the author had heard of some "low level concepts" but does not have a clear idea of what they mean much less understand them. This is NOT a "XY Problem" as your response seems to suggest. They are basically exploring in the dark and need guidance. As many have pointed out, "C" is the answer since those concepts are "natural" in that language and moreover is the "lingua franca" of low-level programming.
FWIW, I doubt anyone was suggesting "large scale applications programming in C"..Just the nuts & bolts & basic vocabulary..the way a program/process interacts with an OS, etc. in the very simple cases/scenarios. The main (but not only) way people use Nim is through the C backend. { The code generated by the Nim compiler is not that easy to read or intended to be so, of course. } There are also OS books to consider like The Design of The Unix OS or Advanced Programming in the Unix Environment. These also use very minimal little C examples. Everyone learns differently, though. I think more delineated goals and background level would yield better advice for @budafish.
Teaching has also evolved over the decades. Teaching of C was/is more "hand in hand" with the ideas the poster was asking about. For example, the K&R C book walks you through writing both stack allocators and heap allocators on top of raw memory.