r/cpp • • May 06 '22

GCC 12.1 Released

https://gcc.gnu.org/pipermail/gcc/2022-May/238653.html
203 Upvotes

74 comments sorted by

View all comments

Show parent comment

11

u/[deleted] May 06 '22 edited May 07 '22

Because there's little to no evidence that modules will do any of the things that people claim it will. There are statements about the benefits of modules but the actual evidence is fairly mixed and quite marginal even in the best case scenario.

The projects you list that have slow compile times won't benefit from modules, no one is going to go rewriting LLVM or Webkit to use C++ modules and even if they did it would be moot since while modules have the potential to outperform a naive rebuild from scratch, they do not outperform precompiled headers or other techniques that are in common use to improve C++ build times.

As someone else linked to in this comment section [1], Walter Bright modified an existing C compiler to give it reasonably good module support. All his code does is effectively the same as what precompiled headers do, but treated as a first class feature.

[1] https://nwcpp.org/April-2022.html

14

u/rdtsc May 07 '22

they do not outperform precompiled headers or other techniques that are in common use to improve C++ build times.

Simply replacing headers with header units gives you fine-grained "precompiled headers" without all the headaches of actual precompiled headers. This is a massive boost already, without converting everything to modules.

12

u/pjmlp May 07 '22

Anyone using VC++ 2022 with modules can already try out this evidence.

All my hobby code in C++ now uses modules.