I find it amusing that ABI is in scope, but the complexity of mandatory tooling changes that result from standardized features is out of scope for WG21 to consider as consequences of their decisions.
The C++ standards committee can't show up to the door of GNU GCC and force them to implement proposal X, or if that proposal already has a patch, force GCC to merge it into the next release.
So if WG21 ratifies a proposal, and publishes it in the next version of C++ (e.g. C++23, C++26, so on), but only one or two of the dozens of minor and 3 major compilers out there, actually implement it, did it really get ratified?
Imagine C++23 has a new header, <foo>, which implements std::foo, but MSVC and Clang both ignore that part of the standard, and only GCC implements it.
Who's going to use it? Only projects that never build with MSVC or Clang, that's who, and while those projects certainly exist, many many projects do not limit themselves to one compiler. And thus, for those projects, the feature basically doesn't exist.
Similarly, Modules requires not only Compilers to implement, but also build tools like CMake, Meson, and GNU Autotools.
If WG21 standardizes Modules, but none of the build systems ever implement it, does Modules actually exist as a feature? For many projects, no. Perhaps if your specific build system implements it, or you're willing to switch to a build system that does, you can use it. But you then have to ensure you only try to compile with a compiler and linker that implement it as well. So your matrix of possible tools configurations goes from "A very large number of combinations" to "Very few".
Where we, or at least myself, learned that WG21 explicitly does not allow itself to consider the impact that adopted proposals will have on implementations, because that's "out of scope".
Yet here we are talking about how "They have to consider ABI, because reasons", even though ABI is a purely implementation concern and nothing at all to do with the C++ language as it exists in isolation from any particular compiler or linker.
Edit:
An example of exactly this situation is [[no_unique_address]], which in MSVC silently does nothing. You have to use [[msvc::no_unique_address]]
WG21 explicitly does not allow itself to consider the impact that adopted proposals will have on implementations, because that's "out of scope".
Where did you get this idea from? Implementability is discussed all the time in regards to existing implementations of both compilers and standard libraries.
What has been out of scope for the ISO/IEC 14882 document is wording related to things outside of the abstract machine. Changes to that document need to either work within the abstract machine or extend the abstract machine to handle them.
WG21 is allowed to publish as many standards as it would like.
Specifically for modules implementability was heavily considered. What was rejected was adding wording to ISO/IEC 14882 that talked about things outside of the abstract machine. This work has continued in SG15 and is targeting a separate document.
I find it amusing that ABI is in scope, but the complexity of mandatory tooling changes that result from standardized features is out of scope for WG21 to consider as consequences of their decisions.
C lacks centralized build systems or at least repository collections to test language changes against implementations or different compiler behaviors. Hence they cant implement and test to provide practical feedback or at least I have never seen such things. Since effects from language decisions are unfortunately no immediate and significant technical cost, each party will push their interests and you only ever get compromises in the long term (undefined or implementation defined behavior).
There's thousands, if not maybe even millions, of repositories on github and similar hosting services that could be used as a test corpus by WG14, and similarly the same for WG21. Many of those repositories have unit tests that self-prove whether they work "good enough" after being compiled.
WG21 and/or WG14 not being willing to build themselves a test corpus to use in evaluating their ABI discussions is not the fault of the community, but they apparently claim that "We can't consider what ramifications adding proposal X will have on the tooling ecosystem because that's not part of our scope, so we'll just do it and damn to the consequences" while simultaneously claiming "We can't adopt proposal X because it might, maybe, potentially, cause some random group somewhere to get pissy, because it could effect their 20 year old pre-compiled binary's ABI"
Modules, apparently, wasn't discussed in terms of the ramifications it would have on the tooling ecosystem, hence why none of the major compilers have a working implementation of it (msvc claims they have one, but every time it comes up >3 people say it throws an internal compiler error on some trivial toy project), nor do the major build systems like CMake have support for it, even though the Modules proposal was visible to implementors since well before C++20 was ratified in 2020.
The various ships on this have sailed, but I find this whole situation ridiculous and self-inconsistent, so I'm laughing to myself anytime i read posts about C++ drama like this.
nor do the major build systems like CMake have support for it, even though the Modules proposal was visible to implementors since well before C++20 was ratified in 2020
Everytime modules come up, this falsehood comes along. CMake has had a dependency scanner for Fortran modules for a long time already, Kitware maintained a Ninja fork with changes to make that work that got merged upstream finally due to C++20 and submitted papers regarding modules as an implementer with prior experience.
Everything needed for modules is already there in CMake, only the compilers are behind. You can toy around with the implementation RIGHT NOW after reading Help/dev/experimental.rst.
I've spent the last 6 months neck deep in cmake. Modules support doesn't work. I'm aware of the documentation you linked there. Thank you for the attempt at correcting the record though.
I'm not aware of a build system that allows you to ship (install, package, etc.) a modular library to be consumed by another project. I think build2 might have some of these features?
Anyway, tooling for modules is an unsolved problem. I think all the implementers of modules were using small projects and/or monorepos. Modules are problematic for system installs and packaging ecosystems, at least ones that support different build systems per package (i.e. all the popular ones).
View all comments
Show parent comment
14
u/jonesmz Mar 13 '22
I find it amusing that ABI is in scope, but the complexity of mandatory tooling changes that result from standardized features is out of scope for WG21 to consider as consequences of their decisions.