Interview: C++–A Language for Modern Times

imageLast week I spent 30 minutes with interviewer Robert Hess to talk about the differences between managed and native languages, and why modern C++ is clean, safe, and fast – as “clean and safe” as any other modern language, and still the king of “fast.”

The interview just went live today on Channel 9. Here’s the blurb from the site:

C++: A Language for Modern Times

C++ has been around for what seems like forever. It might seem like it’s taken a back seat to languages that provide better application isolation and better development throughput, but in truth it remains one of the most widely used languages in the world. In order to gain some better insights on how C++ measures up in a "managed" world, I’ve invited Herb Sutter, Program Manager for Visual Studio, to explain how C++ has evolved and how it remains a great choice for many modern day development tasks.

I’ve said some of these things before, but it’s important to get the word out – modern C++11 is not your daddy’s C++, and as people return more and more to C++, we have some work still to do to help people unlearn some negative things that are no longer true (and in some cases never were true) about C++ as we know and use it today.

C++ and Beyond 2012: Aug 5-8, Asheville, NC, USA

imageFebruary and March have been killer busy, so that I forgot to repeat an important announcement here: registration is open for C++ and Beyond 2012! I’m looking forward to teaching for three days again with Scott Meyers and Andrei Alexandrescu at one of the top C++ conference highlights of the year.

This year, C&B will be held on August 5-8 in beautiful Asheville, North Carolina, USA. Registration is limited to 120 people, and now that I’m a month late in repeating this announcement I see that it’s already over 25% booked… seats are going faster than in either of the previous years, but fortunately there are still lots of spaces available as I write this.

This is becoming yet another big year for C++ in the industry, as C++ use and interest continues to surge and even the ISO C++ committee isn’t slowing down after delivering C++11 but is actually accelerating, ramping up work for the next round on concurrency/parallelism, networking, filesystem, and other short-term topics of interest as mentioned in my trip report. As usual, C++ and Beyond will feature the most important material you can use today and information about what to expect that’s coming down the pike short-term tomorrow.

Only two of the session descriptions have been posted so far, but they’re already deeply interesting and brand-new material never presented before – by us or by anyone, as far as I’m aware. Here they are…

1. “Universal References in C++11” (brand-new talk by Scott Meyers)

Scott’s first-announced talk on “Universal References in C++11” targets a key underpinning of two C++11 marquee features – move semantics and perfect forwarding. I’ve seen drafts of the material, and this is going to be a deeply illuminating talk that covers not only the “what” and “how” of thinking about and effectively using T&& declarations in C++, but also the “why” – the thinking behind the language rules that helps us to understand the reasons why this important C++11 feature was designed the way it is, and what other topics and techniques it affects.

2. “You Don’t Know [keyword] and [keyword]” (brand-new talk by Herb Sutter)

Yes, the title really is “You Don’t Know [keyword] and [keyword],” at least for now. Here’s the description I just posted:

I plan to give a brand-new talk for the first time at C&B, but I’m conflicted regarding what to say about it here because it’s recently been a bit of a startling realization to me about C++11, and I think it may be a bit startling for others too. I don’t want to be a tease, but I also want to save it as a surprise for C&B itself.

In the meantime, here’s a teaser…

In addition to the many new C++11 features that everyone’s listing, it has dawned on me over the winter that there’s actually another major change that isn’t being talked about anywhere, or even being listed as a change in C++11 at all as far as I know, because I and other key experts and committee members I’ve asked didn’t fully realize that we altered the basic meaning of not one but two fundamental keywords in C++. It’s a change that has profound consequences, that rewrites and/or invalidates several pieces of pre-C++11 design guidance, and that’s directly related to writing solid code in a concurrent and parallel world. This isn’t just an academic change, either – everyone is going to have to learn and apply the new C++11 guidance that we’ll cover in this session.

I plan to talk about it first at C&B, in a session tentatively titled as above – I’ll fill in the keywords later. You may already guess a few keyword candidates based on the description above, and here’s a final hint: You’ll hardly find two C++ keywords that are older, or whose meanings are more changed from C++98 to C++11. (No, they aren’t auto and register.)

I hope you can come, and I’m looking forward to seeing many of you in Asheville this summer.

Trip Report: February 2012 C++ Standards Meeting

wg21The spring 2012 meeting of ISO/IEC JTC1/SC22/WG21 (C++) was held on February 6-10 in Kona, Hawaii, USA.

Here’s the major takeaway: This is going to be a busy year as investment in C++ across the industry continues to increase, and that’s good news for C++.

Here are some highlights from the meeting.

Attendance

This was the second meeting after completion of the C++11 standard. After a standard ships, often attendance will decline for a while, especially if the intent is to “go quiet” for a time to let the industry catch up, as we did after completing C++98.

