Biz & IT —

C99 acknowledged at last as Microsoft lays out its path to C++14

Full conformance with C++ standards, and maybe an end to Visual Studio versions.

At its BUILD developer conference in San Francisco, Microsoft developer and C++ Committee chair Herb Sutter talked about what Visual Studio users can look forward to over the coming years.

Microsoft is transitioning to a new policy of rapid releases. The plans aren't as aggressive as the rapid releases of Firefox and Chrome, which see new versions released every six weeks or so, but a set of roughly annual releases is still a major change from Redmond's historic practice of making major releases every three years.

These rapid releases will allow the company's C++ team to deliver substantial functional updates to their compiler and libraries. In the past, there have been minor updates to these tools (shipping in service packs or feature updates), but these have been conservative to ensure that there are no breaking changes. Microsoft doesn't want a program that compiles and works correctly in, say, Visual Studio 2012 to stop working in Visual Studio 2012 Update 1.

Combined with the three-year span between major updates, Microsoft's schedule has caused Visual Studio to be slow in catching up with new versions of the C++ standard.

Now, Microsoft will ship a new version of the tools every year or so. This will mean that, at least on an annual basis, the company can ship breaking changes if that's necessary to ensure greater standard compliance.

In between these annual releases, there will be conservative updates that will fix bugs and add minor, non-breaking functional changes as well as Community Technology Preview (CTP) releases. These CTPs will give a taste of what's to come in the next annual release. They may include breaking changes, and they won't generally include full IDE support (for example, IntelliSense may not handle new features that the compiler understands).

Sutter also outlined Microsoft's ambition to comply with both the existing and still current C++11 standard, and the forthcoming update to that spec that should be completed in 2014.

C++14 is designed to "complete" C++11. It rounds out the specification, filling gaps and omissions, and adds extra features based on user experience with C++11. As a result of this, Sutter said that Microsoft would end up implementing and shipping some C++14 features (those that are particularly important to making the most of C++11) before all of C++11 is implemented.

The first of these annual updates will be Visual Studio 2013, which will ship later this year. This release will include some features that are currently available as a CTP for Visual Studio 2012 and also available in the preview of version 2013 that was released on Wednesday, including variadic templates, initializer lists, and raw string literals. The final release will add additional C++11 features, such as non-static initializers and defaulting and deleting of implicit member functions.

Both the current preview and the RTM will also include a few C++14 library features; the preview throws in a handful of utility functions for instantiating objects and creating iterators, and the RTM version will add type aliases using C++11's alias syntax.

The final version of 2013 will also include a few C99 features. Microsoft has long avoided supporting C99, the major update to C++'s predecessor that was standardized last millennium, claiming that there was little demand for it among Visual Studio users. This was true, but only to a point; it's true that many Windows developers weren't especially interested in C99 because they had no good tooling to support it. Open source developers, however, embraced the update, as it makes C a lot less awkward to work with.

While full C99 support is still not in the cards, Sutter said that certain specific features were going to be added, including C99's compound literals and direct initializers. These additions will mean that many open source projects will become buildable in Visual Studio without demanding significant code changes. Sutter mentioned widely used video codec library ffmpeg as a specific example of a project that would work given these compiler improvements.

After 2013 is released, a CTP will deliver a bunch more C++11 features, with C++14's generic lambdas and return type deduction likely to be included, along with a selection of C++11 features. The remaining C++11 and C++14 features will be implemented in subsequent releases (as will a couple of C++98 features that Visual Studio doesn't quite get right).

In addition to the main C++ standard, which covers the language and core library, a number of subgroups have been created to produce specs for specific features, such as filesystem handling, concepts, database access, and so on. Microsoft is promising to implement these libraries as and when they become available, with concepts likely to be one of the first.

Microsoft's C++ roadmap. I want generic lambdas <em>so bad</em>.
Microsoft's C++ roadmap. I want generic lambdas so bad.

Apart from its standard support efforts, Microsoft said that it was going to work on some non-standard features: specifically, support for asynchronous programming that's comparable to the support it already has in C#.

Smartly preempting any complaints that Microsoft was trying to bastardize or corrupt the language with its own non-standard extensions, Sutter pointed to similar efforts by g++, clang, and even past work by Microsoft, where compiler developers created experimental extensions that subsequently fed back into the standardization process and helped shape the language's future. clang developers, for example, are working on a module system that will inform the work of the C++ modules subgroup. clang also led with an experimental implementation of generic lambdas.

Microsoft intends to go a similar route with its asynchronous extensions: it will build an implementation and collect developer feedback, and use this as a proof of concept for the standardization process.

The company will also strive to give regular updates on this roadmap. The first will be delivered in two months, when Microsoft hosts a second "Going Native" conference to discuss C++.

And what of the more distant future? Well, Microsoft probably won't have Visual Studio 2016, 2017, 2018, and so on. S. Somesegar, corporate Vice President of the Developer Division at Microsoft, said that the long-term ambition was simply to have Visual Studio, updated on a subscription basis. This approach will be consistent with the rapid release mentality, which tends to downplay version numbers and emphasize being up-to-date, and should see Microsoft delivering more functionality to more users in less time.

Channel Ars Technica