Back to Aspen: C++Now trip report by JetBrains

In May we were back to Aspen for C++Now 2018. This year the weather in Aspen was very friendly (no snowstorm like in 2017) and we were enjoying every single day of the event.

What makes C++Now conference unique to me is a free and brave look into the future of C++. While other C++ events are mostly focused on sharing knowledge about new but existing language features, libraries, tools and techniques, C++Now is all about C++’s future evolution. C++ experts from all over the world (including many C++ committee members) are gathered in Aspen, at an elevation of 2400m, to discuss what can be improved in the language, and how, to make it more powerful, simpler to understand and more performant.

This approach to the conference goals greatly affects the way attendees interact with a speaker during a talk. This looks more like a dialog (or a heated discussion, depending on a topic) than a lecture. So if you speak at C++Now, be ready to learn even more about your topic from your listeners.

At high altitude like this you might feel the lack of oxygen, which limits your physical activities. But every morning you have to cross the wonderful meadow to get to the Aspen Center of Physics and here the magic of C++ begins! By the way, on the way back it’s highly recommended to use a flashlight, otherwise you have big chances of meeting a bear in the dark ;)

Opening and closing keynotes

The opening keynote by Lisa Lippincott (“The Shape of a Program”) and closing keynote by John Regehr (“Undefined Behavior and Compiler Optimizations”) were both very inspiring.

Lisa talked about a topology-based approach to programming which might be helpful for formal verification of the code. The idea was to look at a program as directional chains of opened/closed sets and assertions (pre-conditions like readable, writable, exception_is_rethrowable, etc.) that describe the edges. Building a proper model makes it possible to formalize the verification procedure.

Compilers are capable of performing thousands of smart optimizations, but sometimes they strengthen the preconditions and make the undefined behaviours even worse. In his talk John was explaining the problem on a set of examples, as well as discussing code poisoning rules (how the poisoned values are propagated through the calculation). The last part of the keynote was dedicated to some corresponding tools discussion like Souper and Alive.

Mixins by Odin Holmes

Odin Holmes is famous for his talks on template metaprogramming and his work in the embedded area. At C++Now he did a few talks, I visited “C++ Mixins: Customization Through Compile Time Composition”. In order to get more flexible customization capabilities and at the same time easier to read/teach and self-explanatory code, Odin suggest to follow a way of many composable objects: mixins. There can be interface mixins (which add elements to the public interface of the composition) and implementation mixins (which add implementation details). While mixins in Odin’s implementations were just classes in the composition tuple, the most interesting, of course, was a discussion on how these mixins were able to find information about the other parts. Two big use cases served as samples: fixed vector and statically linked Qt widgets, both implemented via mixins.

Smart output iterators by Jonathan Boccara

At ACCU 2018 Jonathan was making a great overview of STL algorithms. Jonathan’s talk at C++Now looked like one level above this overview and raised an interesting question – in the chain “input iterator – algorithm – output iterator” should the logic / smart things happen in algorithm, like it’s now in STL, or can it be moved to the iterators? Smart logic moved to input iterators are represented by the ranges proposal. And here in this talk we looked at the another opportunity – logic put into output iterators. The main idea of all implementation in the Jonathan’s solution was to overload =operator and leave ++ and * operators as they are now. Examples include custom_inserter (gets lambda which explains how to insert thing), map_aggregator (if you insert something to the map with the key which is present already, then use the passed lambda explaining how to aggregate the values for the matched keys), output_trasformer, output_unzipper and many others. The library code is located on GitHub. Jonathan also provided charts with performance comparison for all three options: normal STL approach, ranges and output iterators from his library. He also promised a corresponding blog post in his blog Fluent {C++}.

Other interesting talks and discussions

