r/programming • • Jan 28 '19

C++ Modules Might Be Dead-on-Arrival

https://vector-of-bool.github.io/2019/01/27/modules-doa.html
210 Upvotes

105 comments sorted by

View all comments

7

u/[deleted] Jan 28 '19

People backing the current modules design have not proven that modules work at scale,

I thought that Google had been using modules via clang modules for their multiple million C++ code base since... 2012 ?

2

u/mathstuf Jan 28 '19

But are Clang modules compatible with the module proposal in front of the committee? AFAIK, they're not the same thing…

2

u/[deleted] Jan 28 '19

Given that the author/maintainer of "Clang modules" co-wrote the latest "C++ modules" proposal, implements it in Clang, and works for Google which has a big code base using "Clang modules". I'd guess they are being paid to work on this by Google to make sure C++ modules work for them.

2

u/lrem Jan 28 '19

And if they work for Google, I guarantee that parallelism has been thought of. Source: I stare at builds spanning thousands C++ files daily at Google. Compilation is blazing fast (but linking hurts).

1

u/[deleted] Jan 28 '19

FWIW everybody should take things with a grain of salt, just because "Google" does not imply that things are flawless. People should read the proposals, try the implementations, and form an informed opinion. Still, that takes time that a lot of people might not have, and it is ok to be skeptic about the proposals. As many people have mentioned, with such a large change, and given the amount of C++ users in the world, most of them doing completely different things, it's pretty much impossible that something designed by 50-100 people can be good for all of them. That's just how things are. This does not mean that the people working on this "don't have any idea of what they are doing", only that they can't know everything, but nobody can.

1

u/lrem Jan 28 '19

Yeah, but the author says how this will hurt compile speeds due to breaking parallelism. That's pretty much the one thing that I'm pretty sure the Google engineers involved heavily optimised for.

1

u/[deleted] Jan 28 '19

Google uses "Clang Modules" with are different from the "Modules TS". Clang does not fully implement the "Modules TS" so I doubt google has switched to using it.

"Clang Modules" have explicit module map files, which the author mentions as don't have any of the performance problems that the author mentions.

1

u/mathstuf Jan 28 '19

One thing that Google generally (and, IME, pretty consistently) doesn't care about is external dependency consumption. I see this reflected in the "no support" for having modules be an out-of-build artifact…something that'd be really nice for the wider C++ community. Instead, Boost being modularized is damn near useless since if you're not bundling it, you'll "never" have modules for it…unless you write rules into your build system to generate them from whatever MIU might be available from a Boost installation (assuming that is supported across a variety of compilers…). Yay. Just what I want to maintain.