June 2015

CppCon 2014 A Deep Dive into 2 Cross-Platform Mobile Apps Written in C++--T. Grue & S. Kabbes

Have you registered for CppCon 2015 in September? Don’t delay – Early Bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2014 for you to enjoy. Here is today’s feature:

A Deep Dive into 2 Cross-Platform Mobile Apps Written in C++

by T. Grue & S. Kabbes

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

At Dropbox we’ve spent the last year and a half building two cross platform mobile apps: the email client, Mailbox, and the photo gallery, Carousel. We started with the goal of a native look and feel with seamless performance but also needed to leverage a small team to build these apps on multiple platforms. We ultimately accomplished this by using C++ to share significant amounts of code in each app.

We’ll cover what portions of our apps we built in C++ and why we left some portions in the platform languages of Java and Objective-C, deep diving into some of the most important components. We’ll also discuss some unexpected benefits, areas we faced technical and human challenges, and some tips and tricks that you can use to leverage C++ to build very high performance apps.

10 tips to be productive in CLion, cross-platform C/C++ IDE -- Anastasia Kazakova

An article on how to improve your productivity when using CLion IDE.

10 tips to be productive in CLion

by Anastasia Kazakova

From the article:

Judging from my own experience as a developer, many C/C++ developers dismiss the idea that an IDE can make them more productive. Because what could be better than the simple and quick Vim or Emacs? Well, let me show you. These 10 CLion tips can take you to a new level of productivity, by letting you focus on the important and complicated tasks while the IDE handles routine jobs for you.

From Smart Code Completion to Inline Variables View...

CppCon 2014 Attendee Video -- CppCon.org

Registration is open for CppCon 2015 this September. If you're considering going, but aren't sure what to expect, check out the two-minute video below to get a feel for the event:

CppCon 2014 Attendee Video

Also in the announcement, more good ammunition for telling your manager why you and your colleagues need to attend this year:

If you are thinking about attending CppCon 2015, but you are still on the fence because you didn’t attend last year’s conference here are some tips to help you decide.

  • You can check out the program from last year to see what kind of sessions we’ll likely have this year.
  • You can check out last year’s speakers to see the type of speakers who you likely get to meet this year.
  • You can watch last year’s sessions on YouTube or Channel 9.
  • You can watch this video [above] with comments from some of last year’s attendees.

Nugget: static_assert--Glennan Carnie

A short nugget by Glennan Carnie:

static_assert

by Glennan Carnie

From the article:

C’s assert library is a useful tool for catching invalid invariants (conditions that must hold true in order for your system to operate as specified) in your program. The big problem with assert is that it’s a run-time check; in many cases the best you can do  to recover from an assert failure is restart the system or put it into a quiescent state...

CppCon 2014 What did C++ do for Transactional Memory?--Michael Wong

Have you registered for CppCon 2015 in September? Don’t delay – Early Bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2014 for you to enjoy. Here is today’s feature:

What did C++ do for Transactional Memory?

by Michael Wong

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

SG5 is a Study Group within WG21 developing a promising new way to deal with mutable shared memory, that is expected to be more usable and scalable than current techniques based on atomics and mutexes. It promises to be as easy to use as coarse-grained locks, as scalable as fine-grained locks and yet remain composable.

Find out where on the Gartner hype cycle lives Transactional Memory.
Is it at the Peak of Inflated Expectations, Trough of Disillusionment, Slope of Enlightenment, or Plateau of Productivity?

For that matter, just how soon will I be able to use it with the new Intel Haswell, and IBM Power Hardware, or is it one of those mirages where the closer you get to your hardware, the further it moves away.

And is it true that one of the lead author of this TM proposal also wrote "Is it just a Research Toy?"

This 60 minute advanced talk will cover the history of Transactional Memory, various lock elision and optimistic speculation techniques, the technical engine behind Transactional Memory, the recent research in its use cases, usability and performance data that supports its entry into the C++ Standard, and of course the latest details of the SG5 Technical Specification, including our effort at transactionalizing the C++ Standard Library.

CppCon 2014 Modern Template Metaprogramming: A Compendium, Part II--Walter E. Brown

Have you registered for CppCon 2015 in September? Don’t delay – Early Bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2014 for you to enjoy. Here is today’s feature:

Modern Template Metaprogramming: A Compendium, Part II

by Walter E. Brown

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Template metaprogramming has become an important part of a C++ programmer's toolkit. This talk will demonstrate state-of-the-art metaprogramming techniques, applying each to obtain representative implementations of selected standard library facilities.

Along the way, we will look at void_t, a recently-proposed, extremely simple new new type_traits candidate whose use has been described by one expert as "highly advanced (and elegant), and surprising even to experienced template metaprogrammers."

Trip report: Spring ISO C++ meeting

