Summary / TL;DR
Project | Status |
C++14 | On track to be published late 2014 |
C++17 | A few minor features so far, including for (elem : range) |
Networking TS | Ambitious proposal to standardize sockets based on Boost.ASIO |
Filesystems TS | On track to be published late 2014 |
Library Fundamentals TS | Contains optional , any , string_view and more. Progressing well, expected early 2015 |
Library Fundamentals TS II | Follow-up to Library Fundamentals TS; will contain array_view and more. In early stage |
Array Extensions TS | Completely stalled. No proposal related to runtime-sized arrays/objects currently has consensus |
Parallelism TS | Progressing well; expected 2015 |
Concurrency TS | Executors and resumable functions need more work |
Transactional Memory TS | Progressing well; expected 2015-ish |
Concepts (“Lite”) TS | Progressing well; expected 2015 |
Reflection | A relatively full-featured compile-time introspection proposal was favourably reviewed. Might target a TS or C++17 |
Graphics | Moving forward with a cairo-based API, to be published in the form of a TS |
Modules | Clang has a complete implementation for C++, plan to push it for C++17 |
Introduction
Last week I attended another meeting of the ISO C++ Standards Committee in Rapperswil, Switzerland (near Zurich). This is the third Committee meeting I have attended; you can find my reports about the previous two here (September 2013, Chicago) and here (February 2014, Issaquah). These reports, particularly the Issaquah one, provide useful context for this post.
With C++14’s final ballot being still in progress, the focus of this meeting was the various language and library Technical Specifications (TS) that are planned as follow-ups to C++14, and on C++17.
C++14
C++14 is currently out for its “DIS” (Draft International Standard) ballot (see my Issaquah report for a description of the procedure for publishing a new language standard). This ballot was sent out at the end of the Issaquah meeting, and will close mid-August. If no national standards body poses an objection by then – an outcome considered very likely – then the standard will be published before the end of the year.
Since a ballot was in progress, no changes to the C++14 draft were made during the Rapperswil meeting.
C++17, and what’s up with all these TS’s?
ISO procedure allows the Committee to publish two types of documents:
- International Standards (IS). These are official standards with stringent backwards-compatibility requirements.
- Technical Specifications (TS) (formerly called Technical Reports (TR)). These are for things that are not quite ready to be enshrined into an official standard yet, and have no backwards-compatibility requirements. Specifications contained in a TS may or may not be added, possibly with modifications, into a future IS.
C++98 and C++11 are IS’s, as will be C++14 and C++17. The TS/TR form factor has, up until recently, only been used once by the Committee: for TR1, the 2005 library spec that gave us std::tr1::shared_ptr
and other library enhancements that were then added into C++11.
Since C++11, in an attempt to make the standardization process more agile, the Committee has been aiming to place significant new language and library features into TS’s, published on a schedule independent of the IS’s. The idea is that being in a TS allows the feature to gain user and implementation experience, which the committee can then use to re-evaluate and possibly revise the feature before putting it into an IS.
As such, much of the standardization work taking place concurrently with and immediately after C++14 is in the form of TS’s, the first wave of which will be published over the next year or so, and the contents of which may then go into C++17 or a subsequent IS, as schedules permit.
Therefore, at this stage, only some fairly minor features have been added directly to C++17.
The most notable among them is the ability to write a range-based for loop of the form for (elem : range)
, i.e. with the type of the element omitted altogether. As explained in detail in my Issaquah report, this is a shorthand for for (auto&& elem : range)
which is almost always what you want. The Evolution Working Group (EWG) approved this proposal in Issaquah; in Rapperswil it was also approved by the Core Working Group (CWG) and voted into C++17.
Other minor things voted into C++17 include:
static_assert(condition)
, i.e. with the message omitted. An implementation-defined message is displayed.auto var{expr};
is now valid and equivalent toT var{expr};
(whereT
is the deduced type)- A template template parameter can now be written as
template <...> typename Name
in addition totemplate <...> class Name
, to mirror the way a type template parameter can be written astypename Name
in addition toclass Name
- Trigraphs (an obscure feature that allowed certain characters, such as
#
, which are not present on some ancient keyboards, to be written as a three-character sequence, such as??=
) were removed from the language
Evolution Working Group (EWG)
As with previous meetings, I spent most of time in the Evolution Working Group, which spends its time looking at proposals for new language features that either do not fall into the scope of any Study Group, or have already been approved by a Study Group. There was certainly no lack of proposals at this meeting; to EWG’s credit, it got through all of them, at least the ones which had papers in the official pre-Rapperswil mailing.
Incoming proposals were categorized into three rough categories:
- Approved. The proposal is approved without design changes. They are sent on to CWG, which revises them at the wording level, and then puts them in front of the committee at large to be voted into whatever IS or TS they are targeting.
- Further Work. The proposal’s direction is promising, but it is either not fleshed out well enough, or there are specific concerns with one or more design points. The author is encouraged to come back with a modified proposal that is more fleshed out and/or addresses the stated concerns.
- Rejected. The proposal is unlikely to be accepted even with design changes.
Accepted proposals:
- Opening two nested namespaces with
namespace A::B {
in addition tonamespace A { namespace B {
- “Making return explicit”. This means that if a class
A
has anexplicit
constructor which takes a parameter of typeB
, then, in a function whose return type isA
, it is valid to writereturn b;
whereb
has typeB
. (Currently, one has to writenreturn A(b);
.) The idea is to avoid repetition; a very common use case isA
beingstd::unique_ptr<T>
for someT
, andB
beingT*
. This proposal was relatively controversial; it passed with a weak consensus in EWG, and was also discussed in the Library Evolution Working Group (LEWG), where there was no consensus for it. I was surprised that EWG passed this to CWG, given the state of the consensus; in fact, CWG indicated that they would like additional discussion of it in a forum that includes both EWG and LEWG members, before looking at it in CWG. - A preprocessor feature for testing for the presence of a (C++11-style) attribute:
__has_cpp_attribute(attribute_name)
- A couple that I already mentioned because they were also passed in CWG and voted into C++17 at the same meeting:
for (elem : range)
- Template parameters written as
template <...> typename Name
- Removing trigraphs (also passed in CWG and voted into C++17 at the same meeting)
Proposals for which further work is encouraged:
- A proposal to make C++ more friendly for embedded systems development by reducing the overhead of exception handling, and further expanding the expressiveness of
constexpr
. EWG encouraged the author to gather people interested in this topic and form a Study Group to explore it in more detail. - A proposal to convey information to the compiler about aliasing, via attributes. This is intended to be an improvment to C99’s
restrict
. - A way to get the compiler to, on an opt-in basis, generate equality and comparison operators for a structure/class. Everyone wanted this feature, but there were disagreements about how terse the syntax should be, whether complementary operators should be generated automatically (e.g.
!=
based on==
), how exactly the compiler should implement the operators (particularly for comparison – questions of total order vs. weaker orders came up), and howmutable
members should be handled. - A proposal for a per-platform portable C++ ABI. I will talk about this in more detail below.
- A way to force the compiler to omit padding between two structure fields
- A way to specify that a class should be converted to another type in
auto
initialization. That is, for a classC
, to specify that inauto var = c;
(withc
having typeC
), the type ofvar
should actually be some other typeD
. The motivating use here is expression templates; inMatrix X, Y; auto Z = X * Y;
we want the type ofZ
to beMatrix
even if the type ofX * Y
is some expression template type. EWG liked the motivation, but the proposal tried to modify the semantics of template parameter deduction for by-value parameters so as to remain consistent withauto
, and EWG was concerned that this was starting to encroach on too many areas of the language. The author was encouraged to come back with a more limited-scope proposal that concernedauto
initialization only. - Fixed-size template parameter packs (
typename...[K]
) , and packs where all parameters must be of the same type (T...[N]
). EWG liked the idea, but had some concerns about syntactic ambiguities. The proposal also inspired an offshoot idea of subscripting parameter packs (e.g.Pack[0]
gives you the first parameter), to avoid having to use recursion to iterate over the parameters in many cases. - Expanding parameter packs as expressions. Currently, if
T
is a parameter pack bound to parametersA
,B
, andC
, thenT...
expands toA, B, C
; this expansion is allowed in various contexts where a comma-separated list of things (types or expressions, as the parameters may be) is allowed. The proposal here is to allow things likeT +...
which would expand toA + B + C
, which would be allowed in an expression context.
Rejected proposals:
- Objects of runtime size. This would have allowed a pure library implementation of something like
std::dynarray
(and allowed users to write similar classes of their own), but it unfortunately failed to gain consensus. More about this in the Array Extensions TS section. - Additional flow control mechanisms like
break label;
,continue label;
andgoto case value;
. EWG thought these encouraged hard-to-follow control flow. - Allowing specifiers such as
virtual
,static
,override
, and some others, to apply to a group of members the way acess specifiers (private:
etc.) currently do. The basis for rejection here was that separating these specifiers from the members they apply to can make class definitions less readable. - Specializing an entity in a different namespace without closing the namespaces you are currently in. Rejected because it’s not clear what would be in scope inside the specialization (names from the entity’s namespace, the current namespace, or both).
<<<
and>>>
operators for circular bit-shifts. EWG felt these would be more appropriate as library functions.- A rather complicated proposal for annotating template parameter packs that claimed to be a generalization of the proposal for fixed-size template parameter packs. Rejected because it would have made the language much more complicated, while the benefit would mostly have been for template metaprogramming; also, several of the use cases can be satisfied with Concepts instead.
- Throwing an exception on stack exhaustion. The implementers in the room felt this was not implementable.
I should also mention the proposal for named arguments that Ehsan and I have been working on. We did not prepare this proposal in time to get it into the pre-Rapperswil mailing, and as such, EWG did not look at it in Rapperswil. However, I did have some informal discussions with people about it. The main concerns were:
- consideration for constructor calls with
{...}
syntax and, by extension, aggregate initialization - the relationship to C99 designated initializers (if we are covering aggregate initializtion, then these can be viewed as competing syntaxes)
- most significantly: parameter names becoming part of a library’s interface that library authors then have to be careful not to break
Assuming we are able to address these concerns, we will likely write an updated proposal, get it into the pre-Urbana mailing (Urbana-Champaign, Illinois is the location of the next Committee meeting in November), and present it at the Urbana meeting.
Portable C++ ABI
One of the most exciting proposals at this meeting, in my opinion, was Herb Sutter’s proposal for a per-platform portable C++ ABI.
A per-platform portable ABI means that, on a given platform (where “platform” is generally understood to a mean the combination of an operating system, processor family, and bitness), binary components can be linked together even if they were compiled with different compilers, or different versions of the same compiler, or different compiler options. The current lack of this in C++ is, I think, one of C++’s greatest weaknesses compared to other languages like C or Java.
More specifically, there are two aspects to ABI portability: language and library. On the language side, portability means that binary components can be linked together as long as, for any interface between two components (for example, for a function that one component defines and the other calls, the interface would consist of the function’s declaration, and the definitions of any types used as parameters or return type), the two components are compiled from identical standard-conforming source code for that interface. On the library side, portability additionally means that interfaces between components can make use of standard library types (this does not follow solely from the language part, because different compilers may not have identical source code for their standard library types).
It has long been established that it is out of scope for the C++ Standard to prescribe an ABI that vendors should use (among other reasons, because parts of an ABI are inherently platform-specific, and the standard cannot enumerate every platform and prescribe something for each one). Instead, Herb’s proposal is that the standard codify the notions of a platform and a platform owner (an organization/entity who controls the platform); require that platform owners document an ABI (in the case of the standard library, this means making available the source code of a standard library implementation) which is then considered the platform ABI; and require compiler and standard library vendors to support the platform ABI to be conformant on any given platform.
In order to ease transitioning from the current world where, on a given platform, the ABI can be highly dependent on the compiler, the compiler version, or even compiler options, Herb also proposes some mechanisms for delineating a portion of one’s code which should be ABI-portable, and therefore compiled using the platform ABI. These mechanisms are a new linkage (extern "abi"
) on the language side, and a new namespace (std::abi
, containing the same members as std
) on the library side. The idea is that one can restrict the use of these mechanisms to code that constitutes component interfaces, thereby achieving ABI portability without affecting other code.
This proposal was generally well-received, and certainly people agreed that a portable ABI is something C++ needs badly, but some people had concerns about the specific approach. In particular, implementers were uncomfortable with the idea of potentially having to support two different ABI’s side-by-side in the same program (the platform ABI for extern "abi"
entities, and the existing ABI for other entities), and, especially, with having two copies of every library entity (one in std
and one in std::abi
). Other concerns about std::abi
were raised as well, such as the performance penalty arising from having to convert between std
and std::abi
types in some places, and the duplication being difficult to teach. It seemed that a modified proposal that concerned the language only and dropped std::abi
would have greater consensus.
Array Extensions TS
The Array Extensions TS was initally formed at the Chicago meeting (September 2013) when the committee decided to pull out arrays of runtime bound (ARBs, the C++ version of C’s VLAs) and dynarray
, the standard library class for encapsulating them, out of C++14 and into a TS. This was done mostly because people were concerned that dynarray
required too much compiler magic to implement. People expressed a desire for a language feature that would allow them to implement a class like dynarray
themselves, without any compiler magic.
In Issaquah a couple of proposals for such a language feature were presented, but they were relatively early-stage proposals, and had various issues such as having quirky syntax and not being sufficiently general. Nonetheless there was consensus that a library component is necessary, and we’d rather not have ARBs at all than get them without a library component to wrap them into a C++ interface.
At this meeting, a relatively fully fleshed-out proposal was presented that gave programmers a fairly general/flexible way to define classes of runtime size. Unfortunately, it was considered a complex change that touches many parts of the language, and there was no consensus for going forward with it.
As a result, the Array Extensions TS is completely stalled: ARBs themselves are ready, but we don’t want them without a library wrapper, and no proposal for a library wrapper (or mechanism that would enable one to be written) has consensus. This means that the status quo of not being able to use VLAs in C++ (unless a vendor enables C-stle VLAs in C++ as an extension) will remain for now.
Library / Library Evolution Working Groups (LWG and LEWG)
Library work at this meeting included the Library Fundamentals TS (and its planned follow-up, Library Fundamentals II), the Filesystems TS and Networking TS (about which I’ll talk in the SG 3 and SG 4 sections below), and reviewing library components of other projects like the Concurrency TS.
The Library Fundamentals TS was in the wording review stage at this meeting, with no new proposals being added to it. It contains general library utilities such as optional
, any
, string_view
, and more; see my Issaquah report for a full list. The current draft of the TS can be found here. At the end of the meeting, the Committee voted to send out the TS for its first national body ballot, the PDTS (Preliminary Draft TS) ballot. This ballot concludes before the Urbana meeting in November; if the comments can be addressed during that meeting and the TS sent out for its second and final ballot, the DTS (Draft TS) ballot, it could be published in early 2015.
The Committee is also planning a follow-up to the Library Fundamentals TS, called the Library Fundamentals TS II, which will contain general utilities that did not make it into the first one. Currently, it contains one proposal, a generalized callable negator; another proposal, containing library facilities for contract programming, got rejected for several reasons, one of them being that it is expected to be obsoleted in large part by reflection. Proposals under consideration to be added include:
array_view
, including tools for working with multi-dimensional arrays- GCD and LCM functions
- non-member functions such as
size()
for querying properties of ranges make_shared
for arrays- allocator-aware regexes
ostream_joiner
, a betterostream_iterator
- uniform container erasure
- others
Study Groups
SG 1 (Concurrency)
SG 1 focuses on two areas, concurrency and parallelism, and there is one TS in the works for each.
I don’t know much about the Parallelism TS other than it’s in good shape and was sent out for its PDTS ballot at the end of the meeting, which could lead to publication in 2015.
The status of the Concurrency TS is less certain. Coming into the Rapperswil meeting, the Concurrency TS contained two things: improvements to std::future
(notably a then()
method for chaining a second operation to it), and executors and schedulers, with resumable functions being slated for addition.
However, the pre-Rapperswil mailing contained several papers arguing against the existing designs for executors and resumable functions, and proposing alternative designs instead. These papers led to executors and schedulers being removed from the Concurrency TS, and resumable functions not being added, until people come to a consensus regarding the alternative designs. I’m not sure whether publication of the Concurrency TS (which now contains only the std::future
improvements) will proceed, leaving executors and resumable functions for a follow-up TS, or be stalled until consensus on the latter topics is reached.
For resumable functions, I was in the room during the technical discussion, and found it quite interesting. The alternative proposal is a coroutines library based on Boost.Coroutine. The two proposals differ both in syntax (new keywords async
and await
vs. the magic being hidden entirely behind a library interface), and implementation technique for storing the local variables of a resumable function (heap-allocated “activation frames” vs. side stacks). The feedback from SG 1 was to disentangle these two aspects, possibly yielding a proposal where either syntax could be matched with either implementation technique.
There are also other concurrency-related proposals before SG 1, such as ostream buffers, latches and barries, shared_mutex
, atomic operations on non-atomic data, and a synchronized wrapper. I assume these will go into either the current Concurrency TS, or a follow-up TS, depending on how they progress through the committee.
SG 2 (Modules)
Modules is, in my opinion, one of the most sorely needed features in C++. They have the potential of decreasing compe times by an order of magnitude or more, thus bringing compile-time performance more in line with more modern languages, and of solving the combinatorial explosion problem, caused by macros, that hampers the development of powerful tooling such as automated refactoring.
The standardization of modules has been a slow process for two reasons. First, it’s an objectively difficult problem to solve. Second, the solution shares some of the implementation difficulties of the export
keyword, a poorly thought-out feature in C++98 that sought to allow separate compilation of templates; export
was only ever implemented by one compiler (EDG), and the implementation process revealed flaws that led not only to other compilers not even bothering to implement it, but also to the feature being removed from the language in C++11. This bad experience with export
led people to be uncertain about whether modules are even implementable. As a result, while some papers have been written proposing designs for modules (notably, one by Daveed Vandevoorde a couple of years back, and one by Gabriel Dos Reis very recently), what everyone has really been holding their breaths for was an implementation (of any variation/design), to see that one was possible.
Google and others have been working on such an implementation in Clang, and I was very excited to hear Chandler Carruth (head of Google’s team working on Clang) report that they have now completed it! As this work was completely very recently prior to the meeting, they did not get a chance to write a paper to present at this meeting, but Chandler said one will be forthcoming for the next meeting.
EWG held a session on Modules, where Gaby presented his paper, and the Clang folks discussed their implementation. There were definitely some differences between the two. Gaby’s proposal came across as more idealistic, “this is what a module system should look like if you’re writing new code from scratch with modules”. Clang’s implementation is more practical, “this is how we can start using modules right away in existing codebases”. For example, in Gaby’s proposal, a macro defined in a module is not visible to an importing module; in Clang’s implementation, it is, reflecting the reality that today’s codebases still use macros heavily. As another example, in Gaby’s proposal, a module writer must say which declarations in the module file are visible to importing modules by surrounding them in an export
block (export
here just being a keyword, not to be confused with the failed language feature I talked about above); in Clang’s implementation, a header file can be used as a module without any changes, using an external “module map” file to tell the compiler it is a module.
Another interesting design question that came up was whether private members of a class exported from a module are “visible” to an importing module (in the sense that importing modules need to be recompiled if such a private member is added or modified); in Clang’s implementation, this is the case, but there would certainly be value in avoiding this (among other things, it would obsolete the laborious “Pimpl” design pattern).
The takeaway was that, while everyone wants this feature, and everyone is excited about there finally being an implementation, several design points still need to be decided. EWG deemed that it was too early to take any polls on this topic, but instead encouraged the two parties (the Clang folks, and Gaby, who works for Microsoft and hinted at a possible Microsoft implementation effort as well) to collaborate on future work. Specifically, EWG encourages that the following papers be written for Urbana: one about what is common to the various proposals, and one or more about the remaining deep technical issues. I eagerly await such future work and papers.
SG 3 (Filesystems)
At this meeting, the Library Working Group finished addressing the ballot comments for the Filesystem TS’s PDTS ballot, and sent out the TS for the final “DTS” ballot. If this ballot is successful, the Filesystems TS will be published by the end of 2014.
Beman (the SG 3 chair) stated that SG 3 will entertain new filesystem-related proposals that build upon the Filesystems TS, targetting a follow-up Filesystems TS II. To my knowledge no such proposals have been submitted so far.
SG 4 (Networking)
SG 4 had been working on standardizing basic building blocks related to networking, such as IP addresses and URIs. However, these efforts are stalled.
As a result, the LEWG decided at this meeting to take it upon itself to advance networking-related proposals, and they set their sights on something much more ambitious than IP addresses and URIs: a full-blown sockets library, based on Boost.ASIO. The plan is basically to pick up Chris Kohlhoff’s (the author of ASIO) 2007 paper proposing ASIO for standardization, incorporating changes to update the library for C++11, as well as C++14 (forthcoming). This idea received very widespread support in LEWG; the group decided to give people another meeting to digest the new direction, and then propose adopting these papers as the working paper for the Networking TS in Urbana.
This change in pace and direction might seem radical, but it’s in line with the committee’s philosophy for moving more rapidly with TS’s. Adopting the ASIO spec as the initial Networking TS working paper does not mean that the committee agrees with every design decision in ASIO; on the contrary, people are likely to propose numerous changes to it before it gets standardized. However, having a working paper will give people something to propose changes against, and thus facilitate progress.
SG 5 (Transactional Memory)
The Transactional Memory TS is progressing well through the committee. CWG began reviewing its wording at this meeting, and referred one design issue to EWG. (The issue concerned functions that were declared to be neither transaction-safe nor transaction-unsafe, and defined out of line (so the compiler cannot compute the transaction safety from the definition). The state of the proposal coming into the discussion was that for such functions, the compiler must assume that they can be either transaction-safe or transaction-unsafe; this resulted in the compiler sometimes needing to generate two versions of some functions, with the linker stripping out the unused version if you’re lucky. EWG preferred avoiding this, and instead assuming that such functions are transaction-unsafe.) CWG will continue reviewing the wording in Urbana, and hopefully sendout the TS for its PDTS ballot then.
SG 6 (Numerics)
Did not meet in Rapperswil, but plans to meet in Urbana.
SG 7 (Reflection)
SG 7 met for an evening session and looked at three papers:
- The latest version of the source code information capture proposal, which aims to replace the
__LINE__
,__FILE__
, and__FUNCTION__
macros with a first-class language feature. There was a lot of enthusiasm for this idea in Issaquah, and now that it’s been written up as a paper, SG 7 is moving on it quickly, deciding to send it right on to LEWG with only minor changes. The publication vehicle – with possible choices being Library Fundamentals TS II, a hypothetical Reflection TS, or C++17 – will be decided by LEWG. - The type member property queries proposal by Andrew Tomazos. This is an evolution of an earlier proposal which concerned enumerations only, and which was favourably reviewed in Issaquah; the updated proposal extends the approach taken for enumerations, to all types. The result is already a quite featureful compile-time introspection facility, on top of which facilities such as serialization can be built. It does have one significant limitation: it relies on forming pointers to members, and thus cannot be used to introspect members to which pointers cannot be formed – namely, references and bitfields. The author acknowledged this, and pointed out that supporting such members with the current approach would require language changes. SG 7 did not deem this a deal-breaker problem, possibly out of optimism that such language changes would be forthcoming if this facility created a demand for them. Overall, the general direction of the proposal had basically unanimous support, and the author was encouraged to come back with a revised proposal that splits out the included compile-time string facility (used to represent names of members for introspection) into a separate, non-reflection-specific proposal, possibly targeted at Library Fundamentals II. The question of extending this facility to introspect things other than types (notably, namespaces, although there was some opposition to being able to introspect namespaces) also came up; the consensus here was that such extensions can be proposed separately when desired.
- A more comprehensive static reflection proposal was looked at very, very briefly (the author was not present to speak about it in detail). This was a higher-level and more featureful proposal than Tomazos’ one; the prevailing opinion was that it is best to standardize something lower-level like Tomazos’ proposal first, and then consider standardizing higher-level libraries that build on it if appropriate.
SG 8 (Concepts)
The Concepts TS (formerly called “Concepts Lite”, but then people thought “Lite” was too informal to be in the title of a published standard) is still in the CWG review stage. Even though CWG looked at it in Issaquah, and the author and project editor, Andrew Sutton, revised the draft TS significantly for Rapperswil, the feature touches many areas of the language, and as such more review of the wording was required; in fact, CWG spent almost three full days looking at it this time.
The purpose of a CWG review of a new language feature is twofold: first, to make sure the feature meshes well with all areas of the language, including interactions that the author and EWG may have glossed over; and second, to make sure that the wording reflects the author’s intention accurately. In fulfilling the first objective, CWG often ends up making minor changes to a feature, while staying away from making fundamental changes to the design (sometimes, recommendations for more significant changes do come up during a CWG review – these are run by EWG before being acted on).
In the case of the Concepts TS, CWG made numerous minor changes over the course of the review. It was initially hoped that there would be time to revise the wording to reflect these changes, and put the reivsed wording out for a PDTS ballot by the end of the meeting, but the changes were too numerous to make this feasible. Therefore, the PDTS ballot proposal was postponed until Urbana, and Andrew has until then to implement the wording changes.
SG 9 (Ranges)
SG 9 did not meet in Rapperswil, but does plan to meet in Urbana, and I anticipate some exciting developments in Urbana.
First, I learned that Eric Niebler, who in Issaquah talked about an idea for a Ranges proposal that I thought was very exciting (I describe it in my Issaquah report), plans to write up his idea as a proposal and present it in Urbana.
Second, one of the attendees at Rapperswil, Fabio Fracassi, told me that he is also working on a (different) Ranges proposal that he plans to present in Urbana as well. I’m not familiar with his proposal, but I look forward to it. Competition is always healthy when it comes up early-stage standards proposal / choosing an approach to solving a problem.
SG 10 (Feature Test)
I didn’t follow the work of SG 10 very closely. I assume that, in addition to the __has_cpp_attribute()
preprocessor feature that I mentioned above in the EWG section, they are kept busy by the flow of new features being added into working papers, for each of which they have to decide whether the feature deserves a feature-test macro, and if so standardize a name for one.
Clark (the SG 10 chair) did mention that the existence of TS’s complicates matters for SG 10, but I suppose that’s a small price to pay for the benefits of TS’s.
SG 12 (Undefined Behaviour)
Did not meet in Rapperswil, but plans to meet in Urbana.
SG 13 (Human Interaction, formerly “Graphics”)
SG 13 met for a quarter-day session, during which Herb presented an updated version of the proposal for a cairo-based 2D drawing API. A few interesting points came up in the discussion:
- The interface being standardized is a C++ wrapper interface around cairo that was generated using a set of mechanical transformation rules applied to cairo’s interface. The transformation rules are not being standardized, only their result (so the standard interface can potentially diverge from cairo in the future, though presumably this wouldn’t be done without a very good reason).
- I noted that Mozilla is moving away from cairo, in part due to inefficiencies caused by cairo being a stateful API (as explained here). It was pointed out that this inefficiency is an issue of implementation (due to cairo using a stateless layer internally), not one of interface. This is a good point, although I’m not sure how much it matters in practice, as standard library vendors are much more likely to ship cairo’s implementation than write their own. (Jonathan Wakely said so about libstdc++, but I think it’s very likely the case for other vendors as well.)
- Regarding the tradeoff between a nice interface and high performance, Herb said the goal was to provide a nice interface while providing as good of a performance as we can get, without necesarily squeezing every last ounce of performance.
- The library has the necessary extension points in place to allow for uses such as hooking into drawing onto a drawing surface of an existing library, such as a Qt canvas (with the cooperation of the existing library, cairo, and the platform, of course).
The proposal is moving forward: the authors are encouraged to come back with wording.
TS Content Guidelines
One mildly controversial issue that came to a vote in the plenary meeting at the end of the week, is the treatment of modifications/extensions to standard library types in a Technical Specification. One group held that the simplest thing to do for users is to have the TS specify modifications to the types in std::
themselves. Another group was of the view that, in order to make life easier for a third-party library vendor to implement a TS, as well as to ensure that it remains practical for a subsequent IS to break the TS if it needs to, the types that are modified should be cloned into an std::experimental::
namespace, and the modifications applied there. This second view prevailed.
Next Meeting
The next Committee meeting (“Urbana”) will be at the University of Illinois at Urbana-Champaign, the week of November 3rd.
Conclusion
The highlights of the meeting for me, personally, were:
- The relevation that clang has completed their modules implementation, that they will be pushing it for C++17, and that they are fairly confident that they will be able to get it in. The adoption of a proper modules system has the potential to revolutionize compilation speeds and the tooling landscape – revolutions that C++ needs badly.
- Herb’s proposal for a portable C++ ABI. It is very encouraging to see the committee, which has long held this issue to be out of its scope, looking at a concrete proposal for solving a problem which, in my opinion, plays a significant role in hampering the use of C++ interfaces in libraries.
- LEWG looking at bringing the entire Boost.ASIO proposal into the Networking TS. This dramatically brings forward the expected timeframe of having a standard sockets library, compared to the previous approach of standardizing first URIs and IP addresses, and then who knows what before finally getting to sockets.
I eagerly await further developments on these fronts and others, and continue to be very excited about the progress of C++ standardization.
Hello Botond,
I just noticed your trip report. With all do respect, there was no rejection of annotated template parameter packs from the EWG. Also, the sponsored fixed size parameter packs did not address or spawn the index based access. For the sake of completion, you may read my reply to you at the std-proposals mailing list in the atpp thread at https://groups.google.com/a/isocpp.org/d/msg/std-proposals/qIs0Ws7WdwA/XmvzaRl_IYsJ for the sake of respecting the paper trail on these things.
My rationale for placing the annotated template parameter packs proposal into the “Rejected” category was that it was in this category in the slide deck used in EWG’s report during the plenary meeting on Saturday. I edited the post to mention that there were no polls taken about the proposal.
Regarding indexed access to parameter packs, my recollection is that this idea came up after looking at the T…[N] syntax of the fixed-size parameter pack proposal. I could be misremembering.
Awesome write up. Thanks.
I can’t help but think that merging so much functionality into the core of C++ (e.g. the Filesystem TS) is a bad idea and limits choice. On the other hand, sometimes it’s nice if there is something standard to code to in many environments.
OTOH, I much prefer using an (almost) std C++ facility to do something as basic as checking if a file exists instead of having to write yet another wrapping around ‘stat’… It’s not that it’s hard, it’s just annoying to have to keep on writing the same kind of stuff in many different environments…
One of the committee’s main motivations in standardizing libraries such as Filesystems is that some languages that compete with C++ in some domains – such as C# or Java – have such functionality in their standard libraries, and for C++ to remain competitive with them in these areas, it should too.
I’m not sure how standardizing such things limits choice – people will be continue to be able to use any third-party libraries the way they are today.
I’m very, very happy to read that both work is being continued on Herb’s platform portability proposal as well as that the Google people have succeeded with a module proposal… These are about the worst pain-points C++ still has (though I suppose not having a std socket lib is bad as well, but with the ASIO lib being picked up, that’s going to be worked on as well!) Cool! Thanks for the good news!
I’m super stoked that solid progress is happening in Human Interaction (ala ‘Graphics’). While other undoubtably more important issues in the Committee’s and of professional developers have occupied their attentions for years–and rightfully so–the basic fact that I couldn’t even create a window, much less cool graphics for muh_gaems is what kept me from even considering C++ as a beginner to moderate developer. For the teens and twenty-somethings the idea of creating our own games is the #1 draw for learning to program. Herb and the others who had the balls to push this in the Committee deserve huge props.
IMO this single advance will do more to bring modern C++ into the minds of the mainstream than any other single feature introduced.
Great writeup BTW!
Thanks!
What’s interesting is that some others I’ve talked to expressed opposition to the idea of standardizing a graphics library on the basis that using third-party libraries is good enough for this purpose.
Perhaps a parallel front on which the committee could improve C++ is by making it easier to use third-party libraries. I’m curious: what were some of the challenges that prevented you from using C++, with third-party libraries, to create windows and draw graphics? I ask because such information may inform the committee’s direction on that front.
You’re welcome. I first got intersted in C++ when I found out that it was used to create some of my favorite video games. I figured if that was what they were created with, then that was the programming language I wanted to learn!
Q: “what were some of the challenges that prevented you from using C++, with third-party libraries, to create windows and draw graphics?”
A: Primarily the ‘third-party libraries’ part, though there were other struggles as well.
As a beginner, I (naively) just wanted to start writing programs and have cool windows pop up that did neat things that I could dream up for them to do. However, I quickly found out that I was struggling, and was intimidated enough just trying to properly learn the basics of the language and syntax itself and logic and understanding simple algorithms design. Then I found out you had to use text-only and was super disappointed. Being also then forced to master how to properly set up projects and configure them just so seemed exceedingly hard to grasp for me. I never could get it all working right, and after a few weeks of struggle I gave up on any hope of learning the language as being just too difficult for me to get it right. My dreams of creating games faded soon thereafter.
A while later, I got a job at a radio station where eventually I wound up needing to create a database system. They got me a copy of Visual Studio and Office. In less than an hour playing around with the VS IDE, I had my very first “Hello World!” window working! I was suprised that it actually worked. Within a few days, I could properly hook up button events to underlying Visual Basic code and make my program window (in my mind then, the window WAS the program) do things. I felt like a real programmer! The database project was a success, and I became known as ‘the computer guy’.
Eventually I got the bug for computer animation, left my job and went to school to learn how to do it. I learned the animation package Maya pretty thoroughly and got a job in Southern California right out of school at a small studio doing contract work supplying content for AAA games. They needed me to write plugins for Maya in C++. I had inadvertantly found myself back in the world of this language. I diligently applied myself and over about a year or so of professional work, I finally began to grasp the ideas of how to wield a toolchain and 3rd party libraries reasonably well, and to create powerful algorithms in C++ that we could use to drive animations in Maya. Eventually I came to love the language for it’s power and sophistication.
Teaching others (espcially beginners) about it’s virtues has now become one of my primary interests in the language. But it can still be a challenge for them once they decide to create graphical applications, which often happens pretty quickly–if not immediately.
///
So, If my story is instructive in any way, then I’d like to make two observations on how the language should be tailored to help novices:
1. It needs to be easy for the novice to quickly get up and running with it building windowed apps (IE, “In the box” with no additional setup.)
2. It needs to be simple for the novice to use effectively (IE, don’t force them to understand lots of things up front–like toolchains & libraries.)
///
If you really want to get a flavor of how awesome it is for young people to be able to quickly and easily create graphical applications using sound and animations as a way of learning programming, just check out Scratch [ http://scratch.mit.edu/ ]. Of the over 6 million projects created and shared on the main site by these avid kids, you’d be very hard-pressed to find one that didn’t use these techniques. Of course it’s designed that way (very wisely, IMO) to welcome new users and to allow expressing themselves easily like that. I believe it’s a great example of a nice crossroads between art and technology–exactly what youth (and many others like me) want. I just wish I’d had that when I was a kid!
Just as a personal aside, after reading your post yesterday, then carefully reading the revision 1 document for SG 13 [ N4021 ], I’ve become excited again about the language and it’s new potential for creating compelling graphical applications in the hands of relative novices. After listening to Andrew Bell’s and Herb Sutter’s talks I’m currently in the process of pouring over Cinder to learn it’s API, and I’ll probably also look into openFrameworks as well. My motivation is primarily to get my head back into the game, and rekindle my own passion for art and technology. I hope to build my own studio some day, and I also hope the results of SG 13’s efforts will enable many beginners to also fall in love with this great language.
Pleae give my kind regards to the Committee. I appreciate you all, and all your hard work. Thank you!
The introduction of modules doesn’t affect pimpl the way you say it does. Removing a private member affects the size of the class, which breaks binary compatibility. https://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++