Date: Mon, 29 Sep 2025 22:27:43 +0200
Please, see attached also P3851 which summarizes the position of Spain's
NB. It will be available in the next mailing.
It will also be referenced in Spain NB comments.
On Mon, Sep 29, 2025 at 10:14 PM John Spicer via SG21 <sg21_at_[hidden]>
wrote:
> I think that compile-time and link-time selection of semantics is a
> desirable feature.
>
> But that misses the essential point of p3835r0 that the semantics need to
> apply to software “components” and not to translation units or to the
> entire program.
>
> If you consider the example in the paper I referenced, it is essential
> that the check in l1.cpp fail.
>
> There could be some other contract check in c1.cpp that is expected to be
> ignored.
>
> The key issue is not, IMO, how you control a “checking mode” that applies
> to a TU or the program, the issue is how you apply various “checking modes”
> to different components (e.g., libraries).
>
> There are a number of possible solutions to this problem, each of which
> have their own tradeoffs.
>
> But the first step is the recognition that this is a problem that needs to
> be solved in order for contracts to be viable in the real world.
>
> John.
>
> > On Sep 24, 2025, at 6:08 PM, Iain Sandoe via SG21 <sg21_at_[hidden]>
> wrote:
> >
> >
> >
> >> On 24 Sep 2025, at 22:48, Tom Honermann via SG15 <sg15_at_[hidden]>
> wrote:
> >>
> >> On 9/24/25 10:26 AM, Ville Voutilainen via SG15 wrote:
> >>> On Wed, 24 Sept 2025 at 17:06, Harald Achitz via SG15
> >>> <sg15_at_[hidden]> wrote:
> >>>> Having some interest on the build issue myself, I would be thankful
> to learn about the following topics:
> >>>>
> >>>> Will it be easily manageable to tell the linker: hey, give me libfoo
> with contract assertions enabled, and that is using this special contract
> handler? And get an error if libfoo in that flavor is not available, but
> only in others other configuration.
> >>> I'm unaware of an implementation that allows you to choose the
> >>> contract evaluation semantic at link time. There's been talk about
> >>> that,
> >>> but no implementation yet. And, as <see below>, you can't have
> >>> per-library violation handlers. Except on Windows you might, which
> >>> is yet another unanswered question in the face of lack of both
> >>> implementation and deployment experience.
> >>>
> >>>> or is it only easily manageable when you build the whole source tree
> including dependencies with profiles / tripplets, or what ever your control
> file is.
> >>> The contract evaluation semantic is chosen at compile-time. Which of
> >>> course means it isn't always easily manageable when you don't
> >>> (re-)compile every library you use.
> >>
> >> Existing implementations select the contract evaluation semantic at
> compile-time, but the standard does not distinguish between compile-time or
> run-time selection except in the case of constant evaluation.
> >>
> >> I agree that we lack implementation and deployment experience for
> implementation strategies that delay contract evaluation semantic selection
> until run-time. I remain quite interested in such strategies, but
> unfortunately am not available to explore them myself. I expect that
> current efforts in post-link optimization (PLO) will eventually yield a
> good solution.
> >
> > I have a Proof-of-concept for the link-time semantic - including a
> demonstration that link-time-optimisation can yield good results
> > We will try to make that PoC public as soon as possible.
> > It should also be extensible to run-time (but with understandably
> different trade-offs).
> >
> > Iain
> >
> >>
> >> Tom.
> >>
> >> _______________________________________________
> >> SG15 mailing list
> >> SG15_at_[hidden]
> >> https://lists.isocpp.org/mailman/listinfo.cgi/sg15
> >
> >
> > _______________________________________________
> > SG21 mailing list
> > SG21_at_[hidden]
> > Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/sg21
> > Link to this post: http://lists.isocpp.org/sg21/2025/09/11179.php
>
> _______________________________________________
> SG21 mailing list
> SG21_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/sg21
> Link to this post: http://lists.isocpp.org/sg21/2025/09/11202.php
>
NB. It will be available in the next mailing.
It will also be referenced in Spain NB comments.
On Mon, Sep 29, 2025 at 10:14 PM John Spicer via SG21 <sg21_at_[hidden]>
wrote:
> I think that compile-time and link-time selection of semantics is a
> desirable feature.
>
> But that misses the essential point of p3835r0 that the semantics need to
> apply to software “components” and not to translation units or to the
> entire program.
>
> If you consider the example in the paper I referenced, it is essential
> that the check in l1.cpp fail.
>
> There could be some other contract check in c1.cpp that is expected to be
> ignored.
>
> The key issue is not, IMO, how you control a “checking mode” that applies
> to a TU or the program, the issue is how you apply various “checking modes”
> to different components (e.g., libraries).
>
> There are a number of possible solutions to this problem, each of which
> have their own tradeoffs.
>
> But the first step is the recognition that this is a problem that needs to
> be solved in order for contracts to be viable in the real world.
>
> John.
>
> > On Sep 24, 2025, at 6:08 PM, Iain Sandoe via SG21 <sg21_at_[hidden]>
> wrote:
> >
> >
> >
> >> On 24 Sep 2025, at 22:48, Tom Honermann via SG15 <sg15_at_[hidden]>
> wrote:
> >>
> >> On 9/24/25 10:26 AM, Ville Voutilainen via SG15 wrote:
> >>> On Wed, 24 Sept 2025 at 17:06, Harald Achitz via SG15
> >>> <sg15_at_[hidden]> wrote:
> >>>> Having some interest on the build issue myself, I would be thankful
> to learn about the following topics:
> >>>>
> >>>> Will it be easily manageable to tell the linker: hey, give me libfoo
> with contract assertions enabled, and that is using this special contract
> handler? And get an error if libfoo in that flavor is not available, but
> only in others other configuration.
> >>> I'm unaware of an implementation that allows you to choose the
> >>> contract evaluation semantic at link time. There's been talk about
> >>> that,
> >>> but no implementation yet. And, as <see below>, you can't have
> >>> per-library violation handlers. Except on Windows you might, which
> >>> is yet another unanswered question in the face of lack of both
> >>> implementation and deployment experience.
> >>>
> >>>> or is it only easily manageable when you build the whole source tree
> including dependencies with profiles / tripplets, or what ever your control
> file is.
> >>> The contract evaluation semantic is chosen at compile-time. Which of
> >>> course means it isn't always easily manageable when you don't
> >>> (re-)compile every library you use.
> >>
> >> Existing implementations select the contract evaluation semantic at
> compile-time, but the standard does not distinguish between compile-time or
> run-time selection except in the case of constant evaluation.
> >>
> >> I agree that we lack implementation and deployment experience for
> implementation strategies that delay contract evaluation semantic selection
> until run-time. I remain quite interested in such strategies, but
> unfortunately am not available to explore them myself. I expect that
> current efforts in post-link optimization (PLO) will eventually yield a
> good solution.
> >
> > I have a Proof-of-concept for the link-time semantic - including a
> demonstration that link-time-optimisation can yield good results
> > We will try to make that PoC public as soon as possible.
> > It should also be extensible to run-time (but with understandably
> different trade-offs).
> >
> > Iain
> >
> >>
> >> Tom.
> >>
> >> _______________________________________________
> >> SG15 mailing list
> >> SG15_at_[hidden]
> >> https://lists.isocpp.org/mailman/listinfo.cgi/sg15
> >
> >
> > _______________________________________________
> > SG21 mailing list
> > SG21_at_[hidden]
> > Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/sg21
> > Link to this post: http://lists.isocpp.org/sg21/2025/09/11179.php
>
> _______________________________________________
> SG21 mailing list
> SG21_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/sg21
> Link to this post: http://lists.isocpp.org/sg21/2025/09/11202.php
>
Received on 2025-09-29 20:28:24