February 2020

C++ Packaging and Design Rules -- John Lakos

In this excerpt from Large-Scale C++ Volume I: Process and Architecture, John Lakos presents how to organize and package component-based software in a uniform (domain-independent) manner. This chapter also provides the fundamental C++ design rules that govern how to develop modular software hierarchically in terms of components, packages, and package groups.

C++ Packaging and Design Rules

by John Lakos 

From the article:

The way in which software is organized governs the degree to which we can leverage that software to solve current and new business problems quickly and effectively. By design, much of the code that we write for use by applications will reside in sharable libraries and not directly in any one application. Our goal, therefore, is to provide some top-level organizational structure that allows us to partition our software into discrete physical units so as to facilitate finding, understanding, and potentially reusing available software solutions.

HPX V1.4.1 released -- STE||AR Group

The STE||AR Group has released V1.4.1 of HPX -- A C++ Standard library for parallelism and concurrency.

HPX V1.4.1 Released

The newest version of HPX (V1.4.1) is now available for download! This is mostly a bug-fix release that fixes problems found in the previous HPX V1.4.0. Please see here for a full list of resolved issues.

    HPX is a general purpose parallel C++ runtime system for applications of any scale. It implements all of the related facilities as defined by the C++ Standard. As of this writing, HPX provides the only widely available open-source implementation of the new C++17 parallel algorithms. Additionally, HPX implements functionalities proposed as part of the ongoing C++ standardization process, such as large parts of the C++ Concurrency TS, Parallelism TS V2, data-parallel algorithms, executors, and many more. It also extends the existing C++ Standard APIs to the distributed case (e.g. compute clusters) and for heterogeneous systems (e.g. GPUs).

    HPX seamlessly enables a new Asynchronous C++ Standard Programming Model that tends to improve the parallel efficiency of our applications and helps reducing complexities usually associated with parellism and concurrency.

 

How I declare my class and why -- Howard Hinnant

An experience-based opinion piece from one of the masters of C++:

How I declare my classes and why

by Howard Hinnant

Howard is the lead designer and author of move semantics, and a longtime C++ committee member where he has served as chair of the Library Working Group and is a current member and recent chair of the Direction Group.

From the article:

When I'm reading a class declaration, the very first things I want to know are:

  • What resources does this class own?
  • Can the class be default constructed?
  • Can the class be copied or moved?
  • How can the class be constructed (other than by default, copy or move)?
  • What else can one do with the class?

Note that this is an ordered list...

Virtual, final and override in C++--Jonathan Boccara

3 keywords that go together.

Virtual, final and override in C++

by Jonathan Boccara

From the article:

C++11 added two keywords that allow to better express your intentions with what you want to do with virtual functions: override and final. They allow to express your intentions both to fellow humans reading your code as well as to the compiler.

However, as we will see, the intention of override is super useful, but the intention of final… is harder to understand.

Both apply to virtual functions, which are the member functions of a base class that can be overridden by the classes that derive (inherit) from it...

Bjarne Stroustrup on C++20's significance

The following are notes from Bjarne Stroustrup, regarding the completion of C++20 on Saturday and summarizing his comments to the committee in the room:

After the 79-0 vote deeming C++20 done on February 15, 2020 in Prague, I made a few comments to emphasize the significance of the event. I got to the lectern just after Herb Sutter had shown photos of the C++ standards committee members at the first meeting and the meetings that voted for the C++11, C++14, C++17, and C++20 standards. I was in all of those, so was Mike Miller from EDG and chair of the Core Working Group. We were the only ones in all photos. This is roughly what I said:

This is a historical event:

  • 30 years of C++ standardization.
  • 40 years of C++.
  • C++20 is the 6th standard, the 3rd major standard; by “major” I mean “changes the way people think.”
  • This is something like the 75th meeting; I have been at about 70 of those.

I’d like to add a personal note. For me, C++20 is special because it has essentially all from “The Design and Evolution” (1994). In particular, it has concepts, modules, and coroutines:

  • Concepts were not in D&E, but there were three pages of apologies for not having them. Then, neither I nor anyone else know how to design and implement them sufficiently well.
  • Modules were just a dream then, but they were specifically mentioned – I dreamed of a day where we could finally eliminate the preprocessor.
  • Coroutines were the  bread and butter for C++ during the first 10 years; they were missing in most other languages. I was sore having lost them to implementation problems on SPARC architecture.

In addition, we get improved concurrency and a library with ranges, dates, and span.

We (the C++ standards committee members) must be careful and responsible; we serve a huge community:

  • Serve the community at large, rather than just experts – “keep simple things simple.”
  • Be careful, the world changes; what seems essential or fashionable today may not be good in the longer term.
  • Be pragmatic, not doctrinaire; pragmatic and principled.

This has guided the development of C++ so far. No, that’s not easy. We must balance many concerns. I suggest we:

  • Pursue the goal of a completely resource-safe and type-safe C++.
  • Support a wide variety of hardware well.
  • Maintain C++’s record of stability (compatibility) – “stability is a feature” – as much as makes sense.

These aims have served C++ well throughout.

I wonder who’ll be here in 30 years? That’ll be 2050.

Thanks for listening. See you in Varna! (Varna is the location of the next ISO C++ Standards meeting).

Freestanding in Prague--Ben Craig

All you want to know.

Freestanding in Prague

by Ben Craig

From the article:

The C++ standards committee met in Prague, Czech Republic between Feb 10 and Feb 15. The standard is wording complete, and the only thing between here and getting it published is ISO process. As is typical for me at these meetings, I spent a lot of time doing freestanding things, Library Incubator (LEWGI) things, and minuting along the way (15-ish sessions/papers!)...

Move, simply--Herb Sutter

No need to get complicated.

Move, simply

by Herb Sutter

From the article:

C++ “move” semantics are simple, but they are still widely misunderstood. This post is an attempt to shed light on that situation...