Articles & Books

A zero cost abstraction?--Josh Peterson

Safe and performant?

A zero cost abstraction?

by Josh Peterson

From the article:

Recently Joachim (CTO at Unity) has been talking about “performance by default”, the mantra that software should be as fast as possible from the outset. This is driving the pretty cool stuff many at Unity are doing around things like ECS, the C# job system, and Burst (find lots more about that here).

One question Joachim has asked internally of Unity developers is (I’m paraphrasing here): “What is the absolute lower bound of time this code could use?” This strikes me as a really useful way to think about performance. The question changes from “How fast is this?” to “How fast could this be?”. If the answers to those two questions are not the same, the next question is “Do we really need the additional overhead?”

Another way to think about this is to consider the zero-cost abstraction, a concept much discussed in the C++ and Rust communities. Programmers are always building abstractions, and those abstractions often lead to the difference between “how fast it is” and “how fast it could be”. We want to provide useful abstractions that don’t hurt performance...

San Diego Committee Meeting: A Trip Report--Corentin Jabot

Trip report.

San Diego Committee Meeting: A Trip Report

by Corentin Jabot

From the article:

As I left Rapperswil earlier this year, I said very firmly that I would not go to the San Diego Meeting.

Crossing an ocean to work on C++ 12 hours a day for a week is indeed madness.

And so naturally, I found myself in a San Diego hotel straight from the 60s, to do some C++ for a week. With the exception of the author of this blog, all people there are incredibly smart and energetic, and so a lot of great work was done...

Trip Report: Freestanding in San Diego--Ben Craig

One more report.

Trip Report: Freestanding in San Diego

by Ben Craig

From the article:

All three are dealing with "freestanding". I've been working for the last year or so trying to redefine freestanding in a way that would be useful to more people. I have personal experience using C++ in various operating system kernels / drivers, and a bit of experience working on micro controllers and digital signal processors, so that's where my papers focused. At the CppCon 2018 SG14 meeting, some GPU companies have said that my definitions are useful for their architectures (with some tweaks), and I've heard from several other people that my definitions are even useful in some environments where performance and determinism are key, even when there is an OS. I'm still trying to figure out if and how to incorporate all these groups into one thing that could get standardized.

I pitched "Freestanding Proposal" at my first WG21 meeting was November of 2017 in Albuquerque. I was an unknown then. San Diego was my third WG21 meeting. All the papers and interviews and trip reports have now made it where people were asking me about freestanding quite frequently. There were a few times I got stopped while walking around by someone I had never talked to before, and they knew who I was, and asked about freestanding. I found this very flattering. I'm thrilled (and terrified) that my work is getting such visibility...

The Amazing Performance of C++17 Parallel Algorithms, is it Possible?--Bartlomiej Filipek

Are you using it?

The Amazing Performance of C++17 Parallel Algorithms, is it Possible?

by Bartlomiej Filipek

From the article:

With the addition of Parallel Algorithms in C++17, you can now easily update your “computing” code to benefit from parallel execution. In the article, I’d like to examine one STL algorithm which naturally exposes the idea of independent computing. If your machine has 10-core CPU, can you always expect to get 10x speed up? Maybe more? Maybe less? Let’s play with this topic.

A beginner's look at smart pointers in modern C++

New (!) ways of memory management.

A beginner's look at smart pointers in modern C++

by Triangles @ Internal Pointers

From the article:

Pointers in C and C++ languages are wild beasts. They are extremely powerful, yet so dangerous: a little oversight may wreak havoc on your whole app. Smart pointers were born to fix such annoyances. They provide automatic memory management: when a smart pointer is no longer in use, that is when it goes out of scope, the memory it points to is deallocated automatically.

 

Trip report: Fall ISO C++ standards meeting (San Diego) -- Herb Sutter

Fresh from last week's standards meeting:

Trip report: Fall ISO C++ standards meeting (San Diego)

by Herb Sutter

From the article:

On Saturday November 10, the ISO C++ committee completed its fall meeting in San Diego, California, USA, hosted with thanks by Qualcomm. This was the biggest ISO C++ meeting in our 29-year history, with some 180 people at the meeting, representing 12 nations...

Because this is one of the last meetings for adding features to C++20, we gave priority to proposals that might make C++20, and we adopted a number of them for C++20...

2018 San Diego ISO C++ Committee Trip Report

The report is here!

2018 San Diego ISO C++ Committee Trip Report

From the article:

The ISO C++ Committee met in San Diego, California ���� last week to continue work on the next International Standard (IS), C++20. This meeting was the last meeting to consider new proposals for C++20, but existing proposals like modules (on track) and coroutines (questions remain) that are in flight but not merged can still make C++20. We’ll make our final decisions about major language features at the next meeting.

How to Retrieve the Firsts from a Collection of Pairs

Simple.

How to Retrieve the Firsts from a Collection of Pairs

by Jonathan Boccara

From the article:

When using the STL, there is a use case that pops up every now and then and that often causes more trouble than necessary: if we have a collection of pairs, like an std::vector of pairs, or simply a std::map, how can we retrieve the collection of the first elements of each item in the collection?

Exploring Clang Tooling Part 3: Rewriting Code with clang-tidy--Stephen Kelly

The series continue.

Exploring Clang Tooling Part 3: Rewriting Code with clang-tidy

by Stephen Kelly

From the article:

In the previous post in this series, we used clang-query to examine the Abstract Syntax Tree of a simple source code file. Using clang-query, we can prototype an AST Matcher which we can use in a clang-tidy check to refactor code in bulk.

This time, we will complete the rewriting of the source code...