Browse in : |
All
> Topics
> Design
All > Journals > CVu > 321 Any of these categories - All of these categories |
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles . The templates will get the extension .xt there.
Title: The Standard Report
Author: Bob Schmidt
Date: 02 March 2020 22:49:22 +00:00 or Mon, 02 March 2020 22:49:22 +00:00
Summary: Guy Davidson reports from the C++ Standards Committee.
Body:
In this report, I’m going to cover the final meeting of this release cycle. In Prague, on February 15th, the committee voted to send the final draft for National Body ballot and then publication, and C++20 was completed.
This is a huge release, the biggest since 2011, with new features such as ranges, modules, coroutines and concepts. The meeting itself was deeply uncontroversial: there is no appetite for putting any spanners in the works, and all the controversy was resolved at Cologne, with the purpose of not having any nasty surprises at this stage.
I’m not going to iterate through the resolved comments, but I will discuss some aspects of the meeting that have long term ramifications.
The first of these is Application Binary Interface (ABI) continuity and compatibility, and how we want to deal with it. You can get a good overview of ABI from the gcc documentation site [1] but in a nutshell, the ABI describes the implementation of the language and library. If this remains stable from version to version then new code can safely interoperate with old code. On the other hand, if an ABI break is introduced then you may need to rebuild everything from scratch if you want to add new code built with a newer toolchain.
The ABI has been stable for GCC since C++11, and for MSVC since C++14. MSVC used to break the ABI with every release, but with the introduction of near-monthly updates it is much harder for them to schedule ABI breaks in the same way.
The idea of introducing an ABI break terrifies some, but the idea of staying stable horrifies others. The cost of an ABI break can be estimated in engineer-millenia worldwide. However, being unable to make changes to things like hashing impacts catastrophically on security, among other things.
Evolution and Library Evolution held a joint meeting on Monday to discuss this problem and sadly seemed to this author to make no real progress, although there was some consensus to make incremental ABI changes with each release of the standard. There is yet more discussion to be had and P2028 [2] outlines all the problems. This is a Gordian knot, with no apparent solution that will not demand enormous effort. Please consider the problem and raise potential solutions on the mailing lists.
The prior chair of Evolution offered a paper [3] which offers a plan for C++23. There seems to be a feeling among the committee that we have delivered a lot of language functionality recently, and the library is starting to look rather threadbare. Looking at languages like Python, there is certainly more that we should be supporting.
The most obvious candidate is completing the long running Networking effort and adding it to the standard. This will also require the completion of work on Executors. An executor is a policy declaration about how to run a function, function object or lambda function (callables). The policy decisions include issues of heterogeneity, i.e. running on an internal or external processor, scheduling, and CPU/GPU/SIMD considerations. These have been developed for some years now, and there was considerable hope that they would land in C++20, along with networking, but it was not to be. These features should, in the author’s opinion, take priority for C++23.
Additionally, now that we have modules, we should start work on ‘modularising’ the standard library; similarly, now that we have coroutines, we should start work on introducing library support for coroutines.
Finally, we should continue working towards reflection, contracts and pattern-matching. In the absence of a counter-proposal, this remains the only plan we have for C++23.
The hosts in Prague, Avast, organised a C++ meetup for Tuesday evening, which was attended by about 300 people and included talks from Bjarne Stroustrup, Tony van Eerd and Herb Sutter. They are all available on YouTube: search for Avast C++ Meetup. Bjarne spoke about the state of generic programming in C++20 which revolves around concepts, Tony delivered his Postmodern C++ talk and Herb spoke about parameter passing and how to fix it, suggesting five new potential keywords to decorate function parameters with. It was the first time he spoke publicly about this and by my estimation it should make the teaching of C++ a little easier and the practice less error-prone.
Avast also organised a social event on Wednesday to celebrate the completion of C++20. It took place in an old church, and the organiser, Hana Dusikova, had asked everyone to wear something nice, something sparkly. The committee did not disappoint. This author took a dinner suit and a top hat. It was not the only top hat present. There were sparkly dresses, hats, and shirts: we seem to scrub up well. The food was excellent, being a menu of local cuisine.
There was a piano present on the stage which attracted some excellent displays of skill from those attending. The convenor, Herb Sutter, is known for entertaining the throng with 80s pop classics wherever he goes. He did not disappoint on this occasion, with a splendid rendition of Don’t Stop Believin’.
It is the habit of the committee to take a photograph when each standard ships, but in a break with tradition and potentially making ourselves hostages of fortune, we took the photo here, three full days ahead of delivery, in the expectation that we would ship on Saturday. The committee has never looked so good, nor so diverse.
It wasn’t all National Body comments of course: there was still business to be done looking forward to landing new features post-C++20. The study groups are thriving, and features like linear algebra are hotly anticipated. If you want to attend a meeting of the C++ committee, the next meeting is in Varna, Bulgaria, at the beginning of June. You can find details online [4]. Meanwhile, in the next two reports, I will cover some of the upcoming language and library features that are hoping to land in C++23.
References
[1] gcc documentation site: https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
[2] P2028 ‘What is ABI, and What Should WG21 Do About It?’ (2020): https://wg21.link/P2028
[3] P0592 ‘To boldly suggest an overall plan for C++23’ (2019): https://wg21.link/P0592
[4] 2020 Varna Meeting Information: https://wg21.link/N4837
Guy Davidson is the Principal Coding Manager at Creative Assembly. He has been writing games for about 75% of his life now. He is climbing through his piano grades and teaching Tai Chi while parenting in Hove and engaging in local political activism.
Notes:
More fields may be available via dynamicdata ..