I’m thankful to Jon Kalb for inviting Matt Godbolt at the very last moment to give a talk at C++Now. Matt did a second edition of his CppCon 2017 keynotes, however the 1.5h slot was only enough for the completely new content, so I didn’t regret joining Matt’s talk on “What Else Has My Compiler Done For Me Lately?”. I learnt again how smart modern compilers are and also noticed a few tiny, but nice, feature additions to compiler explorer (and you know what it is if your browser completes instead of when you start typing “go”, as it happens here for our C++ team quite often).

I’d like also to mention Michael Caisse’s talk “Modern C++ in Embedded Systems”, which gave me a nice push to think about why embedded developers are not using C++ widely and how we can help them see more benefits in using C++ (like zero cost abstractions, correctness enforced by types and ability to debug on local host thanks to the abstractions).

“Game Engine API Design” by Allan Deutsch was useful in terms of understanding which language features seems the most interesting to the game developers (the answer here was definitely reflection, at least its introspection part). We also followed up with a discussion of the general choices made by AAA-games producers and the reasoning behind them.

And I greatly enjoyed the philosophical discussions at Ben Deane’s “Easy to Use, Hard to Misuse: Declarative Style in C++” and Titus Winters’s “Modern C++ API Design: From Rvalue-References to Type Design” talks.

Over to Phil Nash

This was my second year in Aspen for C++ Now, so I knew what to expect. Nonetheless the scenery was, once again, breathtaking – which can be a problem when you don’t have as much breath to start with at that altitude! Not as much snow as last year, as Anastasia said – but still enough on the tops of the mountains. Because of the lack of snow for the season there had been fewer skiers passing through, so many local restaurants and other businesses were closed. There were still enough open for the trips into the town to be enjoyable – and there were always a few crowds from the conference going. As with all conferences the time outside the sessions is at least as important as the sessions themselves.

That said, C++ Now is special in that watching videos of the talks after the event, while still worthwhile, cannot capture what it’s like to actually be present during talks! This is because the degree of interaction with the audience is a big part of programme (although this does vary from talk-to-talk). For me the highlight was Gašper Ažman’s talk, “My Little *this Deduction: Friendship is … Uniform?”. I already knew about the proposal before I attended, although Gašper still had a few second-order features to reveal. But more than half of the session time was taken up by discussion back-and-forth between audience members. This is a simple, yet far-reaching, proposal and it was fascinating to witness – and take part in – this discussion.

I also really enjoyed Charley Bay’s talk, “A Quantum Data Structure For Classical Computers” – which turned out to be more practical than expected, and changed the way I think about both classical and quantum computing – not least because we’re closer to having to deal with quantum effects in modern computing architectures than we think!

I attended Jason Rice’s “Docker Based C++ Dependency and Build Management” talk, even though I’m a bit jaded on Docker material. I’ve not actually used Docker in practice, yet – but after Jason’s talk I now have a much clearer picture of what Docker actually is – and how it might be useful to me in practice.

There were two talks about exceptions – Michael Spencer’s “How Compilers Reason About Exceptions” and my own, “Option(al) Is Not a Failure”. I felt the two talks complemented each other well; Michael’s was about the current state of exceptions – their costs and advantages – and how they may not be as bad as some have been making out recently. Then my talk, immediately afterwards, made a tour of past and present error-handling approaches, including exceptions, then a look ahead at what might be coming – culminating in a summary of Herb Sutter’s new proposal, p0709 – “Zero-overhead, deterministic exceptions: Throwing values”. The proposal only went public a few days after the talk, and has been generating a lot of discussion since.

Jon Kalb and I also recorded an episode of Cpp Chat during the conference. I’ve recently become the producer and co-host of the show – which is also now being released as a podcast, so do check that out. The C++ Now episode should go live shortly after this post is published.

(now back to Anastasia)

The week was full of valuable talks, but it doesn’t seem we can pack them all in one blog post. All the talks, including lightnings, were recorded by Bash Films. And like the year before, JetBrains was the video sponsor. This means all the high-quality videos will be soon available on the BoostCon YouTube channel.

There are also a few other trip reports available by now:

Hope to be back to Aspen next year!
Your C++ Team
The Drive to Develop

image description