C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Versioned Standard

From: William Linkmeyer <wlink10_at_[hidden]>
Date: Mon, 19 Sep 2022 22:22:05 -0400
Thank you.

> Libraries may version themselves, but version numbers are used for
> more than just ABI instability. The ABI can be stable even if the
> internal behavior has changed in some way that breaks your program.

The versioned standard is meant to clarify some assumptions that user’s code would otherwise need to make about its associated standard.

For example, some library I write today will assume that exceptions hold a global mutex across all threads of execution in the context of a try/catch block.

Libraries which link with mine must blindly assume that their exception model is identical to mine.

I will craft and gather more examples and mitigation strategies. For example, how the `std::string` fiasco could have been avoided if the standard’s compatibility range, supplied by the author, was embedded within the binary.

All of your other comments are also worthwhile and will be addressed this weekend.

WL

> On Sep 19, 2022, at 9:56 PM, Jason McKesson via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> On Mon, Sep 19, 2022 at 9:22 PM William Linkmeyer via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>>
>>
>> # Versioned Standard
>>
>> ### Document: <awaiting>
>>
>> ### Date: September 19, 2022
>>
>> ### Audience: LEWG
>>
>> ### Reply To: willhl_at_[hidden]
>>
>> ## Introduction
>>
>> ABI stability is a communication problem. Libraries, meant to be shared, often version themselves. The obvious purpose is to communicate change over time.
>
> Libraries may version themselves, but version numbers are used for
> more than just ABI instability. The ABI can be stable even if the
> internal behavior has changed in some way that breaks your program.
>
>> The standard library itself is often versioned. Some shared standard library, `libc++.so.0`, may differ from some other shared standard library, `libc++.so.9`.
>>
>> There is no reliable channel of communication between between libraries and their associated standards.
>
> There is no reliable channel of communication between libraries at
> all, even ignoring whether the standard library is involved. So even
> if you could solve the issue regarding the standard library, the issue
> remains for all other libraries.
>
>> ## Motivation
>>
>> ABI is a perennial issue. Tools must be provided to users who wish to specify their intended standard library version.
>
> "Must" is a strong word to be throwing around when your motivation
> section is only two sentences long. Can you not provide any more
> motivation than this? Like, maybe some code examples of problems that
> can occur and how your suggestion would fix them?
>
>> ## Implementation
>>
>> Introduce the *language* template to specify the intended standard version range to be used:
>>
>> ```c++
>> using std = std::v<2017, 2023>;
>> ```
>>
>> Which will embed an implementation-defined hint within the resulting binary.
>
> What does this actually do? It doesn't seem to do anything to the
> language, and your chosen syntax reuses a keyword that already has
> *three* almost entirely unrelated meanings.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2022-09-20 02:22:18