Live data from Hacker News

Ask HN: How do I start learning about lower level compiled languages?

news.ycombinator.com

21–30 of 34 posts

Re: Ask HN: How do I start learning about lower level compiled languages?

#21
post #11

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 diffe…

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.

Re: Ask HN: How do I start learning about lower level compiled languages?

#22
post #11

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 diffe…

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.

Re: Ask HN: How do I start learning about lower level compiled languages?

#23

Two recommendations: 1. Switch to a team (or company) where they are developing in the language you want to learn. 2. Work through the book "Computer Systems: A programmer's perspective" Nothing beats daily programming in said language on a daily basis. Similar to yourself, I was predominately writing in higher level interpreted languages. Although I did teach myself C by working through books, writing programs and m…

Can get my hands on the 2nd edition for cheap, or is the 3rd edition required? It's quite expensive.

I have all three editions. The 1st one is 32-bit only, the 2nd covers both 32 and 64-bit and the 3rd is 64-bit only.

If you can, buy the 3rd edition (this is one of the few books worth its price) and then pickup the 1st edition for cheap/free from somewhere. Try for Used/Secondhand copies to save money.

There is a lot to learn from the book; all of them necessary for a beginner to connect the dots and get the full picture. So don't get stuck on any one chapter/problem but make sure to cover all the chapters in sequence skipping over unnecessary details in the first couple of passes. As an example you don't need to know the nitty-gritty of PIC/GOTs/PLTs/Assembly minutiae etc. in the beginning but just understand the concepts of Relocatable code and Executable vs. Shared Object files.

Re: Ask HN: How do I start learning about lower level compiled languages?

#25

Two recommendations: 1. Switch to a team (or company) where they are developing in the language you want to learn. 2. Work through the book "Computer Systems: A programmer's perspective" Nothing beats daily programming in said language on a daily basis. Similar to yourself, I was predominately writing in higher level interpreted languages. Although I did teach myself C by working through books, writing programs and m…

Thanks. I really like the first approach. Now that I work as half data engineer and half infra (cloud). I do have a few hobby projects using C/C++ (e.g. embedded for C and game programming for C++), but nothing really completed and polished. How do I convince someone to give me a job to work on low level systems, even as a junior? Should I continue working on low level projects and hopefully they are good enough, or…

>How do I convince someone to give me a job to work on low level systems, even as a junior?

>Should I continue working on low level projects and hopefully they are good enough, or there are other approaches?

The way i had done this in the past was to really learn the language well (today you will also have a GitHub repo of projects to show), practice algorithms/data structures/interview questions in C/C++ and finally, understand the tight coupling between C/C++ and underlying OS i.e. "Systems Programming". This is the preparation phase.

In the execution phase, you contact companies/recruiters/friends/anybody at all with suitable openings and make it very clear that you really really want the job even if it means taking a pay cut i.e. Salary/Money should not be the goal. Make it clear and open that you are looking for a break into that domain and you are willing to put in any Time and Effort reqd. Finally, try smaller companies rather than big ones at first; their requirements are less strict.

HTH

Re: Ask HN: How do I start learning about lower level compiled languages?

#26
post #11

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 diffe…

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.

Re: Ask HN: How do I start learning about lower level compiled languages?

#27
Start with the basics. It will give you a basic foundation to appreciate how computers work.

https://www.nand2tetris.org/

https://nandgame.com/

After this, start learning C. There will be a bunch of semantics to learn, which are all important, however with every small program that you write , you should generate the assembly code with gdb, and aim to understand what the assembly is doing (calling convention for functions, registers, syscalls, e.t.c). This will

Then, figure out how linking and loading works (i.e turning assembly code into the shape of an executable understood by the OS). Objdump and readelf are going to be your friends, as well as getting familiar with gdb debugger.

https://eli.thegreenplace.net/tag/linkers-and-loaders.

This will give you a good foundation for low level development. You can then branch off to other areas like CUDA/OpenCL/AVX programming, microcontroller programming, kernel development, e.t.c

Re: Ask HN: How do I start learning about lower level compiled languages?

#28

Earlier quoted context omitted.

Thanks. I really like the first approach. Now that I work as half data engineer and half infra (cloud). I do have a few hobby projects using C/C++ (e.g. embedded for C and game programming for C++), but nothing really completed and polished. How do I convince someone to give me a job to work on low level systems, even as a junior? Should I continue working on low level projects and hopefully they are good enough, or…

>How do I convince someone to give me a job to work on low level systems, even as a junior? >Should I continue working on low level projects and hopefully they are good enough, or there are other approaches? The way i had done this in the past was to really learn the language well (today you will also have a GitHub repo of projects to show), practice algorithms/data structures/interview questions in C/C++ and finally…

Thanks! That looks very good and right on my study path. I'm glad that the preparation phase can be prepared by some CS courses.

Re: Ask HN: How do I start learning about lower level compiled languages?

#29

Learn C. Despite all the slander, it remains the easiest to learn and most widely applicable Systems language. I personally recommend this book (wish it was available when I learnt it): https://www.amazon.com/Effective-Introduction-Professional-R...

Yep exactly. If you truly want to understand low level then the only right answers are C or Assembly language.

Re: Ask HN: How do I start learning about lower level compiled languages?

#30
post #11

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 diffe…

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.
Post reply on HN