Skip to main content

2 posts tagged with "systems-programming"

Posts about low level languages, compilers and operating systems

View All Tags

Revisiting the C compiler optimizations

· 14 min read
Bruno Felix
Digital plumber, organizational archaeologist and occasional pixel pusher

Following up on my previous article on the C compilation pipeline, we will now focus on the effects of compiler optimizations, how they affect the generated executable as well as its consequences on the ability to debug a program.

The compiler, depending on the desired optimization level, will apply a set of increasingly agressive techniques to transform a program's source code to increasingly more efficient machine instructions, speeding up execution and reducing resource consumption. There are no free lunches however, each transformation for the sake of performance slows the compilation process and risks of making the generated machine code less transparent and more challenging to debug.

Modern compilers are sophisticated tools that do far more than simply translate human-readable code into machine instructions. They analyze, transform, and optimize code in ways that can dramatically differ from the original source. For developers, this means the code running on a machine might look quite different from the original source code. We'll use a simple example program to demonstrate how compiler optimizations can fundamentally affect the generated machine code, explore the impact on the ability to debug a running program.

Revisiting the C compilation pipeline

· 17 min read
Bruno Felix
Digital plumber, organizational archaeologist and occasional pixel pusher

Over the past few years my interests have taken a turn towards system programming and database internals.

In that context languages like C, Rust or Zig make a lot of sense. As such I am going to start a more focused effort to refresh my memory of C and its toolchain. In my day job I currently use Python, Java and occasionally typescript, so I have been a bit out of the system languages game for a while. Time to fix that gap!