4 ms·
C++ has been trying modules, and Gabriel Dos Reis from Microsoft has gotten a pretty decent standard and implementation done. It's likely it will be added to th
by rep_movsd 5y ago
C++ has been trying modules, and Gabriel Dos Reis from Microsoft has gotten a pretty decent standard and implementation done. It's likely it will be added to the C++23 standard.
The biggest issue seems to be "What cross compiler format do we use for the compiled modules" (the equivalent of DCUs).
The other problem is that macros have to still work, and code that uses them will not benefit as much from modules.
The gains in compilation speed (including linking) and dependency information tracking is phenomenal though. It would certainly bring C++ in line with languages like Java, Rust etc.
The CPPCon 2021 talk about this is enlightening.
If C++ gets modules, there is no reason why C can't use the same model - since the compilers will have that stuff anyway.
- dextercd 5y agoModules are part of C++20
- vitus 5y agoAnd it's telling that we're in 2022 and still the only compiler with full C++ module support according to cppreference [0] is MSVC. [0] https://en.cppreference.com/w/cpp/compiler_support https://en.cppreference.com/w/cpp/compiler_support https://clang.llvm.org/cxx_status.html https://clang.llvm.org/cxx_status.html https://gcc.gnu.org/projects/cxx-status.html https://gcc.gnu.org/projects/cxx-status.html