CppCon 2017 Trip Report

Last week in Bellevue, WA, around 1100 C++ programmers got together for CppCon. I love this conference – it’s a chance to meet up with my existing C++ community friends and make new ones, to learn new techniques and explore parts of C++, and to get excited about where C++ is headed in the next 5 years. Just about everything in C++ is represented, from low-level optimization techniques to functional template metaprogramming.

This year the program was strong as always, and many slots featured 2 or 3 talks that I wanted to see; of course I could only be in one place at a time. Of those that I attended, here are a few highlights.

Matt Godbolt’s keynote, “Unbolting the Compiler’s Lid”, was excellent. I think Matt was really feeling the love this conference, as well he should; his Compiler Explorer is an excellent tool that has changed the way we communicate about C++. His talk highlighted the accessibility of using Compiler Explorer and I hope that as a result, more C++ programmers get the curiosity to look under the hood and understand what their code is really doing. It’s great also that the whole project is available on Github so that anyone can grab it and use it locally, perhaps on a code base internal to their company.

John Regehr is a well-known blogger and authority on undefined behaviour, and his two-part talk was really good. He showed where and why undefined behaviour exists and offered ideas for a path forwards for dealing with UB. He is also a very good speaker, as I find many university professors tend to be. Scott Schurr’s talk “Type Punning in C++17: Avoiding Pun-defined Behavior” was also a good talk that showed a lot of code and covered practical techniques for avoiding UB. Scott ran out of time and had to omit a section of the slides, but what he did show was very good advice.

I like talks that are both entertaining and rigorous, and Arthur O’Dwyer delivers both in spades. He had two talks at CppCon this year. “dynamic_cast From Scratch” was an excellent exploration of C++ inheritance as implemented against the Itanium ABI, and “A Soupçon of SFINAE” offered very useful techniques for leveraging home-made type traits. There is a lot in both talks that can be applied against the codebases I work in.

This year’s CppCon featured many talks about allocators, and I found two very useful. Bob Steagall presented “How to Write a Custom Allocator”, which particularly opened my eyes to fancy pointers and their use in relocatable heaps. This is a technique I’ll definitely be looking into; I think it has great applicability to my projects. Pablo Halpern presented “Modern Allocators: The Good Parts” on Friday morning, a comprehensive overview of how allocators have changed for C++17 and a really good explanation of how exactly the new polymorphic memory resource approach works. Again, this is something that is very exciting for me personally in terms of how much easier it is to use. In the past I’ve seen people reimplement standard containers just because the allocation was so hard to control. My hope now is that with the C++17 changes, we can use an allocator to get the control we want and not take on the maintenance burden of rewriting so much.

The intense schedule and in-depth topic coverage of CppCon can leave one’s brain tired, so it’s nice now and then to have talks that are fun. Matt Godbolt’s early-morning open content session “Emulating a BBC Micro in Javascript” took me right back to my childhood. Sadly, open content sessions aren’t recorded, but it was great to remember the 6502-based BBC Micro, not to mention fascinating to hear the intricacies of the 8-bit hardware timing and copy protection schemes. Hearing that BBC disk drive and seeing Matt play Elite was a great way to start a Wednesday morning.

Another fun talk to finish up with on Friday was Juan Arrieta’s “Travelling the Solar System with C++: Programming Rocket Science”. This talk was light on C++ content compared to other talks, but really engrossing nonetheless. Juan is a good presenter and hearing all about his work at JPL kept me spellbound for the hour.

All these talks, and more, were great, and when the videos start appearing on YouTube, I’ll be watching the rest – and probably re-watching the ones I liked. Bash Films did a fantastic job last year getting the videos sorted out in short order, so I expect there won’t be long to wait. But for me CppCon isn’t just about the talks; it’s about the connections and the opportunity to discuss things, between sessions or over food and/or drink.

At CppCon, I can ask Marshall Clow about specifics of how the standard library is implemented (why is a moved-from string cleared when it’s within the small buffer, and does it matter?), or I can chat with David Sankel about whether or not the currently-proposed coroutines are sufficiently powerful to represent certain mathematical constructs. I can ask Chandler Carruth about whether such-and-such inhibits RVO (he was noncommittal, but empirical evidence shows that RVO still works fine in that case, yay!). I can hash out new ideas with Louis Dionne and GaÅ¡per Ažman for removing current limitations I run into with lambdas. Or I can meet new friends like Stephanie Hurlburt, who’s doing exciting things with texture compression that could really make a difference to the games industry. The list of inspiring people and interactions is almost endless.

I’ve come away from CppCon energised, with tons of new things to try and to apply. Thanks to Jon, Bryce, and everyone else who made CppCon run smoothly, and see you next year!

Published
Categorized as C++

2 comments

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.