June 2018

CppCon Early Bird deadline, and two plenary speakers announced

bjarne-s.jpgFrom the CppCon blog:

Early Bird Deadline | First Speaker Announcement

From the article:

We’ll be counting down the days with announcements of this year’s plenary speakers, including today’s plenary speaker announcement.

Next Friday, the last business day of Early Bird registration, we’ll share a special goodie...

Two of our most popular speakers, Bjarne Stroustrup and Herb Sutter, are confirmed speakers for CppCon 2018.

If you're not sure what CppCon is like, here's a sample attendee quote from a previous CppCon that came up randomly on the CppCon home page this morning:

"I guess it's a bit like going to a concert where pretty much all of your favorite bands play, except you can also have lunch with them, talk to them, ask them what their songs mean and let them listen to your own songs. And share your thoughts and ideas with hundreds of other people who all feel the same. This is the Woodstock of C++."

The CppCon Early Bird discounted ticket rate is available for one more week. Register here for CppCon 2018, Sep 23-29!

CppCast Episode 156: SG15 Tooling Group with Titus Winters

Episode 156 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Titus Winters from Google to discuss the SG15 Tooling Study Group and revisiting the concept of regular types.

CppCast Episode 156: SG15 Tooling Group with Titus Winters

by Rob Irving and Jason Turner

About the interviewee:

Titus Winters has spent the past 7 years working on Google's core C++ libraries. He's particularly interested in issues of large scale software engineer and codebase maintenance: how do we keep a codebase of over 100M lines of code consistent and flexible for the next decade? Along the way he has helped Google teams pioneer techniques to perform automated code transformations on a massive scale, and helps maintain the Google C++ Style Guide.

CppCon 2017: A modern formatting library for C++--Victor Zverovich

Have you registered for CppCon 2018 in September? 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 2017 for you to enjoy. Here is today’s feature:

A modern formatting library for C++

by Victor Zverovich

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Come learn about the intricacies of C++ formatting, from stdio to iostream to the new standard proposal P0645R0: Text Formatting. The new proposal combines variadic templates with a Python-like format string syntax and is designed for performance, extensibility, and safety. It is based on the popular fmt library that has been successfully used in numerous projects in such diverse areas as gaming, mathematical optimization, autonomous vehicles, databases, logging libraries and more.

The surprisingly high cost of static-lifetime constructors--Arthur O’Dwyer

Today we look at compile time performance.

The surprisingly high cost of static-lifetime constructors

by Arthur O’Dwyer

From the article:

I was looking at HyperRogue again this week (see my previous post). It has a really nice localization framework: every message in the game can be translated just by adding a lookup entry to a single file (like, for the Czech translation, you add entries to language-cz.cpp); and then during the build process, all the language-??.cpp files are collated together and used to produce a single language-data.cpp file with a lookup table from each English message to the same message in every other language. (Seeing all the messages at once allows us to report on how “complete” each translation is, relative to the others.)...

 

The Tightly-constrained Design Space of Convenient Syntaxes For Generic Programming --Corentin Jabot

An exploration of the various convenient syntaxes for declaring templates and function templates as proposed C++20:

The tightly-constrained design space of convenient syntaxes for generic programming

by Corentin Jabot

About the article:

Did you know that the Concept TS was merged into the Working Draft in July 2017, in Toronto? And we are a Planck length away from merging the Range TS in C++20 as well, including a few goodies such as projections, contiguous ranges/iterators and ranges adaptors? We also added a bunch of general-purpose concepts in the std namespace in Rapperswil.

Concepts have been 3 decades in the making and the Ranges TS is a huge body of work. Yet, I feel like a lot of people are unaware of these great features that are coming to a compiler near them.

CppCon 2017: Objects, Lifetimes, and References, oh my...--Nicole Mazzuca

Have you registered for CppCon 2018 in September? 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 2017 for you to enjoy. Here is today’s feature:

Objects, Lifetimes, and References, oh my...

by Nicole Mazzuca

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

How does the C++ abstract machine really work at the lowest levels? Why does the committee design its rules the way they do? Gain insight into the object model of C++, from references to passing semantics to copy elision. C++ is a complicated language full of arcane rules and complicated tangents - learn how it's all tied together in this basic model of locations, objects, and values.

Examples of Parallel Algorithms From C++17--Bartlomiej Filipek

Do you know them?

Examples of Parallel Algorithms From C++17

by Bartlomiej Filipek

From the article:

MSVC (VS 2017 15.7, end of June 2018) is as far as I know the only major compiler/STL implementation that has parallel algorithms. Not everything is done, but you can use a lot of algorithms and apply std::execution::par on them!

Have a look at few examples I managed to run...

Modern C++ for C programmers -- bert hubert

In 2018, C++ is a modern programming language that C programmers may want to take another look at, especially if they are pondering shifting to Go or Rust.

Modern C++ for C programmers part 1

Modern C++ for C programmers part 2

by Bert Hubert

From the article:

In this and subsequent posts, I hope to convince C programmers to give ‘2017 era C++’ (which is entirely unlike 2003 C++) another good look. To do so, I want to show that within C++ hides a simple language that still offers you many good things without immediately requiring you to tackle all 1400 pages of ‘The C++ Programming Language’. In other words, I claim there is great benefit already when only using a judicious selection of the best parts of C++.

My goal is that when you go look for a new language to learn (say, Go or Rust), you will hopefully consider modern C++ as well

 

Botond Ballo's Rapperswil trip report

A summary of what happened at the recent Rapperswil C++ standards meeting, with a focus on the Evolution Working Group.

Trip Report: C++ Standards Meeting in Rapperswil, June 2018

by Botond Ballo

From the article:

A couple of weeks ago I attended a meeting of the ISO C++ Standards Committee (also known as WG21) in Rapperswil, Switzerland. This was the second committee meeting in 2018; you can find my reports on preceding meetings here (March 2018, Jacksonville) and here (November 2017, Albuquerque), and earlier ones linked from those. These reports, particularly the Jacksonville one, provide useful context for this post.

At this meeting, the committee was focused full-steam on C++20, including advancing several significant features — such as Ranges, Modules, Coroutines, and Executors — for possible inclusion in C++20, ...

CppCon 2017: Runtime Polymorphism: Back to the Basics--Louis Dionne

Have you registered for CppCon 2018 in September? 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 2017 for you to enjoy. Here is today’s feature:

Runtime Polymorphism: Back to the Basics

by Louis Dionne

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

C++ solves the problem of runtime polymorphism in a very specific way. It does so through inheritance, by having all classes that will be used polymorphically inherit from the same base class, and then using a table of function pointers (the virtual table) to perform dynamic dispatch when a method is called. Polymorphic objects are then accessed through pointers to their base class, which encourages storing objects on the heap and accessing them via pointers. This is both inconvenient and inefficient when compared to traditional value semantics. As Sean Parent said: Inheritance is the base class of evil.

It turns out that this is only one of many possible designs, each of which has different tradeoffs and characteristics. This talk will explore the design space for runtime polymorphism in C++, and in particular will introduce a policy-based approach to solving the problem. We will see how this approach enables runtime polymorphism with stack-allocated storage, heap-allocated storage, shared storage, no storage at all (reference semantics), and more. We will also see how we can get fine-grained control over the dispatch mechanism to beat the performance of classic virtual tables in some cases. The examples will be based on a real implementation in the Dyno library [1], but the principles are independent from the library.

At the end of the talk, the audience will walk out with a clear understanding of the different ways of implementing runtime polymorphism, their tradeoffs, and with guidelines on when to use one implementation or another.