Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2123 interfaces: A Facility to Manage ABI/API Evolution #842

Open
wg21bot opened this issue Mar 24, 2020 · 2 comments
Open

P2123 interfaces: A Facility to Manage ABI/API Evolution #842

wg21bot opened this issue Mar 24, 2020 · 2 comments
Labels
B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 IS Ship vehicle: IS LEWG Library Evolution needs-revision Paper needs changes before it can proceed size - huge paper size estimate, biggest size

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Mar 24, 2020

P2123R0 interfaces: A Facility to Manage ABI/API Evolution (Hal Finkel, Tom Scogland)

@wg21bot wg21bot added EWGI Evolution Incubator LEWGI Library Evolution Incubator labels Mar 24, 2020
@wg21bot wg21bot added this to the 2020-telecon milestone Mar 24, 2020
@brycelelbach brycelelbach added LEWG Library Evolution B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 IS Ship vehicle: IS ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting and removed LEWGI Library Evolution Incubator labels Aug 25, 2020
@jensmaurer jensmaurer modified the milestones: 2020-telecon, 2021-telecon Dec 28, 2020
@brycelelbach brycelelbach added the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Feb 24, 2021
@brycelelbach brycelelbach removed the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Mar 24, 2021
@brycelelbach brycelelbach added the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Apr 23, 2021
@brycelelbach brycelelbach added library-evolution-deferred Ready for review, but should not be scheduled and removed ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels May 11, 2021
@brycelelbach
Copy link

2021-05-11 ISO C++ Library Evolution Telecon

P2123R0: Interfaces

2021-05-11 Library Evolution Telecon Minutes

Chair: Bryce Adelstein Lelbach

Champion: Hal Finkel & Tom Scogland

Minute Taker: Inbal Levi

Start: 2021-05-11 10:08 Pacific

Motivation:

  • We want the flexibility to change the implementation details and interfaces of types in order to enhance functionality and realize performance benefits.
  • We want interface stability necessary to compose software from time.
  • C++ lacks the facilities today to do this.

"On costs" slide typo - "technical dept" should be "technical debt".

Presentation Ends, Discussion Starts: 11:00

Idea: Mechanism for globally changing the default interface version and default level of resiliency.

Idea: Mechanism for different versions to exist within a single TU, including conversion from newer version objects to older version objects.

End: 11:31

Summary

Spurred by P2123 (interfaces), we had an excellent discussion of what the Standard Library would need from a language facility for resiliency and the nature and extent of Library Evolutionary challenges relating to stability. A few of the key takeaways from the discussion are summarized below.

We need clearer definitions of the problems we are trying to solve and the techniques we plan to use to solve them. For example, it is important to clearly differentiate between:

  • Changes to the Standard that would involve changing both the API (e.g. changing semantics) and ABI,
  • Changes to the Standard that would extend the API and change the ABI (e.g. adding virtual functions), and
  • Changes to Implementations that would not change the API but would change their ABI.

It is also important for us to establish a clear understanding of the distinction between various techniques and solutions in this space:

  • Stability: Maintaining API and/or ABI across versions.
  • Interoperability: When different versions can interact with each other correctly.
  • Resiliency: Mechanisms for allowing API and/or ABI to change without breaking interoperability.

An extensive and thorough study of specific places where we could improve the Standard Library if we could change the ABI, but not API or semantics, would be valuable. In particular, such a study for std::unordered_map and std::regex would be useful.

One of the main concerns with resiliency mechanisms like those proposed in P2123 are the costs and overheads, especially in cases where resiliency is not actually required. Breaking unique_ptr's ABI so that it can be passed cheaply to functions on the stack is potentially self-defeating if the resiliency mechanism requires that a resilient unique_ptr be passed via some compiler-generated type-erased wrapper. This is a classic C++ problem - we don't want to pay for what we don't use, but sometimes that leaves us lacking what we need.

If we have a resiliency mechanism, deciding the defaults for resiliency and stability will be challenging. The status quo is the that Standard Library facilities default to non-resilient and stable. P2123 suggests the default for Standard Library facilities should be non-resilient and non-stable; not all present agreed.

If a resiliency mechanism is on by default, then developers may end up paying for it when they don't need it. If a resiliency mechanism is not on by default, then developers may fail to use resiliency mechanisms when they should, causing problems for those who need to use their code. Those who need resiliency (the users of an interface) are not necessarily the ones who decide if the interface is resilient.

Supporting multiple distinct versions of a facility that can be used within the same TU is an approach that we feel has potential. Interoperability between objects of different versions could be achieved by making the newer versions convertible to and from the older versions. Then, users would only pay the cost of resiliency (conversion) when they need to call code that expects an older version of a facility.

New language facilities that make it easier to develop and maintain multiple distinct versions of facilities could make this approach feasible and sustainable enough for use in the Standard Library. Machinery similar to what's in P2123 could be support this technique.

@brycelelbach brycelelbach added needs-revision Paper needs changes before it can proceed size - huge paper size estimate, biggest size and removed library-evolution-deferred Ready for review, but should not be scheduled labels Aug 1, 2021
@jensmaurer jensmaurer removed this from the 2021-telecon milestone Nov 12, 2021
@cor3ntin cor3ntin added the EWG Evolution label Feb 22, 2022
@jfbastien jfbastien removed EWG Evolution EWGI Evolution Incubator labels Jun 4, 2023
@jfbastien
Copy link
Collaborator

@brycelelbach please assign to EWG once seen by LEWG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B3 - addition Bucket 3 as described by P0592: material that is not mentioned in P0592 IS Ship vehicle: IS LEWG Library Evolution needs-revision Paper needs changes before it can proceed size - huge paper size estimate, biggest size
Projects
None yet
Development

No branches or pull requests

5 participants