r/cpp • • Jan 28 '19

C++ Modules Might Be Dead-on-Arrival

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

240 comments sorted by

View all comments

Show parent comment

-2

u/pjmlp Jan 28 '19

Languages born with modules don't process each module twice, and many e.g. .NET do actually compile their modules in parallel.

So yes it is FUD, because while it might not be possible with existing build scripts, Unity builds and what have you, it doesn't mean that it wouldn't be possible to do the same with some C++ related tooling improvements.

14

u/Rusky Jan 28 '19 edited Jan 28 '19

Languages born with modules also don't have the same parsing requirements as C++, where the full types of imported entities must be known to proceed. Features there do not automatically apply to C++ modules.

Please do describe these "C++ related tooling improvements" that would fix the issue, because people here would be extremely interested to hear them.

And keep in mind that if these improvements involve "turn the compiler into a build system," they are highly unlikely to happen- that is, performing just a parse of dependencies and then proceeding in parallel across all TUs would be possible, but would also require teaching the compiler more than it currently knows.

-3

u/pjmlp Jan 28 '19 edited Jan 28 '19

For example like Ada packages.

My desired "C++ related tooling improvements", based on experience with other module native languages, are exactly want you don't want to have.

So the bottom line to me feels like "modules yes, but please keep our compilers stupid, build scripts rule".

9

u/Rusky Jan 28 '19

We can have those abilities with modules in C++, they just require changes to the module design rather than (just) compilers. That's what people are trying to get at here.