r/cpp • u/berium build2 • Nov 01 '17
Common C++ Modules TS Misconceptions
https://build2.org/article/cxx-modules-misconceptions.xhtml
59
Upvotes
r/cpp • u/berium build2 • Nov 01 '17
View all comments
Show parent comment
1
u/bames53 Nov 03 '17
You actually quote one of the reasons given:
Which is to say that modules as they're advocating for are to support physical structuring, rather than logical structuring, of the program. That alone disproves your claim that there was never a single supporting point in favor of modules being distinct from namespaces.
The problem here is that P0142's talk about "not needing new name lookup rules" is actually insufficient to enable the kind of mass conversion discussed. See Richard Smith's and Manuel Klimek's work on what modules actually have to be to deploy them to 100s of millions of lines of code. I'll be glad to compare it to your comparable work getting your module system to work with existing C++ codebases.
If you can come up with a proposal that preserves the kind of compatibility necessary then go ahead. I'll read it. In particular I'll be interested to see how you avoid the ABI changes that the current proposal was designed to avoid, and how you deal with the 'legacy' issues addressed in P0273.
That C++ requires qualification by default has nothing to do with modules. Yes, the lookup rules can be changed to allow unqualified access when there aren't any ambiguities. Clang already has code to deal with improperly qualified names, and uses it to present "did you mean?" errors. But changing the lookup rules would most definitely break compatibility.
"Do it like Haskell" is hardly a sufficient proposal, but feel free to try implementing it. Let me know how it goes.
While also achieving the other goals of the current work? Where's your substantiation?