Events

CppCon 2023 Getting Build Tools to Talk to Each Other: Lessons Learned -- Diego Rodriguez-Losada

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

A Common Package Specification: Getting Build Tools to Talk to Each Other: Lessons Learned From Making Thousands of Binaries Consumable by Any Build System

Tuesday, October 3 • 16:45 - 17:45

by Diego Rodriguez-Losada

Summary of the talk:

There is a lot of previous work and proposals for a “Common Package Specification”, but there has been little implementation experience with real-world production usage at scale with feedback from diverse groups, something critical for such a specification to be technically viable. Some mechanisms like CMake exported targets/config files are becoming more popular with the continuous adoption of CMake, and pkg-config (.pc) files are also a popular mechanism in GNU systems, but those are still tool-specific and it is still not possible nowadays to consume pre-built binaries in a generic way by every build system.

Since the Conan C++ package manager was released 7 years ago, one of its main design goals was to be tool agnostic and let any package created with any build system to be usable by any other build system. This talk will describe the abstraction that has been and is widely used by +1500 open source Conan packages covering the vast majority of popular C and C++ open source libraries, and thousands of teams using it in production for their own private packages. Based on this experience and the lessons learned, the talk will describe how a “Common Package Specification” should look like:

- Representation of the different folders necessary to define a package: include directories, library directories, binary directories, build files directories, etc.
- How paths should be relative so binary redistribution and re-usage in other machines is possible.
- Representation of the different preprocessor definitions, compiler flags, sysroot.
- Representation of “components”, when a package contains more than one library that can be optionally created, optionally consumed, and includes relationships between components.
- Representation of custom build-system “properties”, that allows to customize some behaviors for specific build systems.
- Achieving scalability by decoupling the binary requirements from the consuming specification (this talk focus only on the second one)

While this basic “Common Package Specification” can be easily represented and serialized in a file, like json or yaml that travels together with the package, there are some implementations challenges that will be discussed:

- How such a generic package specification maps to the existing popular build systems, including CMake, MSBuild, Autotools, Meson, etc, and how this mapping can be leveraged for faster adoption.
- In some cases, the same binary can provide different information to consumers like different preprocessor directives, based on some user configuration. How could this problem be solved with the typical declarative syntax of formats like json or yaml?
- How the packages and the “Common Package Specification” files are found and used by the build system?
- Is it possible to “consume” a package while it is still under development, so it doesn’t have the artifacts to consume in typical “include”, “lib” folders, but in a developer “source” layout?
- What happens at runtime? Beyond the common PATH, LD_LIBRARY_PATH, etc, some packages need to have defined some environment variables to correctly work. Can this information be included in the “Common Package Specification” too?
- Common operations over specification files, like aggregation of components or merging (in the right order, following the topological order of the graph), necessary for build-systems like autotools or NMake.


This talk will summarize years of real world experience contributing towards the goal of having a “Common Package Specification” for C and C++, that will allow full interoperability between build systems and package managers, one of the most desired and demanded functionalities in the C++ tooling ecosystem.

CppCon 2023 Taro: Task-graph-based Asynchronous Programming Using C++ Coroutines -- Dian-Lun Lin

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

Taro: Task-graph-based Asynchronous Programming Using C++ Coroutines

Tuesday, October 3 • 16:45 - 17:45

by Dian-Lun Lin

Summary of the talk:

Task graph computing system (TGCS) plays an essential role in high-performance computing. Unlike loop-based models, TGCSs encapsulate function calls and their dependencies in a top-down task graph to implement irregular parallel decomposition strategies that scale to large numbers of processors, including manycore central processing units (CPUs) and graphics processing units (GPUs). As a result, recent years have seen a great deal amount of TGCS research, just name a few: Taskflow, oneTBB, Kokkos-DAG, and HPX. However, one common challenge faced by TGCSs is the issue of synchronization within each task. For instance, in scenarios where a task involves executing GPU operations, a CPU thread typically needs to wait until the GPU completes the operations before proceeding further. This synchronization overhead can hinder performance and limit the overall scalability of TGCSs.

The introduction of C++ coroutines in C++20 has revolutionized asynchronous programming, offering improved concurrency and expressiveness. However, integrating TGCS with C++ coroutines presents several challenges. Firstly, existing TGCS solutions are not compatible with C++ coroutines, as the coroutine paradigm deviates from traditional C++ programming. This incompatibility makes it difficult to seamlessly incorporate coroutines into existing TGCS frameworks. Secondly, C++ coroutine programming is extremely difficult and requires a solid understanding of the underlying concepts and mechanisms. The introduction of a new paradigm adds complexity and a steep learning curve for developers. Lastly, while C++ coroutines offer a powerful mechanism for managing asynchronous operations, designing and implementing an efficient scheduler to leverage their capabilities remains challenging. To fully exploit the benefits of C++ coroutines, there is a need for a specialized scheduler that can handle large numbers of coroutines and make optimal use of hardware resources.

To address these challenges, we present Taro: Task-Graph-Based Asynchronous Programming using C++ Coroutine. Taro offers a task-graph-based programming model for C++ coroutines, simplifying the expression of complex control flows and reducing development complexity. Additionally, Taro incorporates an efficient work-stealing scheduling algorithm tailored for C++ coroutines, minimizing unnecessary context switches, CPU migrations, and cache misses.

In this session, I will introduce Taro's programming model and demonstrate how Taro can enable efficient multitasking between CPU and GPU tasks, avoiding blocking wait on CPU threads for GPU tasks to finish. I will show the example code for using Taro. Finally, I will demonstrate how our solution can improve the performance of a real-world RTL simulation workload and microbenchmarks. Taro will be open-source and available on GitHub.

CppCon 2023 BehaviorTree.CPP: Task Planning for Robots and Virtual Agents -- Davide Faconti

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

BehaviorTree.CPP: Task Planning for Robots and Virtual Agents

Tuesday, October 3 • 16:45 - 17:45

by Davide Faconti

Summary of the talk:

In this presentation, we will introduce BehaviorTree.CPP, a library that is becoming increasingly popular in robotics and used to implement Task Planning.
Behavior Trees are an alternative to Hierarchical Finite State Machines; this approach was originally used in the game industry.

In the first part of this presentation, we will teach what a Behavior Tree are and their advantages, when compared with Finite State Machines; we will also focus on the exclusive features that this library has, when compared to other open source alternatives.

In the second part, we will dive into the technical details of the implementation, in particular how we use design patterns such as Factory, Observer, Safe Type Erasure, Concurrency and even a custom embedded scripting language.

CppCon 2023 More Ranges Please -- Roi Barkan

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

More Ranges Please

Tuesday, October 3 • 16:45 - 17:45

by Roi Barkan

Summary of the talk:

Ranges are one of the major additions of C++20, in which our main abstraction for sequences shifted from iterator-pairs into full fledged concepts, allowing better composability, expressibility and safety when working with bounded and even unbounded one dimensional sequences of data. The fluent use of the pipe-operator gave us power to write complex functional-style algorithms which are both highly readable and perfomant. The ranges library, especially with some recent C++23 additions also better exposes us to the notion of 'range-of-ranges' and multi-dimentional spans, which weren't in focus of the STL in prior versions of the language.

One key feature of the STL since the last century was the large number of algorithms and building blocks which seemed woven together and gave us a vocabulary by which algorithms could be expressed with little need to work with raw loops.

Together with the introduction of ranges, the STL has also gained various range-based algorithms (as well as views and adapters), yet most of those algorithms were basic adaptations of the ones that are available in the iterator-pair model.

In a talk from 2002, the primary designer of STL described the process of gathering, currating and solidifying the algorithms in the STL circa 1998 (Stepanov: STL and its Design Principles). My talk aims to apply a similar process to the universe of C++20/C++23 ranges, and propose potential additions to our vocabulary when developing range-based algorithms.

In this talk, we will start with a relatively theoretical introduction of the values and merrits of writing software systems as libraries, and get an introduction to the ranges library as an example of a breakthrough library.
Then, we will go over a variety of algorithms which currently don't exist for ranges, describe their potential value, and discuss whether they can or should be added to the standard.

A few examples of algorithms which will be covered:

Algorithms for sorted ranges, such as take_between and histogram, ...
Algorithm for ranges-of-(sorted-)ranges, such as merge, set_union, set_intersection, ...
Algorithms which might require some helper data structures, such as histogram (for non sorted ranges)
Algorithms related to generation and processing of permutations, such as order.
As we go through the various examples, we'll discuss what might be good candidates for addition to the STL (and reference prior talks on the topic), the notion of sorted ranges, and hopefully leave the talk with a good desire to compose algorithms in the brave new world of ranges

CppCon 2023 Visual Studio: Make Debugger, Diagnostics Improvements, Video Games, & More -- Li/Girmay

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

What's New in Visual Studio: CMake Debugger, Diagnostics Improvements, Video Games, and More

Tuesday, October 3 • 15:15 - 16:15

by David Li and Mryam Girmay

Summary of the talk:

Another year of CppCon, another year of work on making Visual Studio a better IDE for everyone, no matter what platform you're targeting.

In this talk, we'll demonstrate the last year's work across the IDE, toolchain, vcpkg, and GitHub: leak sanitizer and advanced address sanitizer support for finding security holes, a host of tools for Unreal Engine, the new CMake Debugger, step-by-step macro expansion, and more. Catch up on improvements for highlights from previous years, such as Build Insights integration in Visual Studio and new tools for understanding complex template compilation errors

Come along to learn all about the latest in our tooling, and to get a peek into our future plans.

CppCon 2023 std::linalg: Linear Algebra Coming to Standard C++ -- Mark Hoemmen

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

std::linalg: Linear Algebra Coming to Standard C++

Tuesday, October 3 • 15:15 - 16:15

by Mark Hoemmen

Summary of the talk:

Many fields depend on linear algebra computations, which include matrix-matrix and matrix-vector multiplies, triangular solves, dot products, and norms. It's hard to implement these fast and accurately for all kinds of number types and data layouts. Wouldn't it be nice if C++ had a built-in library for doing that? Wouldn't it be even nicer if this library used C++ idioms instead of what developers have to do now, which is write nonportable, unsafe, verbose code for calling into an optimized Fortran or C library?

The std::linalg library does just that. It uses the new C++23 feature mdspan to represent matrices and vectors. The library builds on the long history and solid theoretical foundation of the BLAS (Basic Linear Algebra Subroutines), a standard C and Fortran interface with many optimized implementations. The C++ Standard Committee is currently reviewing std::linalg for C++26. The library already has two implementations that work with C++17 or newer compilers, and can take advantage of vendor-specific optimizations. Developers will see how std::linalg can make their C++ safer and more concise without sacrificing performance for use cases that existing BLAS libraries already optimize, while opening up new use cases and potential optimizations.

CppCon 2023 Leveraging a Functional Approach for More Testable and Maintainable ROS 2 -- Bilal Gill

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

Leveraging a Functional Approach for More Testable and Maintainable ROS 2 Code

Tuesday, October 3 • 15:15 - 16:15

by Bilal Gill

Summary of the talk:

In the field of robotics, Robot Operating System (ROS) is the de facto middleware of choice across academia and industry. As most code examples in ROS utilize an object-oriented approach, challenges can arise when writing tests for production code due to the boilerplate code ROS introduces, often leading to unexpected bugs or flaky tests. This talk explores ways to mitigate those issues by using a functional approach. By adopting this approach, we can minimize the impact that ROS or other middleware has on your code, preventing it from becoming tightly coupled and brittle.

Attendees can expect an overview of ROS 2 and the conventional programming approach typically associated with it. We'll delve into how tests are usually constructed and pinpoint potential sources of bugs and flakiness. Following this, we will introduce a functional approach to writing test code. By the end of this talk, attendees will learn an alternative method of architecting their ROS 2 code and also understand how this approach can lead to more robust, maintainable, and testable code.

CppCon 2023 The Au Library: Handling Physical Units Safely, Quickly, and Broadly -- Chip Hogg

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

The Au Library: Handling Physical Units Safely, Quickly, and Broadly

Tuesday, October 3 • 14:00 - 15:00

by Chip Hogg

Summary of the talk:

We present Au: a new open-source C++ units library, by Aurora.  If you've rejected other units libraries because they couldn't meet your needs, check out Au (pronounced, "ay yoo").  It combines cutting-edge developer experience (fast compilation, simple and readable compiler errors) with wide accessibility (C++14 compatibility, single-header delivery option).  You can be up and running with Au in your project --- in any build system --- in less time than it takes to read this abstract!

We'll orient the viewer by providing a decision framework for choosing a units library, and using this framework to compare several leading options. We'll also see how these libraries influence each other. For example, Au has several compelling features inspired by other libraries, such as the concise and readable compiler errors of mp-units, and the frictionless single-header delivery of the nholthaus library --- in fact, Au is the first library to provide both these features at once. Au has also provided many new features of its own, including: fully unit-safe APIs; an adaptive "overflow safety surface" that governs unit conversions; on-the-fly composition for units and prefixes; smart, unit-aware rounding and inverse functions; and more.

Finally, Au has a notably low barrier to migration --- in either direction.  We'll explain how to set up a correspondence between Au and any other units library.  Even though neither library knows about the other, you'll be able to pass Au-typed variables to APIs which take the other library's types, and vice versa.  This doesn't just make it easy to switch to Au; it promises a smooth upgrade path to any better library which comes along later (such as a future C++ standard units library).  With such a low barrier to entry, give Au a try, and find out what it feels like to get effortlessly correct handling for all your physical quantities!

CppCon 2023 Back to Basics: Iterators -- Nicolai Josuttis

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

Back to Basics: Iterators

Tuesday, October 3 • 14:00 - 15:00

by Nicolai Josuttis

Summary of the talk:

One key success factor of C++ was the introduction of the Standard Template Library (STL) bringing together containers/ranges and algorithms using iterators as glue API to iterate over elements of collections.

This talk will present the basics of the design of iterators, the various consequences, remarkable corner cases, and what this means when using ranges and views as introduced with C++20.

CppCon 2023 "Distributed Ranges": A Model for Building Distributed Data ... -- Benjamin Brock

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

"Distributed Ranges": A Model for Building Distributed Data Structures, Algorithms, and Views

Monday, October 2 • 16:45 - 17:45

by Benjamin Brock

Summary of the talk:

Writing programs that run on clusters of computers is notoriously difficult. Distributed data structures can simplify this problem by automatically splitting up data across multiple memory spaces or nodes in a distributed memory program. Algorithms in most distributed data structures libraries, however, are not generic, but operate only on a specific data structure. In this work, we discuss how modern C++ features like concepts, customization points, and the ranges library can be used to support generic algorithms and views that can interoperate with multiple distributed data structures. We first discuss background in distributed computing and distributed data structures, including common techniques used to create high-level distributed data structures. We then show how customization point objects and concepts can be used to allow the implementation of generic algorithms that can be used with any distributed data structure as long as it fulfills a "distributed range" concept. We then show how to implement views that satisfy this concept, allowing algorithms to operate on lazily evaluated views of distributed data structures. Finally, we discuss two implementations of this model, for multi-GPU and multi-node programs, as well as performance considerations when running on state-of-the-art HPC systems.