CppCon 2021 has ended
Back To Schedule
Monday, October 25 • 2:00pm - 3:00pm
I See Your AUTOSAR and Raise You “Constexpr Everything”. No Seriously, Everything. The Standard Library, Microkernel, Apps, and Unit Tests.

Log in to save this to your schedule, view media, leave feedback and see who's attending!

Feedback form is now closed.
This presentation will walk the audience through how we implemented an AUTOSAR compliant Hypervisor with all of it's code including the microkernel, apps and unit tests as a "constexpr" using C++20, all in open source. Are you worried about undefined behavior in your applications? Are you curious how far "constexpr everything" can be taken and how it benefits you, or what "constexpr everything" is? Do you work with AUTOSAR? Or are you curious how you would write a microkernel as a "constexpr"? If so, this presentation is for you.

The original goal of our project was to implement an AUTOSAR compliant hypervisor using a microkernel archeicture, designed specifically for US government and critical systems applications all in open source. The first problem we ran into was there were no, open source, AUTOSAR compliant implementations of the C++ standard library. There also were no static analysis tools in open source to verify AUTOSAR compliance. To solve this, we implemented our own AUTOSAR static analysis tool using Clang Tidy in open source as well as a portion of the C++ standard library (called the BSL) using C++20 to AUTOSAR specifications. Since C++20 was used, we decided to see just how far we could take the idea of "constexpr everything". To our surprise, we were able to implement everything as a "constexpr". The C++ code for the microkernel, the C++ code for the applications that run on top of this microkernel, and yes, all of the unit tests for everything with 100% code coverage. What this means is that our unit tests are executed at compile-time and they test everything from the page fault handler and ELF loader in the microkernel, to the tools that run on Windows or Linux. Not only does this ensure that undefined behavior is almost impossible for the entire project, it means that the compiler can verify both the syntax and the "logic" at compile time as the unit tests tell the compiler what the code is supposed to do.

"constexpr everything" will change the way you think about coding and C++. It's not just about performance and compile-time scripting. Its a way to tell the compiler what your application is supposed to do. Combined with Metaprogramming, the future of C++ in safety critical systems is boundless. This presentation will walk the audience through our experience of how we implemented everything as a "constexpr" and what the benefits of "constexpr everything" are to you and your projects from gaming and banking, to critical systems. This presentation will also cover how we overcame certain hurdles with "constexpr everything" in a real-world example, as well as how we implemented AUTOSAR compliance in open source. Think it's impossible to write a kernel as a "constexpr"? Be prepared to have some fun, learn some cool tricks and to have your mind blown!

ALL TALK SESSIONS CAN BE ACCESSED FROM THE MAIN LOBBY: https://cppcon.digital-medium.co.uk/

avatar for Rian Quinn

Rian Quinn

CTO, Assured Information Security, Inc.
Dr. Rian Quinn is a Senior Principal Investigator in the Trusted Information Systems Group at Assured Information Security, Inc. were he has focused on trusted computing and hypervisor related technologies for nearly 10 years. He holds a Ph.D. in Computer Engineering with specializations... Read More →

Monday October 25, 2021 2:00pm - 3:00pm MDT
  • Embedded, Hybrid