If the answer is “the ability to change the types of library functions without changing their name” (which is what his first few examples were showing to be the “problem”), then of course you can’t do that, and I’m not convinced we should waste any time or effort trying to get that to work. If you want to change the types accepted/returned by a function, make a new function with a new name.
Of course, if there’s something I’m missing here I’d love to know… the article has done a terrible job outlining it if that’s the case.
std::move_fast_and_break_things::vector
Or maybe the other way around so you can keep using std::vector: move_fast_and_break_things::std::vector
Then you can add a 'using namespace move_fast_and_break_things;' at the top of your files if you know you don't care about the ABI in your program.
Abseil doesn't even have releases any more. They expect you to live at head like GOOG does internally.
For how transparent aliases help solve this, suppose that there is some ancient library function called get_year:
typedef int32_t time_t;
int get_year(time_t time);
// document time_t and get_year
Then, library users will call get_year with 32-bit time_t values. But suppose that eventually, as Y2038 draws near, the library writers want get_year (and related functions) to instead take 64-bit time_t for all newly compiled programs that use get_year. Previously, this was impossible: users would have to modify their programs to call a new version of every function, or link to a new version of the library. But with transparent aliases, library writers can simply replace the headers with: typedef int64_t time_t;
int get_year_v2(time_t time);
_Alias get_year = get_year_v2;
// document time_t and get_year
Now, existing compiled programs continue to call get_year in the library, which remains implemented for compatibility. Meanwhile, newly compiled programs instead call get_year_v2, without having to modify their source code at all! This enables types such as time_t and intmax_t to be transitioned without breaking any code.I think it’s a useful tool but I don’t think it’s an ABI versioning panacea (even c++ adoption of inline namespaces within libraries is limited with the standard library being the only place I’ve seen it used in a meaningful way).
You don't need LTO for dead code elimination.
And the new code adopts get_year_64 directly and you don’t blow up system complexity with features that you don’t really need.
Old functions should not have first mover advantages on names, nobody wants to riddle their function calls with *_v2 all over the place, and neither do library maintainers want people to keep using *_v2 when *_v3 fixes issues present in *_v2.
I agree there's a lot of fluff in the article but complaining even more when someone goes out of their way to appease you is just too much.