More thoughts on what may be on tap for Microsoft's WinC++

Fires are continuing to blaze over how to interpret Microsoft's focus on HTML5 and JavaScript (but failure to mention .Net and Silverlight) in the Windows 8 context. Amid all the smoke, Microsoft quietly is setting the stage for one of its coming dev tools that could figure big in the Windows 8 timeframe.
Written by Mary Jo Foley, Senior Contributing Editor

Fires are continuing to blaze over how to interpret Microsoft's focus on HTML5 and JavaScript (but failure to mention .Net and Silverlight) in the Windows 8 context. Amid all the smoke, Microsoft quietly is setting the stage for one of its coming dev tools that could figure big in the Windows 8 timeframe.

I've mentioned before that Microsoft is working on WinC++, the successor to its Visual C++ tool, and seems to be tweaking its COM engine, as well. The Microsoft “Jupiter” UI library for Windows 8 about which I blogged earlier this year, seems to have something to do with “XAML plus native code.” C++ was one of the languages possibly slated to be supported by Jupiter, last I heard. I'm guessing we'll be hearing more about WinC++ at Microsoft's mid-September Build conference -- the same place where Microsoft is expected to (belatedly) share more about its .Net/Silverlight futures.

It's not all complete radio silence on the Microsoft programming-futures front, however. On June 9, Microsoft posted a new Channel 9 video entitled "Mohsen Agsen - C++ Today and Tomorrow" that includes some tidbits on Microsoft's thinking around next-generation C++.

(Agsen is a Microsoft Technical Fellow working in the Developer Division. He was heavily involved in the creation of COM+ and the related the Common Language Runtime, or CLR. And remember: There may be some new CLR-related goodies coming with Windows 8 if my early information on "RedHawk" -- which has been sighted in Windows 8 leaked builds -- comes to pass.)

As I'm not a programmer -- and don't attempt to play one on the Internet -- I asked Kate Gregory, a partner in Gregory Consulting Limited and C++ Most Valuable Professional (MVP) for some help deciphering the latest Agsen video interview. I asked her a few questions via e-mail and am sharing those answers here.

Foley: Agsen talked about JavaScript and C++ being similar, even though they are at opposite ends of the spectrum. I wonder if Microsoft is setting the stage to offer Windows 8 developers two paths: The JavaScipt/HTML5 path and the C++ path. Do you think I’m reading too much into this?

Gregory: Mohsen talked about JavaScript and C++ having some of the same goodies for different reasons. I’ve heard that before, and not just for C++. When lambdas were first added to C# that’s how they were explained to me. In say VB3 or C# 1 you write for the button click, here is the name of the function to call when someone clicks the button. And the function itself is somewhere else, maybe even in a different file completely.

In old school C Windows programming, you would write here is the function pointer to the function to call when someone clicks the button. And the actual code that runs on the click is in the function, far away from the definition of the button. But in JavaScript, you can do that, or you can say OnClick=”x=y;alert(“hello!”);” or whatever the code is that you wanted to execute when the button was clicked. And that’s a lambda.

The point in the video was that most things you want to do, if you wait long enough you can do them in any language there is. Because people see things and they like them and they want them in their other languages too. But the way you get them may be very different. C++ didn’t gain dynamic typing and the other underlying features of JavaScript that support the OnClick= thing. It gained a different feature, lambdas, that gave people a capability they want.

Foley: Charles Torres (from Channel 9) asked Agsen about language translation, and I felt Agsen sort of glossed over it. Do you think Microsoft could and should do a Silverlight-to-HTML translator (the way Adobe is doing a conversion tool for Flash to HTML?) Or maybe some other kind of translator? Gregory: Once you have capabilities in mainstream languages that people like from other languages, then you have the possibility to translate between them. But you also have the possibility to suggest to people they switch from one language to another. The two things go together. That doesn’t necessarily mean that the two languages work together. JavaScript and C++ really are incredibly different, in the kind of code you write and in the way they work. They are both mainstream languages. I think Mohsen was saying that some non-mainstream languages may lose their unique selling propositions as mainstream languages add features, and people will move to the mainstream language when they can. Foley: In the futures section of the video, Agsen noted that C++ is taking on more than in the past. He cited data, text processing and web services as examples. Any thoughts as to what this might mean in the Windows 8 timeframe?

Gregory: I love that the C++ language is gaining capabilities. I love that the STL (Standard Template Library) is finally becoming mainstream for C++ devs, who historically have been very afraid of it. And I love the support both language changes and STL emphasis are getting not just from the C++ team, but from all of Microsoft.

Speculating about why is irresistible, but there are lots of perfectly good reasons that have been said out loud over and over again and don’t require any guessing. Native C++ gives you great performance, and great control over performance. Native C++ gives you interop to old code, to the operating system, to managed code through COM interop, and so on. Native C++ lets you use new features without waiting for someone to write a wrapper library or update a framework. The Parallel Patterns Library (PPL) for native C++ is AMAZINGLY simple to use, and combined with lambdas is super readable. (There’s a demo of that in my Tech Ed talk on Modern Native C++ development on Channel 9.")

A huge number of developers out there in the world already use C++ as their language of choice. Tony Goodhew gave some numbers in his Channel 9 talk, http://channel9.msdn.com/Blogs/Charles/Tony-Goodhew-VC-Developer-Communication-Questions-and-Answers . The sheer volume of C++ apps and C++ developers (and the youth of those developers) is surprising. We thought it was dwindling – it isn’t. So why shouldn’t Microsoft pay attention? Some people have been telling them to for years.

Update No. 1: The Register has a good interview with Microsoft's chief C++ standards man, Herb Sutter. From that piece:

"One factor that's helped C++ is its performance: as a native language, C++ talks to the CPU without going through an interpreter, unlike Java or even Microsoft's .NET, so it's generally considered fast – and performance is vital on devices such as tablets and smartphones.

"According to Google, C++ is the fastest runtime language when compared to Java, Scala, and Go, although it does require more extensive tuning and more expertise to achieve such results."

Update No. 2: AMD is talking up C++, as well. Check out this C++ mention re: the AMD Fusion conference this week (via reader @tekmaven):

"To get full performance out of mainstream hardware, high-performance code needs to harness, not only multi-core CPUs, but also GPUs (whether discrete cards or integrated in the processor) and other compute accelerators to achieve orders-of-magnitude speed-up for data parallel algorithms. How can you as a C++ developer fully utilize all that heterogeneous hardware from your Visual Studio environment? How can your code benefit from this tremendous performance boost without sacrificing your developer productivity or the portability of your solution? The answers will be presented in this session that introduces a new technology from Microsoft. and more expertise to achieve such results."

Editorial standards