Comment by adamgordonbell
Comment by adamgordonbell 20 hours ago
Matt is amazing. After checking out his compiler optimizations, maybe check out the recent interview I did with him.
What I’ve come to believe is this: you should work at a level of abstraction you’re comfortable with, but you should also understand the layer beneath it.
If you’re a C programmer, you should have some idea of how the C runtime works, and how it interacts with the operating system. You don’t need every detail, but you need enough to know what’s going on when something breaks. Because one day printf won’t work, and if the layer below is a total mystery, you won’t even know where to start looking.
So: know one layer well, have working knowledge of the layer under it, and, most importantly, be aware of the shape of the layer below that.
https://corecursive.com/godbolt-rule-matt-godbolt/Also this article in acmqueue by Matt is not new at all, but super great introduction to these types of optimizations.
The “understand one layer below where you work” is something my professors at uni told us 10+ years ago. Not sure where that originated from, but I really think that benefited me in my career. I.e understanding the JVM when dealing with Java helped optimize code in a relatively heavyweight medical software package.
And also, it’s just fun to understand the lower layers.