The Bristol Papers & the state of C++
published at 18.04.2013 11:31 by Jens Weller
A follow up on the series about the papers for the Bristol Meeting. I'll try to give a little look at C++14, it is slowly taking shape. But as the Meeting is still going on, there are a lot of pending details missing to put up the facts for C++14. Maybe we have to wait till Chicago for C++14 clearly taking shape. Also I want to cover some of the feedback, and write a little bit about my own view on C++, now after reading all the papers.
C++14 has been always communicated as a minor standard, not all people seem to understand this. There is some disappointment, that features like Modules or Concepts aren't part of the next standard. Nobody can yet say what we will see in C++17, the next major standard. Concepts probably, Modules maybe. Some years to go still. So C++14 will include mostly smaller changes as it looks. Also important, is to understand the process of standardisation, that a lot of parties are involved, and that things take a long time span to get through. There is a good overview about C++ Standardization at isocpp.org. I hoped to get some more insight into this with yesterdays video call with Michael Wong, Peter Gottschling and Frank Birbacher, but the connection was really bad, so that only a few facts are clear.
Also regarding the C++ Committee, its important to understand, that this is actually a huge group accompanied by national standardization bodies. Its not like a few people drinking coffee and talking about what to do to C++ next. In Bristol there are 100 Attendees for the meeting, working in several working groups in parallel. And not everybody could come to Bristol, there is a lot of people missing.
A short paragraph about stuff you can expect from C++14. Positive things first :) You'll get polymorphic lambdas. Then, constexpr will be relaxed, or improved you could say. That's what you can say about constexpr, I have no details here, what exactly the results for constexpr will be like. Also its likely that binary literals and runtime sized arrays will be part of C++14. In general, it looks like that the focus is really on getting C++14 ready to ship, not in getting more features in. So, C++14 will, as planned, improve C++11, evolve C++ in a few minor cases and bring a few new things. So, the current development is, that a lot of stuff is not going into C++14, but will be released as a Technical Specification. For example there will be a TS for filesystem (yes, looks like filesystem is not part of C++14), a TS for concepts lite, and probably a lot of other TS for other proposals. At least this is my impression of the current trend in C++ standardization. But full impact of this will be able to be seen by next week, when the results of Bristol take fully shape.
Feedback & Statistics
There is a lot of interest in C++ Standardization, my website has had alone in April over 25k hits. Feedback from reddit, web forums and social web is very positive. As I wrote there is a lot of interest in big new language features such as Concepts or Modules, and some disappointment that its not yet coming to C++. For concepts it seems to be now clear, that there will be a TS for concepts lite, and maybe even terse templates, C++17 might contain a first version of concepts, still the goal is, to get the full features of concepts to C++.
And modules, some feature that a lot of people would like to come to C++. Problem is in my view, that neither C nor C++ were planned with the mindset of modules in mind, also the C++ standard does not describe a general ABI Interface, so that a module might only work with its toolset/compiler, which it is build with. So, getting a solution for Modules is in my view not very easy. There is for sure work being done in that area, last years keynote at C++Now about Modules probably is still one of the best sources to get an overview over this topic.
One of the interesting things I could see through writing this series is, which papers actually were clicked by people. So, lets have a look, at which are the popular papers. As the series was split in 4 parts, it only makes sense to seperate those, in a total top10 the papers of the first part would be much higher weighted then the papers of the last part. The top 3 for every part:
- n3534 - C++ Pipelines (104 views)
- n3548 - Conditionally supported Math functions (98 views)
- n3525 - Polymorphic Allocators (97 views)
- n3572 - Unicode Support in the standard library (85 views)
- n3552 - Introducing Object Aliases (80 views)
- n3551 - C++ Random Number generation (55 views)
- n3553 - Proposing a C++1y swap operator (55 views)
- n3574 - Binding stateful functions as function pointers (69 views)
- n3588 - make_unique (43 views)
- n3597 - Relaxing constraints on constexpr functions (40 views)
- n3613 - static_if considered (62 views)
- n3601 - implicit template parameter (60 views)
- n3600 - C++ Latches & Barriers (44 views)
This statistic has some surprises, some papers might also have a better position with being at the end or beginning (n3548 for example). One of the open questions remaining is for me, how all this feedback and knowledge about C++ out there could be channeled back to the Committee. The idea of n3548 to put conditionally supported functions into the standard, could open ways to improve the standard in a optional way. Counter argument to this is, who would make use of such functions, if there is also a non-standard solution working also on platform not supporting the condition.
The State of C++
Actually I should put this into another blog post, but I probably don't have the time to dig to deep into this and put it into a blog post, so I'll add it here. Its one of my concerns I currently have with C++11 and further C++ Standards. Where are we currently with C++11, implementation wise? The standard is nice, but C++ has no Standard Implementation, no central language toolset, it lives from the diversity of its compilers, vendors and tools. Right now only a subset of C++11 is usable on multiple platforms, for me the main platforms of C++ are GCC/MinGw, Visual C++ and clang. Clang because it offers such a strong toolset and actually all important C++11 features. Still in production code, clang still has its time to come, but you can see the first toolsets based on clang from the industry now appearing. C++03 only had one feature, which never got implemented on a wide basis: export. How many features of C++11 or C++14 might not be implemented by the most vendors? For example C++11 brings <regex>, but GCC in 4.8 still is not supporting it fully. Every library feature added to future standards will only succeed if they are also made available through the vendors. With C++11 language features we saw that Visual C++ was lacking some of its crucial elements like variadic templates, still Visual C++ is behind GCC and clang in C++11 support.
Looking ahead, I have no doubt that C++ has a bright future, C++11 is the most important addition to the language for a long time. C++14 seems to improve C++11, and most likely be more lightweight, so that hopefully it will be adopted faster. Still, things are changing in C++ land, we had an era of almost 10 years with out big changes to the standard, now it seems that a phase of advancing C++ and its Standard Library has begun. In my view, it will be important to see, where this leads. Will the increased competition in implementing these features lead to less vendors and less compilers supporting the new C++ features? How will the C++ Community adopt to the new features, which will find its wide spread usage, and which not?