31

Does the C++ committee test their new design specifications with some sort of prototype compiler before releasing a new standard? Or do they release a standard which is, in effect, only theoretical until the big compilers implement it?

4
  • 7
  • 4
    Boost acts as the prototype for a large number of library improvements. E.g. boost::shared_ptr => std::shared_ptr.
    – MSalters
    Mar 20, 2016 at 23:24
  • 6
    I kinda expected a simple "they don't".
    – Sebb
    Mar 20, 2016 at 23:43
  • @MSalters: Boost has also acted as a prototype for a fair number of core language improvements (e.g., boost.lambda => C++11 lambda expressions). Mar 22, 2016 at 5:58

1 Answer 1

27

The C++ Standard Committee has bylaws and rules, but most of these are centered around the structure of the organization, how to submit proposals, voting, publishing the standard, etc. and not so much on the technical details of the standard itself or how it may be tested.

There is no formal requirement for "testing" a feature or its design as far as I know. C++ is also somewhat unique in that there is no reference or "primary" implementation (e.g. Microsoft CLR, Oracle JDK, Zend PHP). However, the committee members consist of many organizations with deep knowledge of the language and compiler implementation. For example, if you follow that previous link, you will see representatives from Microsoft and Intel who both have well-respected C++ compilers. Red Hat and a few other companies who contribute to GCC are also involved.

When proposing a new feature, committee members already have a pretty good idea as to whether it is feasible, if it may conflict with other features, or cause the grammar to be ambiguous in a way that complicates parsing unnecessarily. (here is a good question about C++'s grammar)

The short answer is "no, the committee does not require testing their designs using prototyping." However, there is not much need because the committee members are experts in C++ who understand all the fine details at a level that the vast majority of programmers do not. Remember, these people are language architects who are experts on language theory and compiler design.

Given the involvement of compiler vendors in the process, it is feasible that one or more of them may prototype a new feature, but again, there is no formal requirement for this nor is it something I have read about in publicly-available documents from the C++ Committee.

They also tend to be very conservative, incrementally adding new features that have a demand in the real world without specifying large amounts of new features that may prove to be risky. In fact in recent years they have added new features that existed as proprietary extensions or open-source libraries that already work in the real world. For example, C++11 and C++14 incorporate parts of Boost, which has already been tested in the real world in multiple compilers and execution environments. There is no need to test something that is already tested.

11
  • 5
    ConceptGCC and ConceptClang are two examples of compilers (or rather forks of compilers) that were explicitly created to prototype and gain real experience with a complex language feature. Concepts are also an example of how thorough language features are designed in C++: Concepts have been around since 1998, first as an informal idea to talk about C++ Templates, then in 2006 as a proposed language feature by Bjarne himself, and also implemented in ConceptGCC since then. They may Mar 20, 2016 at 23:47
  • 3
    … end up in C++17, which means that they will have matured for about 10 years as an implementation and 20 years as an idea. Mar 20, 2016 at 23:47
  • 2
    This is mostly false, I think. New features usually require an implementation first. The one time this didn't happen, we got export.
    – isanae
    Mar 21, 2016 at 0:25
  • 5
    The last paragraph is (to put it lightly) nonsense. The C committee is very conservative, but C++ adds all sorts of new stuff all the time with little consideration for what a mess it makes the language or whether it actually solves the problems people want to solve. Mar 21, 2016 at 1:05
  • 1
    @R.. I disagree. C++11 was an anomaly, but it included a lot of stuff that already existed (see my Boost comment, for example). For much of C++'s life it has evolved very slowly, which is one major complaint that many developers have about the language.
    – user22815
    Mar 21, 2016 at 4:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.