(I'm writing my trip report now that all the post-meeting papers are available and linkable this week.)

The spring ISO C++ meeting was held on May 4-9 in Lenexa, KS, USA. Many thanks again to Lexmark for hosting us! There were 93 experts at this meeting, officially representing 5 nations. Last fall’s meeting (see trip report) saw a recent-record number of over 120 papers; for this meeting it was over 140 papers in the two pre-meeting mailings (February and April).

As usual, we met for six days, starting Monday morning and ending on Saturday afternoon, with a number of evening sessions to fill out the round-the-clock technical discussions.

There was particular interest in planning for C++17; this was the subject of the Monday evening sessions led by Bjarne Stroustrup based on this draft “Thoughts on C++17” paper published a week before the meeting... after Bjarne’s initial internal and more informal committee email leaked to Reddit. There’s nothing like having a forcing function to write up an actual paper!

For a detailed list of papers that were adopted at this meeting, see the post-meeting mailing that just went live for the papers marked “Adopted 2015-05.” Also, check out STL’s nice summary posted on Reddit, and the video “The future of C++[17] -- Updates from Lenexa” on Channel 9 with Gabriel Dos Reis and Artur Laksberg. [ETA: Also Botond Ballo's detailed trip report.]

TS Milestones: 3 Completed, 1 Sent For Comment Ballot

We finished three more Technical Specifications, incorporating their ballot comments and sending the final text to ISO for publication. These should all be formally published this summer: Transactional Memory TS (project editor: Michael Wong), Parallelism TS (project editor: Jared Hoberock), and the Library Fundamentals TS (project editor: Jeffrey Yasskin). All of them had only minor tweaks at this meeting.

In addition, we also sent the Concurrency TS out for its comment ballot (project editor: Artur Laksberg). We hope to address the comments at our fall meeting in Kona; if they can all be addressed in one meeting, the Concurrency TS would be completed this year, making four TSes published this year. I asked Artur for a summary and here’s what he wrote: “The Concurrency TS consists of three parts: First, it introduces improvements to std::future<T> to enable wait-free composition of asynchronous operations. It introduces the concepts of continuation (the “then” API) for chaining multiple futures as well join and choice operations, represented by, respectively, when_all and when_any APIs. Second, the TS introduces thread coordination mechanisms called latch, barrier and flex_barrier. These mechanisms allow one or more threads to block until an operation is completed. An individual latch is a single-use object: once the operation has been completed, it cannot be reused. A barrier is re-usable: once the operation has been completed, the threads can re-use the same barrier. Flex barriers allow additional behavior to be defined when an operation has completed. Finally, the TS introduces class templates atomic_shared_ptr<T> and atomic_weak_ptr<T>, which are useful for writing lock free code. Compared to the existing mechanisms, the new concepts offer superior performance and are less error-prone.” -- On a personal note, I’m especially happy with that last bit because that was my proposal. Not all proposals succeed even after several meetings’ worth of work, and it’s nice to see the atomic smart pointers make it into the TS.

Note that this means that in under 12 months we have published the C++14 International Standard and three Technical Specifications, and it’s possible that the Concurrency TS might become a fourth. That’s quite an achievement, and thanks very much to the above-mentioned editors and all of our hardworking project editors and contributors! You can always find a list of current projects and their editors at isocpp.org/std/status.

Other Major Projects Update

The Concepts TS just completed its comment ballot, and we considered most of the ballot comments in Lenexa. We’re going to have one more telecon to finish the comments, then decide whether it’s ready to publish this year. Of course, what matters to you as a developer is not just when the committee blesses a document, but when you can try out the feature in your compiler, so I’m happy to report that my understanding is that vendors are not waiting for the TS to be published to implement Concepts in real compilers: I’m told that GCC expects to adopt the Concepts reference implementation into its next release, GCC 6, which if GCC follows its usual schedule would likely be spring 2016; and I’m also told that one or two other major implementations are working on implementing Concepts.

Modules also made good progress where the redesign led by Gabriel Dos Reis got encouragement form the committee and I’m told agreement among the major compiler vendors, though there are still a few important but relatively minor details to decide. Among the major C++ compilers, I’m told there should be at least one shipping experimental implementation of the current modules design available by the end of this year.

Ranges made great progress. Eric Niebler has worked hard over the winter and spring and brought initial draft wording for applying ranges to the entire iterators and algorithms clauses of the standard – this is no small wording undertaking! A reference implementation tracking the proposal is available on GitHub. We hope to see, and possibly adopt, initial working draft wording for Ranges at our fall meeting.

Networking is well on the way to producing a TS working paper based on the Boost.ASIO library with detailed wording also expected for the next meeting where we might be able to start a working draft.

Coroutines (await, generators) made good progress at this meeting and might also have working draft wording in Kona for the primary proposal: Visual C++ is shipping a reference implementation in VS2015, and my understanding is that at least one other major compiler is looking at implementing it this summer for possible release around the end of the year. There are also complementary/alternative coroutines proposals still in flight, so this is an active and important space.

Finally, Reflection had an evening session to progress some papers, and many other papers and proposals made progress too.

CppCon, Games, and a new SG14: Game Development and Low-Latency

I want to end with one interesting thing that happened in Lenexa that involves the C++ community beyond just the traditional standards committee attendees.

This past September, the first-ever CppCon was held, and it’s surprising how influential it already is. Here is one example. There at CppCon, we had a Meet the Authors session – that’s not too unusual at this kind of conference, and you might even think it would likely be a “lightweight” or “fluffy” kind of session. Well, never mind that there were a dozen heavyweight authors on the panel, from Bjarne Stroustrup and Scott Meyers on down all on the same stage, but that hour of discussion had real influence. In particular, the topic of ISO C++ and game development came up from the audience, and Michael Wong volunteered to arrange and lead a session later in the CppCon week on that topic. (CppCon deliberately leaves room for this kind of flexibility to be able to respond to whatever will get the most benefit out of the face-to-face time we have at the event.)

That extra session was strongly attended. In that session and since, Mike has continued to be approached by a steady stream of game developers who are interested in contributing to C++ standardization. And in addition to game-specific developers, there also seems to be a strong overlap with other developers interested in low latency programming for reasons other than frame rates.

What does all this have to do with the spring ISO C++ meeting? In Lenexa, Mike Wong reported the above backstory. When I polled the ISO C++ committee members in the room, a couple of dozen said they would be interested in participating in such work – and that’s a very strong response for a single topic area.

So this discussion that started brewing at CppCon has had a real result: At the Lenexa meeting, I created a new Study Group 14 on Game Development and Low-Latency Computing, with Mike Wong graciously volunteering to serve as the initial SG14 chair.

The next question was, how do we engage with this community? To get started, based on the community’s feedback through Mike, we realized need to overcome two particular challenges:

  • Some of these experts have submitted proposals to ISO C++ before, but it was at a time when the committee was busy shutting down C++11 and it might have appeared that the committee wasn’t interested (though we are).
  • These developers remain interested in contributing to C++ standardization, but they’re busy with their own conference schedule and product deadlines (so we need to meet them where they are).

Together, we felt this means we should start by meeting the gamers (and other low-latency developers) where they already are – by having official SG14 meetings “out in the field” starting at CppCon this September because that’s where they already were to start this drive last year. Having “side meetings on particular topic areas” that are separate from full ISO C++ meetings is exactly what Study Groups are for.

Our intention is to have formal SG14 meetings in the coming months located where these developers are, in addition to our full ISO C++ meetings:

1. SG14 @ CppCon 2015 in September. Mike and I will convene a full-day formal SG14 meeting at CppCon itself, currently tentatively scheduled for Wednesday. In attendance will be a number of long-time ISO C++ committee members and leadership, including but not limited to Mike (SG14 chair, CEO of OpenMP, and chair of Canada’s C++ committee), Ville Voutilainen (WG21 Evolution Working Group chair, Finland C++ committee), and myself (WG21 convener). We hope this shows we’re serious about engaging on this topic area! The agenda will be to entertain proposal ideas, to find a core set of proposals that could have critical mass of support and volunteers that we can encourage work on, and to set a draft agenda for #2 below... (Note: CppCon registration is not required to attend just the SG14 meeting, but is required if you also want to attend some of the 100+ CppCon sessions.)

Following the outcome of meeting #1 at CppCon, there may also be topics raised at additional SG14 telecons, and/or the two intervening full ISO C++ meetings in October and February. Then...

2. SG14 @ GDC 2016 in March. Mike and I then plan to convene a 2-3 day SG14 meeting (or as much time as is needed), again likely on-site at GDC. As soon as this was suggested, ISO C++ committee member organizations in the room started approaching me to offer facilities support to host this meeting at the GDC site or within short walking distance.

Thanks again everyone in the game development and low-latency computing industries for the strong interest, and to the over 100 volunteers whose hard work behind the scenes made CppCon possible last year to enable this kind of interaction, and who are hard at work as we speak organizing it again this September! CppCon is clearly already getting to be “the place to be” for the whole C++ community – including the intersection of the standard and the industry. This is important, and great to see.

Next meeting

Our next full WG21 face-to-face meeting will be in October in Kona, HI, USA, hosted by Plum Hall and the Standard C++ Foundation.

In the meantime, over the summer we’ll be having several other smaller telecon meetings, including as noted above to try to finalize the Concepts TS and meet at CppCon for the new SG14.

Many thanks especially to the meeting hosts for graciously volunteering to organize these meetings!