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

P2216 std::format improvements #919

Closed
wg21bot opened this issue Sep 23, 2020 · 14 comments · Fixed by cplusplus/draft#4680
Closed

P2216 std::format improvements #919

wg21bot opened this issue Sep 23, 2020 · 14 comments · Fixed by cplusplus/draft#4680
Labels
C++23 Targeted at C++23 IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote.
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Sep 23, 2020

P2216R0 std::format improvements (Victor Zverovich)

@wg21bot wg21bot added the LEWG Library Evolution label Sep 23, 2020
@wg21bot wg21bot added this to the 2020-telecon milestone Sep 23, 2020
@brycelelbach brycelelbach added C++23 Targeted at C++23 IS Ship vehicle: IS B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting and removed C++23 Targeted at C++23 labels Oct 15, 2020
@ben-craig ben-craig added needs-revision Paper needs changes before it can proceed and removed ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting labels Nov 13, 2020
@ben-craig
Copy link
Collaborator

P2216R0: std::format improvements

P2216R0: std::format improvements

2020-11-10 Library Evolution Telecon Minutes

Chair: Ben Craig

Champion: Victor Zverovich

Minute Taker: Inbal Levi

Start: 2020-11-10 12:10 US CST

Pros:

  • Prevents common mistakes, improving safety
  • Reduces code bloat

Cons:

  • Source breaking change (no shipping implementations yet)
  • ABI breaking change (no shipping implementations yet)
  • Requires either new compiler support, or future core language features

End: 13:10

SUMMARY: This paper is currently two proposals in one. The first is to add compile time checking to std::format, similar to the warning mechanisms many implementations already have for printf-like facilities. The second part of the paper reduces code bloat. Both of these are breaking changes, but if wg21 gets the changes into the working draft soon enough, no users will be broken, as there aren't any shipping implementations right now.

LEWG spent a great deal of time discussing implementability concerns, as well as the trade-offs between IFNDR, ill-formed, and well-formed + QOI warnings.

POLL: We should promise more committee time to pursuing the compile time checking aspects of P2216R0, knowing that our time is scarce and this will leave less time for other work.

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
6 6 3 0 0

Attendance: 21

# of Authors: 1

Author Position: SF

Outcome: Consensus to pursue

POLL: We should promise more committee time to pursuing the code bloat aspects of P2216R0, knowing that our time is scarce and this will leave less time for other work.

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
3 8 6 0 0

Attendance: 21

# of Authors: 1

Author Position: SF

Outcome: Consensus to Pursue

Request to split the paper into parts

POLL: (direction) We are comfortable having std::format compile time check failures cause the program to be ill-formed, no diagnostic required.

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
0 1 2 4 8

Attendance: 23

# of Authors: 1

Author Position: N

Outcome: LEWG is not comfortable with IFNDR

Recommend looking at builtin constant implementation methods

POLL: (direction) LEWG would prefer std::format compile time check failures to cause the program to be ill-formed (diagnostic required).

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
5 7 1 0 0

Attendance: 23

# of Authors: 1

Author Position: SF

Outcome: LEWG prefers ill-formed

N: Difference between a wish and a educated guidance. Need more experience since we don't have the language facilities.

POLL: (direction) We are comfortable having std::format compile time checks rely on compiler extensions to be implementable.

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
3 3 4 4 0

Attendance: 23

# of Authors: 1

Author Position: SF

Outcome: LEWG is somewhat is uncomfortable with relying on compiler extensions for this facility

WA: It seems reasonable to be able to provide this checking facility in general

@wg21bot
Copy link
Collaborator Author

wg21bot commented Dec 27, 2020

P2216R1 std::format improvements (Victor Zverovich)

@wg21bot wg21bot removed the needs-revision Paper needs changes before it can proceed label Dec 27, 2020
@wg21bot wg21bot modified the milestones: 2020-telecon, 2021-telecon Dec 27, 2020
@FabioFracassi
Copy link
Collaborator

Summary

We discussed compile time correctness checks for std::format format strings. Two options were presented and we went with the more conservative one. We discussed a technique to reduce the binary size of std::format_to by (partially) type-erasing the output-iterator.

The paper was well prepared and motivated, and the discussion re-affirmed the direction of the paper. Most of the discussion was about the feasibility of introducing these changes, as they are breaking the currently specified status quo. We felt that the changes are sufficiently useful to do this even if it is a breaking change. We would prefer to treat this as a defect, i.e. urge implementers to ship only the newer specification.

Outcome

We voted in two breaking changes (wrt C++20) in the design of format. We did this with the understanding that std::format is not yet shipping in any implementation, and the strong encouragement that implementors should prefer the newer design from the beginning to avoid inconsistency and churn for the users.

Polls

