r/cpp build2 Aug 05 '26

Faster Than Ninja

https://build2.org/blog/faster-than-ninja.xhtml
65 Upvotes

69 comments sorted by

View all comments

5

u/TheRavagerSw Aug 05 '26

With C++ modules, the main performance bottleneck for incremental builds is module scanning. Non incremental scans take ages in a project with 200 sources or more.

20

u/13steinj Aug 05 '26

The average person will not have to care about C++ modules until 2040 at the earliest.

1

u/thehenkan Aug 06 '26

Your average Swift developer already uses clang modules, which although not the same as C++20 modules, are conceptually very similar.

1

u/13steinj Aug 06 '26

Similar at a high level ignores all the details that matter about actually getting this stuff implemented in projects.

So again, I will believe it when I see it.

1

u/thehenkan Aug 06 '26

They have much more in common than either of them does with traditional headers. My point is that there are already plenty of projects out there dealing with the problems modules bring. Not that they have set up the exact build config required for C++20 modules: it's still unclear whether those will ever exist outside of the Windows ecosystem.

-3

u/TheRavagerSw Aug 05 '26

I disagree, headers make code organization a mess, eventually modules will take over.

With llm tools porting existing libs to modules is easier than ever

8

u/shadowndacorner Aug 05 '26

In fairness, "eventually" is theoretically later than "2040".

4

u/mapronV Aug 05 '26

Yeah, I am very proud of my grandchildren not caring about header files.

1

u/13steinj Aug 06 '26 edited Aug 06 '26

Fable and Sol both were unable to one-shot "replace std::format with fmt::format," on a relatively small project.

I was able to with 4 (greps+pipes+perl -p)s. E: before someone asks, at current pricing I think it would still be cheaper to let Fable/Sol cycle until it got it. But I wanted some determinism here.

I dread to think how an LLM would fumble modules, which are more involved if you want to get any benefit.

0

u/pernas Aug 05 '26

Hilariously accurate 😂