Hacker News new | ask | show | jobs
by sitkack 1431 days ago
Folks recommending C are doing you a disservice, C is just one example of a systems programming language. And that example is now outmoded, Rust or Dlang would be fine first systems languages, I haven't looked at Nim in years, so I can't comment on that.

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.

5 comments

I have to disagree emphatically that C is outmoded. It may lack some of the polish and novelty of Rust et al, but it's still a fine language. More importantly, it's an industry standard, has been for ages, and will be for ages. So many of the resource and reference material out there (not just for low level / systems programming but especially for it) presumes a working knowledge of C that a person would do himself a disservice by not picking up the language.
I do agree that you can learn these things in a higher level language.

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.

This is really the wrong sort of response.

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.

I like your focus on better questions. "those topics and any other that come up" was especially vague as was "semi-unknown". ;-)

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.

Software written in C/C++ runs the world. Including the operating systems, VMs, interpreters etc. running (almost) all other languages. It is the bedrock that everything rests on. So learning C is highly relevant. It will take decades (if not forever) for Rust to get even close to achieving that kind of impact.