<p>I want to learn from how some existing, well-known, well-established languages define their standard libraries. As a first step- before getting in to the deeper &quot;why&quot; questions, I want to just understand the &quot;what&quot;. (I'll ask &quot;why?&quot; later as a follow up to this).</p>
<p>What criteria do library feature proposals generally need to meet for the C++ Committee to add (or consider adding) to its standard library? What's the overarching theme that ties those criteria together?</p>

<standard-library><c++>
How does the C++ Committee generally decide what does or doesn't go in its standard library?
CC BY-SA 4.0
2023-05-23T05:24:45.410Z
related on meta: https://languagedesign.meta.stackexchange.com/q/235/251
starball
CC BY-SA 4.0
2023-05-26T21:49:43.227Z
I'm voting to leave this open, as it's about how languages are designed. Understanding how existing languages make design decisions is useful and applicable to an audience of language designers, I see no reason to consider this off-topic or out of scope.
rydwolf
<p><a href="https://isocpp.org/wiki/faq/wg21#bryce-adelstein-lelbach" rel="noreferrer">Bryce Adelstein Lelbach</a> <a href="https://www.youtube.com/watch?v=lil4xfpmnF4&amp;t=1036s" rel="noreferrer">spoke on this in the CppCon 2020 Standards Committee Fireside Chat at t=17:16</a> (Bryce is the chair of the Standard C++ Library Evolution group at the time of this writing and was at the time that video was recorded).</p>
<p>For context, the question asked before the referenced clip begins was:</p>
<blockquote>
<p>C++ does not have a standard or even de facto logging API. Do we need to do something in the standard to catch up with other frameworks?</p>
</blockquote>
<p>Bryce gave a generalized answer on how the C++ Committee decides what goes in the C++ Standard Library:<br />
<sup><sub>(I have stripped out some &quot;filler words&quot; from the quote like &quot;um&quot;, &quot;uh&quot;, &quot;so,&quot;, etc. and added the numbered list formatting)</sub></sup>.</p>
<blockquote>
<p>I think there are a lot of things that we <em>could</em> add to the Standard Library, and a lot of things that exist in other languages' standard libraries, but in the C++ standard library, our priorities and the things that belong there [are] limited to a specific set of high-value things. <strong>Essentially, the things that I think belong in the Standard Library are the things that cannot go anywhere else.</strong> There's a few different categories of these things:</p>
<ol>
<li><p>[...] <strong>Vocabulary types</strong>.</p>
<p>You can't really have vocabulary types anywhere other than the Standard Library because the whole idea of vocabulary types is that it's a common type that everybody agrees upon.</p>
<p>[...] Instead of your library having a string type, and my library having a string type, and the third person's library having a string type, and then some user who's trying to use all those libraries having to traffic in multiple different string types, you have <em>one</em> string type- or as it is now, you have one string <em>interface</em> type- <code>string_view</code>.</p>
</li>
<li><p>[...] <strong>Abstractions around the platform</strong>.</p>
<p>[For example,] the concurrency library or file system. You could get a third-party library that could provide an implementation of those facilities for you, but oftentimes you want those facilities that are specific to your platform to be provided by the vendor for your platform. The person who's providing you with your C++ implementation on your platform is probably going to be best equipped to give you [...] the implementation of the abstractions for their platform. If I'm on Microsoft, I want the concurrency facilities that have been designed by the Microsoft engineers and designed to work well with MSVC.</p>
</li>
<li><p>[...] <strong>Things that require language support</strong>-</p>
<p>standard library facilities that aren't actually really standard library facilities, but are really just extensions of the language. For example, <code>&lt;type_traits&gt;</code> [...].</p>
</li>
</ol>
<p>Those three categories of things [...] are the primary priorities that we have because those are things that cannot be satisfied by <em>any</em> other library other than the Standard Library. So we have to focus on those first as our priorities. There's so much that we <em>could</em> do, and we still have a lot to do to even satisfy all the things that fall into <em>those</em> categories.</p>
<p>Now, something like a logging library, that might be nice to have, but the question is: Is it essential? Can we add greater value in having a standard library logging facility instead of- say- working to make it easier for people to use <em>third-party</em> libraries so that you can use some awesome third-party logging facility. So I think that unlike in other languages, in C++, our focus should be on a really <em>high quality but focused</em> standard library. But then, we should [also] be spending more effort on making it easier to use third-party libraries which means enabling things like packaging, et cetera.</p>
</blockquote>
<p>(For what it's worth, Tony Van Eerd follows up <a href="https://youtu.be/lil4xfpmnF4?t=1362" rel="noreferrer">at t=22:42</a> on the discussion with a point that there could be value in having a logging <em>interface</em> as a &quot;vocabulary type&quot; in the Standard Library (along with some other good points before that)).</p>
<p>Bjarne also follows up <a href="https://www.youtube.com/watch?v=lil4xfpmnF4&amp;t=1643s" rel="noreferrer">at t=27:23</a> getting at a point that the C++ Comittee likes or would like to let the user community experiment with library designs for things that could make good future standard library proposals and let community preferences emerge over time, and use that to inform design decisions:</p>
<blockquote>
<p>We have to remember that other languages in the former sense tend not to have standards. I mean Java, Python, etc. They don't go through an ISO process and have a formal specification or all that stuff. Instead, they have good distribution mechanisms like Bryce pointed out we need: packaging distribution, central places for storing things, and that way you can have- sort of a [...] shootout before something wins and becomes a de facto standard. [...] If we could get a decent package manager and distribution system, I predict [the C++ Standard Library] would have a logger within a year. Because there are several good ones. They tend to be corporate or not that widely available.</p>
</blockquote>
<p>(I think <a href="https://www.boost.org/" rel="noreferrer">Boost</a> has historically contributed to examples of this kind of thing happening (related on Stack Overflow: <a href="https://stackoverflow.com/q/59912393/11107541">Boost Libraries that made it into the C++ standard</a>))</p>
<p>You'll also notice that the committee members are very aware of needs to better tooling (including package management as a subset of that). If you're interested in that, see Working Group 15 (the tooling working group) and their work.</p>

CC BY-SA 4.0
2023-05-23T00:13:00.950Z
2023-05-23T00:13:00.950Z
starball
# How does the C++ Committee generally decide what does or doesn't go in its standard library?
Posted by: username_0 on 2023-05-23
I want to learn from how some existing, well-known, well-established languages define their standard libraries. As a first step- before getting in to the deeper "why" questions, I want to just understand the "what". (I'll ask "why?" later as a follow up to this).

What criteria do library feature proposals generally need to meet for the C++ Committee to add (or consider adding) to its standard library? What's the overarching theme that ties those criteria together?
**Tags:** standard-library c++
> **Comments:**
> **username_0**: related on meta: https://languagedesign.meta.stackexchange.com/q/235/251  
> **username_1**: I'm voting to leave this open, as it's about how languages are designed. Understanding how existing languages make design decisions is useful and applicable to an audience of language designers, I see no reason to consider this off-topic or out of scope.  
---
## 1 answers
### Answer by username_0 on 2023-05-23. Score: 5 | Accepted answer
[Bryce Adelstein Lelbach](https://isocpp.org/wiki/faq/wg21#bryce-adelstein-lelbach) [spoke on this in the CppCon 2020 Standards Committee Fireside Chat at t=17:16](https://www.youtube.com/watch?v=lil4xfpmnF4&t=1036s) (Bryce is the chair of the Standard C++ Library Evolution group at the time of this writing and was at the time that video was recorded).

For context, the question asked before the referenced clip begins was:

> C++ does not have a standard or even de facto logging API. Do we need to do something in the standard to catch up with other frameworks?

Bryce gave a generalized answer on how the C++ Committee decides what goes in the C++ Standard Library:  
(I have stripped out some "filler words" from the quote like "um", "uh", "so,", etc. and added the numbered list formatting).

> I think there are a lot of things that we *could* add to the Standard Library, and a lot of things that exist in other languages' standard libraries, but in the C++ standard library, our priorities and the things that belong there [are] limited to a specific set of high-value things. **Essentially, the things that I think belong in the Standard Library are the things that cannot go anywhere else.** There's a few different categories of these things:
>
> 1. [...] **Vocabulary types**.
>
>    You can't really have vocabulary types anywhere other than the Standard Library because the whole idea of vocabulary types is that it's a common type that everybody agrees upon.
>
>    [...] Instead of your library having a string type, and my library having a string type, and the third person's library having a string type, and then some user who's trying to use all those libraries having to traffic in multiple different string types, you have *one* string type- or as it is now, you have one string *interface* type- `string_view`.
> 2. [...] **Abstractions around the platform**.
>
>    [For example,] the concurrency library or file system. You could get a third-party library that could provide an implementation of those facilities for you, but oftentimes you want those facilities that are specific to your platform to be provided by the vendor for your platform. The person who's providing you with your C++ implementation on your platform is probably going to be best equipped to give you [...] the implementation of the abstractions for their platform. If I'm on Microsoft, I want the concurrency facilities that have been designed by the Microsoft engineers and designed to work well with MSVC.
> 3. [...] **Things that require language support**-
>
>    standard library facilities that aren't actually really standard library facilities, but are really just extensions of the language. For example,  [...].
>
> Those three categories of things [...] are the primary priorities that we have because those are things that cannot be satisfied by *any* other library other than the Standard Library. So we have to focus on those first as our priorities. There's so much that we *could* do, and we still have a lot to do to even satisfy all the things that fall into *those* categories.
>
> Now, something like a logging library, that might be nice to have, but the question is: Is it essential? Can we add greater value in having a standard library logging facility instead of- say- working to make it easier for people to use *third-party* libraries so that you can use some awesome third-party logging facility. So I think that unlike in other languages, in C++, our focus should be on a really *high quality but focused* standard library. But then, we should [also] be spending more effort on making it easier to use third-party libraries which means enabling things like packaging, et cetera.

(For what it's worth, Tony Van Eerd follows up [at t=22:42](https://youtu.be/lil4xfpmnF4?t=1362) on the discussion with a point that there could be value in having a logging *interface* as a "vocabulary type" in the Standard Library (along with some other good points before that)).

Bjarne also follows up [at t=27:23](https://www.youtube.com/watch?v=lil4xfpmnF4&t=1643s) getting at a point that the C++ Comittee likes or would like to let the user community experiment with library designs for things that could make good future standard library proposals and let community preferences emerge over time, and use that to inform design decisions:

> We have to remember that other languages in the former sense tend not to have standards. I mean Java, Python, etc. They don't go through an ISO process and have a formal specification or all that stuff. Instead, they have good distribution mechanisms like Bryce pointed out we need: packaging distribution, central places for storing things, and that way you can have- sort of a [...] shootout before something wins and becomes a de facto standard. [...] If we could get a decent package manager and distribution system, I predict [the C++ Standard Library] would have a logger within a year. Because there are several good ones. They tend to be corporate or not that widely available.

(I think [Boost](https://www.boost.org/) has historically contributed to examples of this kind of thing happening (related on Stack Overflow: [Boost Libraries that made it into the C++ standard](https://stackoverflow.com/q/59912393/11107541)))

You'll also notice that the committee members are very aware of needs to better tooling (including package management as a subset of that). If you're interested in that, see Working Group 15 (the tooling working group) and their work.
---
