Re:Modernizing Compiler Design for Carbon Toolchain [video]
by dsab on Sunday August 27, 2023 @05:23AM
(#37280915)
What do you mean by "header madness" ?
[ Parent
| on HN ]
Re:Modernizing Compiler Design for Carbon Toolchain [video]
by titzer on Sunday August 27, 2023 @08:20AM
(#37281940)
Header files in C/C++ boil down to textual inclusion. They generally end up with such complicated directive logic that a compiler can't reasonably pre-compile or even pre-parse them and get the semantics right. Large projects tend to scale up by having more and more compilation units and headers. Eventually, textual inclusion leads to an O(n^2) explosion in the amount of work the compiler has to do, and generates object files that are O(n^2) big, most of which is then de-duped by the linker. For example, compiling V8 generates a couple gigabytes of .o files that get linked into ~30MB binary in the end. It all starts with header madness.