3 ms·
> Just don't do C's stupid O(n^2) header madness and Carbon will compile plenty fast. Outdated is a better term IMO. This design made sense at that time (Weak
by meeho 3y ago
> Just don't do C's stupid O(n^2) header madness and Carbon will compile plenty fast.
Outdated is a better term IMO. This design made sense at that time (Weak hardware and small codebases)
- dsab 3y agoWhat do you mean by "header madness" ?
- titzer 3y agoHeader 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.