As compiler and library testers, we often find ourselves between the demands of developers and those of the functional safety industry. On the one hand, compiler developers are constantly pushing to implement the latest and greatest that a programming language has to offer. On the other hand, the usage of the language in safety applications is much more restricted due to the requirements imposed by functional safety standards.

The speed and abstraction capabilities of C++ make it suitable for use in many domains. Various users require that the language evolves in different ways, and the C++ working group is responsible for being the sensible mediator between all parties. Their commitment to publish a new version of the C++ standard every three years keeps the language evolving while maintaining the benefits of standardization. Matt Godbolt’s online Compiler Explorer makes it possible to keep track of the current support of new features by different compiler versions because it has them all.

In safety applications, C++ is used carefully. Due to the restrictive nature of functional safety standards, much of the functionality offered by C++ is not appealing to developers of safety applications. When qualifying the C++ standard library for use in safety applications, we often see the highest demand for the headers that provide functionality that is close to the core of what the language has to offer over C, such as <initializer_list>, <utility>, and <type_traits>. On the other hand, we hardly ever see demand for I/O, exception handling, and the native C++ threading facilities. These features are difficult to use in a safety application, partly because they rely on external runtime or system libraries.

On the other side, developers of compilers and library implementations are very much interested in testing C++’s cutting-edge features. When developing tests for these features at Solid Sands, we also use Compiler Explorer. The tool offers us quick access to a wide selection of compilers, supporting various platforms and builds from the latest trunk branches. We asked Matt to tell us more about what he is excited about in modern C++.

Matt Godbolt:
For my part, working outside of the safety-critical world makes it a lot easier to adopt the latest features of C++. This highlights one of C++’s best features though – individual teams get to adopt the parts of the language that make sense for them, their comfort level with novelty, and the support levels in the compilers they have access to. The feature I’m finding I’m using the most at the moment is std::format – it’s refreshingly simple to use, compared to iostreams, and is very performant too. I can imagine it would be a tough feature for Solid Sands to qualify though!

 

Another new feature in C++, but one I haven’t yet had much experience with is coroutines. I’ve seen some great uses of it – for example Hana Dusíková’s co_curl library, which makes it trivial to download multiple web pages at once. It’s not a safety-critical type of feature, but I’m sure there are some co-operative multitasking use cases for coroutines that might make it a great fit for the safety-critical domain – so I imagine Solid Sands’ engineers will be taking a look soon!

And Matt is right! Regardless of whether you’re looking to verify the latest version of your compiler or your legacy library, Solid Sands is the one-stop shop to meet your needs.

Matt Godbolt, Creator of Compiler Explorer
Ivaylo Ivanov, Software Engineer at Solid Sands

“What a scary world your engineers live in!”


Subscribe to our monthly blog!