What's Inside
This guide is about C++, but not only. It's also about internals of low-level languages, C++, Rust, Zig, or one of those new languages that are "coming soon". C++ is a perfect example to study such internals thanks to its 40 years of evolution and reach set of features people has implemented. In 2024, we know well what are good and bad parts of C++, what is missing and what should be done differently.
C++ is a complex beast. But "complex" not necessary means "complicated". I believe that the strength is in simplicity. So, let's ignore all complications of C++ and focus on the fundamentals.
We will see how every component of the language and its standard library is implemented. What specific assembly instructions and system calls are used. What algorithms and data structures have been chosen.
In engineering before you build something, it's a good idea to learn how similar things are built or work. This is what we will focus on: how C++ works.
In this guide we are mainly interested in N things:
Memory layout.
Memory is slow, that's why fragmented data structures hit performance. However, to be slow is not a sin, and in many situations we'd like to sacrifice performance for something else. However, it's important to make such decisions deliberately with understanding of details of our decisions.
We don't have to invent our own data structures. The Standard Library offers plenty of common data structures and algorithm, and we want to understand them to avoid misusing.
Smart organization of the memory space also leads to better software design.
Implementation details. Assembly instructions and OS system calls.
Table of Content: