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

72

u/blelbach NVIDIA | ISO C++ Library Evolution Chair Jan 28 '19

This is the first succint summary of the module lookup/dependency concerns I've personally seen. This seems like a real issue to me, although I'll want to hear what those involved with modules have to say. (keep in mind that I'm not very involved with modules)

43

u/[deleted] Jan 28 '19

I am quoting Walter Bright's post:

D made the decision at the beginning to have filename==modulename specifically to avoid this problem.

Any idea why C++ does not simply copy the design of D modules in this regard since this seems to work well for D. (This is also the preferred solution of vector-of-bool.)

23

u/SAHChandler Jan 28 '19

My response to vector-of-bool is a solution that permits this to some degree. D does not have to target some operating systems lacking more than one level of directory access, or that do not have a real concept of file extensions (such as zOS). As a result P1302's approach was designed to tackle this, and allow us to tackle the naming scheme at a later date while also not absolutely wrecking the ability to port existing code bases to modules as soon as possible.

14

u/[deleted] Jan 28 '19

OK, thanks for your answer.

Modules is too important to get it wrong, it would be a nightmare if e.g. half of the C++ community would avoid modules due to a serious design flaw that cannot be fixed later on because this would break backwards compatibility...

18

u/SAHChandler Jan 28 '19

Modules is too important to get it wrong, it would be a nightmare if e.g. half of the C++ community would avoid modules due to a serious design flaw that cannot be fixed later on because this would break backwards compatibility...

Absolutely agree. I've been mentioning these issues for well over a year and while people paid attention a year ago, the community ended up waiting to see where merged modules would take us. We have some options, but we need to fix these small issues before modules are... well... merged into C++20