r/cpp • • Oct 29 '26

The case against makefiles

https://thibaud.space/2026/10/the-case-against-makefiles.html
0 Upvotes

55 comments sorted by

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...

4

u/OrphisFlo I like build tools Oct 31 '26

I believe that's what zapcc tried to do a while back.

2

u/johannes1971 Oct 31 '26

_Did_. Not "tried to do".

4

u/OrphisFlo I like build tools Nov 01 '26

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!

2

u/johannes1971 Nov 01 '26

Is your argument that their lack of commercial success implies a lack of technical feasibility?

2

u/OrphisFlo I like build tools Nov 01 '26

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.

2

u/Circlejerker_ Oct 31 '26

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.

0

u/pjmlp Nov 03 '26

Welcome to Lucid Energize C++ and Visual Age for C++ v4, back in the day they failed in the market due to hardware resource requirements.

It was a great experience, Lisp/Smalltalk like tooling but for C++.

Only now Clion and VS, alongside Live++, are somehow getting similar experiences, with code navigation, and hot reloading.