Coders grill Herb Sutter on future of C++ at Microsoft
Sorry about the .NET thing, chaps
"The world is built on C++ and so is Microsoft," proclaimed Herb Sutter at Microsoft's Build conference last week in Seattle, Washington.
Sutter is chair of the ISO C++ standards committee and Microsoft's Visual C++ language architect. Native code is currently ascendant inside his company, with C++ prominent in SDKs for Windows Phone 8 and for the Windows Runtime - the touch-friendly app platform in Windows 8.
Sutter used Build to make several announcements. First was the Community Tech Preview (CTP) of an updated Visual C++ compiler supporting more features of ISO C++ 11. The additions are as follows: Variadic templates; uniform initialization and initializer_lists; delegating constructors; raw string literals; explicit conversion operators ;and default template arguments for function templates.
This is a preview, so you are not meant to use it for production code. The CTP requires Visual Studio 2012, but you can use it with the free Desktop Express edition.
The second announcement was about the Standard C++ Foundation, whose website is now live at http://isocpp.org/. The 18 founding members include Microsoft, Google, Intel, ARM, IBM and OpenMP. The idea is to raise the profile of modern standard C++ and to grow the community. "It makes transparent the standardisation work; it encourages people to contribute," said Sutter.
But why is Microsoft so behind with C++ 11 conformance?
Visual C++ implements some of the C++ 11 standard, agreed by the ISO in August 2011, and some features were even included in Visual Studio 2010. However a comparison of what is implemented in Visual Studio 2012 shows that Microsoft is behind others such as GCC or Clang. The absence of variadic template support in Microsoft’s compiler has been a particular annoyance.
The most illuminating session at Build was a Channel 9 (Microsoft's developer community site) interview in which Sutter took questions. He explained that creating Windows 8 and its new tablet-friendly Windows Runtime has absorbed much of the C++ team's energy.
"We've been really busy for two years with our biggest release ever. There's an industry tsunami to the tablet revolution, the GPU compute revolution. Because C++ matters is why we're at the centre of it. Now we can emphasise conformance again," he said.
Sutter also acknowledged that Visual C++ had suffered from Microsoft's former emphasis on .NET development. We want "to get back to parity," he said. "At Microsoft, the investment was in managed languages for a decade. And in the industry, in Java, the investment was in managed languages ... the pendulum swung too far".
In answer to a question on C++/CLI, a way to code for .NET in C++, Sutter also reflected on Longhorn, the original version of Windows Vista before it was reset.
"When we first started doing C++/CLI Windows Longhorn aimed to put managed code at the heart of the modern operating system. It was a grand endeavour. Therefore it's our job as the C++ team to support the platform, to provide access to everything it offers. The directive went out for a time saying all new APIs will be managed, they may also have native equivalents but in addition to, not instead of. So we had to support managed code well and we invested heavily in that. Then Windows did not do that."
Still, that is past history. Now Sutter says Microsoft is aiming for full C++ 11 conformance "as soon as we can".
That said, Microsoft has yet to implement the full standard for ISO C99, to the frustration of C programmers. Will Visual C++ ever support C99 designated struct initialisation syntax, which allows programmers to assign initial values by member name rather than an error-prone comma-separated list?
"I don't know." says Sutter. Not a good sign.
There were other points of interest. Microsoft would like to bring something like the C# 5.0 await feature to C++. It would also support a C++ garbage collector. "I think we need one," Sutter says. "We are very happy with reference counting. This is not to change anything we have today. But to use when you want to, and only when you want to. You need this for high-performance lock-free collections, for example. We intend to write a proposal for the standards committee," he said.
But there are no plans for Open CL, an open standard for GPU and accelerator programming. "We want a C++ solution," says Sutter. Nor for MPI (Message Passing Interface), though he would like to see more standard support for message passing.
MFC (Microsoft Foundation Classes) is still under active development, since it has no comprehensive replacement for development of desktop application, but it is not something much talked about, suggesting that only minimal updates are likely.
Sutter does offer hope for a faster ARM compiler, which would speed performance of apps for Microsoft's Surface RT device. "We have a really mature compiler and optimiser. It's been around for a decade or two, on x86 and x64. Then we have a version 1 release of ARM. You can expect that to get better."
When can we expect these further improvements in standards conformance and other features? There are no firm dates, but Microsoft is promising a relatively fast pace and more announcements in the first half of 2013. ®