As you can see below, however, it’s clear that this time the C++ committee is gearing up, not gearing down, after shipping its latest major standard. That’s reflected in record attendance: 73 experts attended, with record numbers of participants from companies like Google and Intel and Microsoft and NVidia, to avidly begin planning for work on the next standard as well as other deliverables even in advance of the next standard.

Full speed ahead, part 1: C++1y

The biggest decision we knew would be discussed was to decide “what’s next” after C++11. Right away on Monday morning we decided that WG21 will immediately begin working on a new revision of the ISO C++ standard, including both language and library extensions, with a rough target of completing work on a new “C++1y” standard in approximately five years. That is, y is hoped to be approximately 7, but that’s intended to be only a rough scope guide at this point.

To have any chance of making y be approximately 7, C++1y can add at most one major new language feature, and there are already more language extension proposals than could possibly fit. The evolution working group (EWG), chaired as usual by Bjarne Stroustrup, therefore spent much of the week surveying the landscape of major evolution proposals we might consider in this round, and we had initial presentations of several, ranging from concurrency and parallelism to modules and static if.

We tried not to make any yes/no scope decisions at this meeting, and so many of these will come up again as updated and further-refined proposals at our next full meeting in October; at that point we intend to start saying yes and no to particular proposals we want to consider for the C++1y timeframe. In the interim, some of the proposals (notably concurrency/parallelism approaches, and the module system proposals) have enough interest that subgroups will hold additional smaller face-to-face meetings this summer in between full WG21 meetings so as to make more progress in these areas; more on this below.

Full speed ahead, part 2: Libraries galore

As I reported form our last meeting, the library working group (LWG) also has already decided to immediately continue working on new extensions to the standard library, and solicited proposals. In Kona, we reaffirmed that the door is open for library extensions, and our LWG chair Alisdair Meredith issued this call for library proposals.

But these libraries aren’t just for C++1y, because the LWG intends to work on shipping new libraries in smaller pieces in order to deliver work sooner and in smaller bites. Some libraries, such as File System and Networking, are big enough and separable enough to work on as independent pieces that can even ship separately from (read: earlier than) C++1y in the form of a Technical Specification (TS). (Terminology note: TS is the new ISO term for what we used to call Type 2 Technical Reports (TR), such as the first Library Extensions TR.)

These smaller pieces will be worked on independently, and once they’re ready to bring to the full WG21 LWG it will be the LWG that decides how to progress them – as part of the C++1y International Standard (IS) or as their own standalone TS or even IS.

Study Groups

Because we’re gearing up for all this work, and so much of its parallelizable, I’ve created the first four official WG21 Study Groups (SGs) that can meet independently to progress their work between full WG21 meetings. These SGs will help to refine and progress proposals faster by working on their own, but will bring all proposals to WG21 as usual for approval and further refinement before anything is published as a TS or IS.

The first four study groups, and their chairs, are as follows:

  • SG1: Concurrency and Parallelism (Hans Boehm)
  • SG2: Modules (Doug Gregor)
  • SG3: File System (Beman Dawes)
  • SG4: Networking (Kyle Kloepper)

There will be at least one face-to-face SG meeting, and there may be more. Here’s what I know about so far:

  • Week of May 7, 2012: Bellevue, WA, USA (SG1 and SG4)
  • (if needed) Summer 2012: Toronto, Canada (SG1)

Looking forward

Besides smaller Study Group meetings, here are the planned dates and locations for upcoming meetings of the full ISO C++ standards committee:

“Welcome to the Jungle” in Kansas City – March 20, 2012

WelcomeThanks to Perceptive Software who are bringing me to Kansas City in two weeks to give a free talk on “Welcome to the Jungle.”

The talk will be based on my recent essay of the same name (sequel to ”The Free Lunch Is Over”) concerning the turn to mainstream heterogeneous distributed computing and the end of Moore’s Law, with ample time for Q&A and discussion.

Here are the coordinates:

Computing Trends with Herb Sutter: Welcome to the Jungle

When: Tuesday, March 20 at 1:00 – 3:00 P.M.

Where: Boulevard Brewery, 2501 Southwest Blvd, Kansas City, MO, USA 64108

Abstract: In the twilight of Moore’s Law, the transitions to multicore processors, GPU computing, and HaaS cloud computing are not separate trends, but aspects of a single trend – mainstream computers from desktops to ‘smartphones’ are being permanently transformed into heterogeneous supercomputer clusters. Henceforth, a single compute-intensive application will need to harness different kinds of cores, in immense numbers, to get its job done. – The free lunch is over. Now welcome to the hardware jungle.

This is a free lecture; all are invited, but you should register to make sure you’ll have a seat. Note that this talk is live only and is not being recorded or webcast.

I look forward to meeting many of you there in person.