Live data from Hacker News

Ask HN: Going low-level – what to learn next?

news.ycombinator.com

1–10 of 59 posts

Ask HN: Going low-level – what to learn next?

#1
I've been interested in (relatively) low-level programming for quite some time. I know C, I can read assembly (write - not so much) and I have basic understanding of CPU (registers, cache, stack and whatnot). What should I read or learn next to be able to reason about things like cache usage of a C program or possible low-level microoptimizations? It's still just a hobby for me for the most part, so it's not that I'm trying to prematurely optimize some production code. I'm just interested in how it all works under the hood.

Re: Ask HN: Going low-level – what to learn next?

#3
I would recommend either to build up some RTOS/OS knowledge or excercise your skills in Low-levelish game programming with maybe C and SDL. I found especially these two very rewarding and I'm also making a living on the former for 15 years.

https://wiki.osdev.org/ is a good source for getting a hold in OS development

Re: Ask HN: Going low-level – what to learn next?

#8
If you want something on the more application side, I.e. utilization of low-level techniques, I can highly recommend looking into game engine development, even if you aren't interested in games per say.

I've recently enjoyed Game Engine Architecture, mostly because there is an interesting mix using low level techniques to solve problems a normal application wouldn't be required to fix.

Game development in general is case for tuning yourself to when you should utilize high level programming techniques, and when required dropping into low level optimization to solve local problems.

Re: Ask HN: Going low-level – what to learn next?

#9
> What should I read or learn next to be able to reason about things like cache usage of a C program or possible low-level microoptimizations?

Learn how to use a profiler like Linux' perf, VTune or Apple's Instruments. Which means interpreting the results of it to optimise your code.

Re: Ask HN: Going low-level – what to learn next?

#10
Implement some none-trivial algorithm and then try to optimize the heck out of it. Focus on the concrete CPU, architecture, cache, and memory in the hardware you have in front of you. Forget portability for a moment.

This comes to mind: https://www.morling.dev/blog/one-billion-row-challenge/

Read how others have done it. Here's an example in Java that goes relatively low-level to squeeze out performance: https://questdb.io/blog/billion-row-challenge-step-by-step/

Post reply on HN