<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>To boldly suggest an overall plan for C++23</title>

	<style>
	p {text-align:justify}
	li {text-align:justify}
	blockquote.note
	{
		background-color:#E0E0E0;
		padding-left: 15px;
		padding-right: 15px;
		padding-top: 1px;
		padding-bottom: 1px;
	}
	ins {color:#00A000}
	del {color:#A00000}
	</style>
</head>
<body>

<address align=right>
Document number: P0592R1
<br/>
Audience: Direction
<br/>
<br/>
<a href="mailto:ville.voutilainen@gmail.com">Ville Voutilainen</a><br/>
2019-06-17<br/>
</address>
<hr/>
<h1 align=center>To boldly suggest an overall plan for C++23</h1>

<h2>Abstract</h2>
<p>
  Various people have lamented our lack of direction, and that we
  don't have a plan for the next standard (or beyond). Since I
  haven't heard anyone promising to propose such a plan, here goes.
  In a nutshell, the plan is thus: for C++23, let's work towards
  having the following things in that standard:
  <ul>
    <li>Library support for coroutines</li>
    <li>Executors</li>
    <li>Networking</li>
  </ul>
  Without a particular ship vehicle yet, we should also make progress on
  <ul>
    <li>Reflection</li>
    <li>Pattern matching</li>
  </ul>
  All good? Agreed? Right, carry on. :) In case you want some
  elaboration, read on. I will elaborate on what C++23 Must Ship
  and things that should progress during the standardization of C++23,
  but do not necessarily need to be in C++23.
</p>

<h2>C++23 must-have-do-not-fail-to-ship items</h2>

<p>
  As stated in the abstract, these items are
  <ul>
    <li>Library support for coroutines</li>
    <li>Executors</li>
    <li>Networking</li>
  </ul>
  Keen-eyed readers will notice that these are all library facilities,
  and the must-have list contains no language facilities. That's intentional.
</p>

<h3>Library support for coroutines</h3>

<p>
  Coroutines are in C++20. The only problem is that users can't do anything
  with them, because there are no types that are coroutine-aware. It should
  be fairly non-controversial that we need to fix this problem in C++23.
  What exactly are the coroutine-aware types that should ship in C++23 is
  to-be-defined by LEWG, but in general, the expectation would be that
  there are task types that would be plausible, but we should also take
  another hard look at which existing standard types could or should be made
  coroutine-aware. At any rate, the standard library should provide
  some coroutine-supporting types out of the box.
</p>

<h3>Executors</h3>

<p>
  We need executors for half-everything; we need them for networking,
  we probably need them for audio (if we go further in that direction),
  we need them for heterogeneous hardware, we need them for a better
  async, we need them for better task types. We have been working on
  executors for quite a while, and in C++23, we should deliver.
</p>

<h3>Networking</h3>

<p>
  We should lower the barrier of writing networked C++ applications.
  We have a TS, we have years of existing practice, so once the blocker
  item is resolved, we should standardize networking. This shouldn't
  require much more rationale, but once the foundational facilities
  are in the standard library, writing cross-platform http code that
  requires no additional libraries to be built is right around the corner,
  and we should make that possible.
</p>

<h2>Items that should make progress, but can land later than C++23,
  or can land in a separate ship vehicle</h2>

<h3>Reflection</h3>

<p>
  Reflection has a lot to offer: more powerful generic programming,
  including proxies, adapters, mediators; all sorts of things
  we use separate code generators for, persistence, remoting, glue code
  interfacing with other languages;
  aspect-oriented programming in general; better logging facilities,
  the list(s) go on and on.
</p>
<p>
  Reflection (and code injection) covers a lot of ground, plugging feature
  holes in areas where programmers want and need to use C++, as opposed
  to trying to handle all this functionality with myriad smaller 'hard-coded'
  language extensions.
</p>
<p>
  We have a TS, we have ongoing work for a constexpr-based approach,
  including prototype implementations. We should ship that work for
  the benefit of our user community, but when and in what form is
  not entirely clear yet.
</p>

<h3>Pattern matching</h3>

<p>
  While we often say that C++ needs new control statements like it
  needs a hole in the head, pattern matching shows a lot of promise
  to deliver better filters/chains/selections than what we can
  approximate with pure-library facilities.
</p>
<p>
  There's fair amounts of ongoing work in this area, and we should
  give it air time during the C++23 time frame. How to ship it, and
  in what form, is again not entirely clear yet.
</p>

<h2>Where are nex-gen Ranges in this plan?</h2>

<p>
  We could certainly entertain more Actions and Views in the realm
  of Ranges. Whether such material appears for standardization is a bit
  unknown at this point.
</p>

<h2>What about my favorite idea X, Y, foo and bar?</h2>

<p>
  We need a plan on which we focus, to make sure that the important
  things that we need to deliver are delivered. In order to introduce
  new high-priority items into a plan like this, feel free to try
  and convince the author of this plan that your favorite extension
  is
  <ol>
    <li>truly so important that it is either a must-ship item or must-progress item</li>
    <li>a good idea in general.</li>
  </ol>
</p>

</body>
</html>
