C++ Logo

sg15

Advanced search

Re: [isocpp-sg15] [isocpp-admin] Swedish mirror committee consideration on the current working draft

From: Michael Spencer <bigcheesegs_at_[hidden]>
Date: Thu, 2 Oct 2025 15:09:42 -0700
We looked at a few different papers about contracts focusing mostly on the
implementability of mixing checking modes. From the github tracking:

> SG15 discussed various implementation strategies for contracts with a few
Itanium C++ ABI people, and a contracts implementer in the room. We had no
tooling related concerns with contracts, but believe that the best ABI
would require linker changes to get the best performance.

We had implementers from EDG, GCC, and Clang present.

>From what I recall nobody had concerns that contracts is unimplementable,
there was mostly discussion around how optimal the implementation could be
in the presence of mixed modes. Contracts allowing multiple evaluation of
checks makes a lot more implementation strategies viable. Inline functions
(including template instantiations) can end up with any semantic that
appeared in the program, but the standard also allows this, so that's fine.

I don't recall going into detail about build systems, but I do recall
discussion of how this is largely the same problem as any other benign ODR
violation that build systems handle today, such as mixing language versions
or exceptions on vs. off. The standard just blesses this in the right ways
to not technically be an ODR violation.

So to be precise I would say that nobody in the SG15 meetings where this
was discussed expressed strong concerns about the implementability of
contracts as specified in P2900 from a compiler or build system perspective.

- Michael Spencer

On Thu, Oct 2, 2025 at 1:50 PM Herb Sutter <herb.sutter_at_[hidden]> wrote:

> Pinging *Michael S*, do you have a comment on the SG15 summary below —
> did I hear/understand correctly? (Sorry if this is catching you while out
> of office.)
>
>
>
> Herb
>
>
>
> P.S.: FYI, my CppCon contracts talks two weeks ago is now live
> <https://herbsutter.com/2025/10/01/my-other-cppcon-talk-video-is-now-available-the-joy-of-c26-contracts-and-some-myth-conceptions/>
> – my aim was to provide a complete summary of the current design (3 slides,
> 15-17) and all the usage guidance I know (5 slides, 21-25), plus to present
> all the main “for” and “against” arguments/concerns. Thank you to all the
> experts who answered my questions. All errors and omissions are mine.
>
>
>
> Also at CppCon:
>
> - There was also another talk by Microsoft+Bloomberg on how contracts
> light up static analysis for CodeQL. That video is not yet available but
> I’ll post a link when it is — hopefully in the next week.
> - Daisy Hollman (now at Anthropic) mentioned some new information that
> AFAIK we didn’t previously consider, that contracts is very important for
> AI. We’ve asked if she would write it up as a short paper, if she has time.
>
>
>
>
>
>
>
> *From:* Herb Sutter <herb.sutter_at_[hidden]>
> *Sent:* Tuesday, September 30, 2025 11:53 AM
> *To:* 'sg15_at_[hidden]' <sg15_at_[hidden]>; '
> sg21_at_[hidden]' <sg21_at_[hidden]>; 'Michael Spencer' <
> bigcheesegs_at_[hidden]>
> *Cc:* 'René Ferdinand Rivera Morell' <grafikrobot_at_[hidden]>
> *Subject:* RE: [isocpp-sg15] [isocpp-admin] Swedish mirror committee
> consideration on the current working draft
>
>
>
> This reminds me, I wanted to +Michael to ask for a fact-check:
>
>
>
> Michael, I’ve been told by several people that when SG15 (tooling) did
> discuss contracts and build systems at a recent meeting, no one in the room
> raised any objections, including experts in the room who were and are
> opposed to contracts in C++26.
>
>
>
> Is that summary correct? Please correct if I’m misinformed or
> misunderstood!
>
>
>
>
>
>
>
>
>
> *From:* SG15 <sg15-bounces_at_[hidden]> *On Behalf Of *René
> Ferdinand Rivera Morell via SG15
> *Sent:* Tuesday, September 30, 2025 11:26 AM
> *To:* sg21_at_[hidden]; ISO C++ Tooling Study Group <
> sg15_at_[hidden]>
> *Cc:* René Ferdinand Rivera Morell <grafikrobot_at_[hidden]>
> *Subject:* Re: [isocpp-sg15] [isocpp-admin] Swedish mirror committee
> consideration on the current working draft
>
>
>
> On Wed, Sep 24, 2025 at 8:36 AM René Ferdinand Rivera Morell <
> grafikrobot_at_[hidden]> wrote:
>
> On Wed, Sep 24, 2025 at 6:10 AM Harald Achitz via Admin <
> admin_at_[hidden]> wrote:
>
> The Swedish SC22 mirror committee TK611/AG09 has discussed the current
> working draft of C++26 and identified concerns regarding contract
> assertions. We have summarized these in the attached document.
>
> As convener, I see it as my duty to mediate these concerns. I would
> therefore appreciate guidance on how to proceed and to ensure that our
> experts’ concerns, as well as similar concerns from others, are taken
> into account.
>
>
>
> From the comments:
>
>
>
> Contracts introduce several new build configurations. The impact on the
> build system and binary
> dependency management has not received sufficient focus.
>
>
>
> I wanted to address the fears regarding build systems. But I didn't have
> time to write up implemented examples until yesterday. Last night I
> implemented Contracts build support for B2 (aka Boost.Build). It took me
> less than an hour to implement that support. The parts of that are these
> segments (the rest are documentation comments and examples):
>
>
>
> <
> https://github.com/bfgroup/b2/commit/3b20a4e16594b19a38f006a7af051c775bf0e1c9#diff-0fc008a10b15f249e1b7f2dffc067eadae061007e7b8a83122cb6a562ce0de11R20-R24
> >
>
> <
> https://github.com/bfgroup/b2/commit/3b20a4e16594b19a38f006a7af051c775bf0e1c9#diff-0fc008a10b15f249e1b7f2dffc067eadae061007e7b8a83122cb6a562ce0de11R45-R48
> >
>
> <
> https://github.com/bfgroup/b2/commit/3b20a4e16594b19a38f006a7af051c775bf0e1c9#diff-33537906d8dfd13afc76c7734b09d22c4d7716e45250cefc65ae2086b26e560cR719-R724
> >
>
>
>
> I also created a simple example showing the matrix of using static vs
> dynamic linking a library with contracts, vs enforce/ignore semantics on
> main(), vs enforce/ignore semantics on the library. That's in this repo <
> https://github.com/grafikrobot/cpp_contracts_example>.
>
>
>
> The comparison I like to raise with that is that I have yet to implement
> Modules support in B2 because that has-taken / is-taking serious amount of
> reengineering.
>
>
>
>
>
> --
>
> -- René Ferdinand Rivera Morell
> -- Don't Assume Anything -- No Supongas Nada
> -- Robot Dreams - http://robot-dreams.net
>

Received on 2025-10-02 22:09:58