Similarly, I don't want to build my entire translation unit, I only want to build the function that I changed. But somewhere along the way we apparently decided that 'files' were the unit in which we decide everything.
It doesn't have to be: C++ could be stored in a database (or graph, if you prefer), with each entity linked to the things it consumes, and the things that consume it. That would allow for selective recompilation instead of having to recompile half your project when you change one constant in a header, work a lot faster (no more duplicate template instantiation), and provide the benefits of full program optimisation/analysis as its basic mode of operation. We're firmly stuck in file-thinking, though...
The long version would be "tried to do at scale in a commercial compiler very few people used before they went under and abandoned it".
Sure the tech worked, but if you don't upstream your clang patches, you will always have a painful catch-up phase and people will likely not use your program. Which isn't great for a commercial product!
No, the lack of availability because by now, it's using an 8 year old llvm in the published repo. It's a lot of work and without commercial backing, few are going to have the time to pick this up.
Imagine having to manage includes/imports for individual functions/classes/objects.. And then the build system would have to diff files to figure out which functions changed within a file.. It for sure is an interesting thought, but it does not seem practical.
View all comments
Show parent comment
2
u/johannes1971 Oct 31 '26
Similarly, I don't want to build my entire translation unit, I only want to build the function that I changed. But somewhere along the way we apparently decided that 'files' were the unit in which we decide everything.
It doesn't have to be: C++ could be stored in a database (or graph, if you prefer), with each entity linked to the things it consumes, and the things that consume it. That would allow for selective recompilation instead of having to recompile half your project when you change one constant in a header, work a lot faster (no more duplicate template instantiation), and provide the benefits of full program optimisation/analysis as its basic mode of operation. We're firmly stuck in file-thinking, though...