Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



Unlikely 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


If 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.


There 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.


C++ has stable binary interfaces just like C.


I'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.


Most 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: