3 ms·
> The format breaks every update, so you can't distribute precompiled modules. When will they fix this? People keep using C to this day because these unstable
by matheusmoreira 3y ago
> The format breaks every update, so you can't distribute precompiled modules.
When will they fix this? People keep using C to this day because these unstable binary interfaces make it so no one can reuse software. Can't write a library in almost any other language and expect it to just work. To this day, C is the lowest common denominator of software because of stuff like this.
- mathstuf 3y agoUnlikely to be fixed. The module files are basically AST dumps and no compiler keeps that stable over time. Even flag selections make incompatible BMIs. So if one TU uses C++20 and another uses C++23, they'll each need their own BMI of anything they import. FD: CMake developer that implemented the modules support
- maccard 3y agoIf module files are pretty much memory dumps that makes it all the more frustrating that it's taken this long, given thats what precompiled headers essentially are.
- mathstuf 3y agoThere are new rules about "reachability" and "module linkage". Not to mention things like methods defined within the class declaration are no longer as-if `inline` when within a module. It's not just "a faster preprocessor" mode; there are real rules associated with module boundaries.
- leni536 3y agoC++ has stable binary interfaces just like C.
- matheusmoreira 3y agoI've seen compiled C++ code turn out to be incompatible with code produced by different versions of the same compiler. There is no way this is stable.
- maccard 3y agoMost compiler vendors promise forward compatible stability and have done for a while now. You're never going to have perfect compatibility, as I can always just compile with -DMY_FLAG=1 and change the behaviour of everything. But, GCC and clang haven't had a breaking change in a decade, and I believe msvc has been compatible since 2015.