Poll: We prefer Option 2 (only string literals) over option 1 (all constexpr format str)

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
0 3 0 7 2

Attendance: 22

# of Authors: 1

Author Position: SA

Outcome: Stay with option 1

Poll: We want to adopt the binary size reduction presented in P2216r1 even if it is a breaking change against C++20.

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
4 8 0 0 0

Attendance: 23

# of Authors: 1

Author Position: SF

Outcome: Strong consensus for change.

Poll: We would prefer the binary size reduction change to be made as a DR against C++20

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
7 6 3 0 0

Attendance: 23

# of Authors: 1

Author Position: SF

Outcome: Strong consensus for DR

Poll: We would prefer the compile time checking change to be made as a DR against C++20

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
7 7 1 0 0

Attendance: 23

# of Authors: 1

Author Position: SF

Outcome: Strong consensus for DR

Poll: Pending a wording review from Tim Song we want the next revision of this paper to proceed to electronic balloting with priority B1 (focus).

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
9 5 0 0 0

Attendance: 19

# of Authors: 1

Author Position: SF

Outcome: Strong consensus, we want this paper to proceed.

@FabioFracassi FabioFracassi added B1 - focus Bucket 1 as described by P0592: material that is mentioned in this plan. needs-revision Paper needs changes before it can proceed and removed B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e labels Jan 12, 2021
@jwakely
Copy link
Member

jwakely commented Jan 15, 2021

Billy Baker pointed out that C++23 should include an Annex C entry calling out the difference from C++20. Please add that to the proposal.

@vitaut
Copy link

vitaut commented Jan 15, 2021

Please add that to the proposal.

Will do.

@wg21bot
Copy link
Collaborator Author

wg21bot commented Jan 22, 2021

P2216R2 std::format improvements (Victor Zverovich)

@wg21bot wg21bot removed the needs-revision Paper needs changes before it can proceed label Jan 22, 2021
@brycelelbach brycelelbach added ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll C++23 Targeted at C++23 B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e and removed B1 - focus Bucket 1 as described by P0592: material that is mentioned in this plan. labels Jan 23, 2021
@JeffGarland
Copy link
Member

Tentatively planned for LWG review 2020-02-05

@JeffGarland JeffGarland added LWG Library lwg-fullreview Paper is ready for lwg full group review labels Jan 29, 2021
@JeffGarland
Copy link
Member

Reviewed and approved for c++23 with preference to apply changes backward to c++20. We will wait to put in plenary for final LEWG electronic poll completes -- so summer 2021.

poll: do we want to put P2216r3 into C++23 after the requested edits are reviewed by CC and JG (pending LEWG approval)?

F A N
13 0 0

https://wiki.edg.com/bin/view/Wg21telecons2021/P2216-20210205

@JeffGarland JeffGarland removed the lwg-fullreview Paper is ready for lwg full group review label Feb 5, 2021
@wg21bot
Copy link
Collaborator Author

wg21bot commented Feb 22, 2021

P2216R3 std::format improvements (Victor Zverovich)

@brycelelbach brycelelbach added ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll scheduled-for-library-evolution-electronic-poll and removed ready-for-library-evolution-electronic-poll This paper needs to undergo a Library Evolution electronic poll labels Feb 22, 2021
@brycelelbach
Copy link

brycelelbach commented Mar 12, 2021

2021 Winter Library Evolution Polls

P2333: 2021 Winter Library Evolution Poll Outcomes

POLL 3: Send P2216R2 (std::format Improvements) to LWG for C++23, classified as an improvement of an existing feature (P0592R4 bucket 2 item).

Strongly Favor Weakly Favor Neutral Weakly Against Strongly Against
15 11 1 0 0

Outcome: Strong consensus in favor.

Outcome

Send P2216R2 (std::format Improvements) to LWG for C++23, classified as an improvement of an existing feature (P0592R4 bucket 2 item).

@brycelelbach
Copy link

@JeffGarland I marked this tentatively-ready-for-lwg, which I hope is the right status.

@JeffGarland
Copy link
Member

LWG has already completed work -- moving as ready for plenary.

@JeffGarland JeffGarland added tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. and removed B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e tentatively-ready-for-lwg labels Mar 13, 2021
@JeffGarland JeffGarland added the C++20 Targeted at C++20 label Apr 9, 2021
@JeffGarland
Copy link
Member

Adding the c++20 label to indicate the desire for this to be applied to c++20 implementations

@cor3ntin cor3ntin added plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. and removed tentatively-ready-for-plenary Reviewed between meetings; ready for a vote. labels Jun 7, 2021
@wg21bot
Copy link
Collaborator Author

wg21bot commented Oct 26, 2021

Adopted 2021-06.

@jensmaurer jensmaurer removed the C++20 Targeted at C++20 label Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++23 Targeted at C++23 IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants