News

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.

Standard C++ Foundation Annual Report for Fiscal Year 2023

FY2023 Annual Report – Standard C++ Foundation

(fiscal year ending 2023-06-30)

 

Highlights

This fiscal year FY2023 from 2022-07-01 to 2023-06-30 was our third full year since the start of the pandemic, and the first year really recovering from the pandemic's effects. Although most of the Foundation’s work is done virtually, the pandemic did affect some of our prominent operations, including that CppCon 2021 and 2022 were held, but were hybrid for the first time. Planning is now well underway for Cpp 2023 which will fall into the next fiscal year, and will be back to onsite-only again for the first time since before the pandemic.

As in every recent year, the majority of funds received and spent in FY2023 were from running CppCon, which still had large expenses even though it was hybrid with mostly-online attendees in FY2022 and FY2023.

ETA: As we came out of the pandemic, per our financial assistance policy the Foundation resumed spending on supporting in-person ISO C++ standardization. In FY2022, the ISO C++ committee (WG21) resumed holding in-person meetings, with online Zoom participation; the Standard C++ Foundation paid in whole or in part for hosting three of the first four post-pandemic WG21 meetings, two of which fell into FY2023 and one of which will fall into FY2024 but was paid for in part in FY2023. The Foundation also provided financial travel assistance to four expert participants whose ISO C++ proposals had been encouraged by WG21 but who would not otherwise have been able to attend to progress their proposals. — Thank you very much once again to the Foundation's members and all the CppCon attendees and sponsors! Your support directly enables the Foundation to be able to pay for these ISO meetings and support ISO participants from around the world.

CppCon

Every year, the Foundation runs the CppCon conference, which is currently the largest C++ conference in the world. Since its inception in 2014, a goal for CppCon has been to help raise the bar for all C++ sister conferences. In our inaugural conference in 2014, we were the first C++ conference we know of to professionally record all talks and panels using a paid film crew, and make the videos available for free to everyone in the world; since then, several other conferences have followed suit, including that some have used the same video production company CppCon uses (Bash Films, which we can highly recommend). In each year since, we have continued to strive to add features, most recently professional in-room live captioning in 2019.

CppCon 2022 was held in September 2022. As with CppCon 2021, it was again a hybrid conference. This was essential because, although international governmental travel bans were mostly lifted, many companies still had travel restrictions in place due to Covid and/or the economic slowdown, and many attendees still were unable or reluctant to travel for understandable health reasons. Even so, CppCon 2022 squeaked out a new record in total attendance, with a much larger percentage of attendees returning on-site… for the first time since 2019, the exhibitor hall often felt crowded and the on-site experience felt like a normal bustling conference again!

CppCon 2023 is being held later than usual this year, and planning is still underway. The talk submissions came in right at the end of FY2022, so we do know it has the second-highest number of talk submissions ever (second only to pre-pandemic 2019). So far, we know it will be even busier on-site than last year with more attendees, volunteers, and exhibitors than last year. We thank all our sponsors, exhibitors, volunteers, and attendees, and we look forward to seeing all of them in person at our first all-in-person event since 2019.

cppcon-stats-2022.png

The professionally recorded C++ videos are made available worldwide at no charge on the CppCon YouTube channel. Here are some basic channel statistics:

  • combined viewership: 25.4 million views
  • total watch time: 4.9 million hours
  • channel subscribers: over 134,000

Next report

Our next annual report will cover the fiscal year from 2023-07-01 to 2024-06-30. Besides being published here, the annual report will also be given as usual as a live presentation at our annual Foundation members meeting which is held during the week of the autumn WG21 meeting.

About the Standard C++ Foundation

The Standard C++ Foundation (Standard CPP Foundation in some databases that don’t support + in names) is a Washington 501(c)(6) not-for-profit organization whose purpose is to support the C++ software developer community and promote the understanding and use of modern Standard C++ on all compilers and platforms. We do this by operating and funding isocpp.org, the github.com/isocpp and github.com/cplusplus repositories, the CppCon conference including CppCon.org and the CppCon YouTube channel, and providing financial assistance support for WG21 (ISO C++ committee) standards meetings for meeting hosting costs, travel assistance for attendees in financial need, and grants to progress WG21 proposals that have been encouraged but whose the authors cannot progress further without some financial assistance and that the WG21 major subgroup chairs have approved funding.

###

The “Standard C++ Foundation” name and stylized “C++” logo are trademarks of the Standard C++ Foundation. See isocpp.org/home/terms-of-use.

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.

CppCon 2023 Expressing Implementation Sameness and Similarity in Modern C++ -- Daisy Hollman

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!

Expressing Implementation Sameness and Similarity in Modern C++ 

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

by Daisy Hollman

Summary of the talk:

Polymorphism is among the most widely discussed introductory topics in software engineering. Often couched in a vague context of code reuse, much of this introductory focus nonetheless revolves around interface similarity. More advanced discussions of code reuse in software engineering typically revolve around general topics like the maintainability cost of code coupling, but usually avoid discussing the merits of advanced language-specific mechanisms for code reuse. Furthermore, very little is made of the information loss and cognitive load associated with poor expression of sameness in implementation, regardless of interface coupling concerns.

In this talk, we will examine the wide spectrum of tools for expressing “sameness” in modern C++. Beyond introductory “is-a” inheritance and runtime polymorphism, we will delve into templates, concepts, mixins, CRTP, C++23’s “deducing this,” and a number of more advanced techniques on the spectrum from generic programming to template metaprogramming. We will explore the long-term software engineering costs and benefits of each of these mechanisms. In each case, we will discuss important trade-offs, such as runtime and compile-time overhead, mechanistic complexity versus “sameness” information loss, code coupling, maintainability, and the ability to adapt to evolving implementation needs over time. Finally, we will discuss mechanisms for expressing “sameness” that are difficult or impossible in modern C++—such as dependency injection and aspect-oriented programming—but that are commonplace in other languages. We will delve into both the minimal and ideal language features that would enable these paradigms to become a part of the C++ toolbox, and we will discuss the outlook for the inclusion of such features in future versions of standard C++.

C++ Exceptions and Memory Allocation Failure -- Wu Yongwei

logo.pngMemory allocation failures can happen. Wu Yongwei investigates when they happen and suggests a strategy to deal with them.

C++ Exceptions and Memory Allocation Failure

By Wu Yongwei

From the article:

C++ exceptions are habitually disabled in many software projects. A related issue is that these projects also encourage the use of new (nothrow) instead of the more common new, as the latter may throw an exception. This choice is kind of self-deceptive, as people don’t usually disable completely all mechanisms that potentially throw exceptions, such as standard library containers and string. In fact, every time we initialize or modify a stringvector, or map, we may be allocating memory on the heap. If we think that new will end in an exception (and therefore choose to use new (nothrow)), exceptions may also occur when using these mechanisms. In a program that has disabled exceptions, the result will inevitably be a program crash.

However, it seems that the crashes I described are unlikely to occur… When was the last time you saw a memory allocation failure? Before I tested to check this issue, the last time I saw a memory allocation failure was when there was a memory corruption in the program: there was still plenty of memory in the system, but the memory manager of the program could no longer work reliably. In this case, there was already undefined behaviour, and checking for memory allocation failure ceased to make sense. A crash of the program was inevitable, and and it was a good thing if the crash occurred earlier, whether due to an uncaught exception, a null pointer dereference, or something else.

Now the question is: If there is no undefined behaviour in the program, will memory allocation ever fail? This seems worth exploring.

CppCon 2023 Open Content: C++ Conversation: Object Lifetime -- Jason Turner

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!

Open Content: C++ Conversation: Object Lifetime

Monday, October 2 • 12:30 - 13:30

by Jason Turner

Summary of the talk:

Want to learn more about C++ in a highly interactive way?

We will have a lunchtime group conversation about C++ Object Lifetime. We will discuss the types of Object Lifetime that exist in C++, and go through some fun puzzle-like exercises together.

Expect a casual, relaxed, fun, interactive setting to spend your lunch time!

CppCon 2023 Back to Basics: Debugging -- Greg Law

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: Debugging

Monday, October 2 • 11:00 - 12:00

by Greg Law

Summary of the talk:

Everyone knows that debugging is twice as hard as writing a program in the first place. Fortunately, there is more help available than you might have thought. GDB is much more powerful than most people realize; Valgrind and Address Sanitizer can catch many common bugs before they wreak havoc; time-travel debugging can turn even the most intractable nightmarish bugs into pussycats. This fast-paced talk is light on slides and heavy on demos to show you what's available and how to use it. Familiarity with the tools available to you is an essential part of being a great programmer; you will leave this talk at least one step closer to programming zen.