Taking Static Type-Safety to the Next Level - Physical Units for Matrices - Daniel Withopf CppCon 22
---
Taking Static Type-Safety to the Next Level - Physical Units for Matrices - Daniel Withopf - CppCon 2022
If you are interested in achieving the ultimate goal in library interface design: “If it compiles, it works!“, this talk is for you!
There are several existing C libraries to annotate scalars with their physical units.
This talk will present a full-blown solution for a related problem that has not been solved in C before: How can we put distinct physical unit types (e. g. meters, seconds, meter per second...) inside a single vector or matrix type from a linear algebra library?
The presented solution uses C ’s strong type system to provide these physical unit annotations for each matrix element. Furthermore, it also enables coordinate frame and quantity kind annotations (think X- and Y-position in coordinate frame A or B which have identical units but refer to different things).
We will learn what is the best way to represent these annotations, how they propagate through linear algebra operations, how they determine the subset of valid operations on each type and of course and most importantly, how this can be implemented efficiently in C (with a special on how C 20 is a game-changer here).
While developing the solution, we will also understand how this leads to code that is more expressive and less likely to contain errors because the majority of bugs can be caught at compile-time.
Applications that benefit from this include robotics, computer graphics, automated driving and any other domain that works with physical units, different coordinate frames and matrix operations.
---
Daniel Withopf
Daniel Withopf has been working on solving real-world problems with C in robotics, computer vision and related fields for over 20 years. He is a Staff Software Engineer at the German car supplier Bosch where he wrote and maintains an object tracking framework for self-driving car projects. While doing that he discovered novel ways how to leverage C ’s type system to create linear algebra and tracking code that is more expressive, easier to understand and less likely to contain errors.
__
Videos Streamed & Edited by Digital Medium:
#cppcon #programming #type
3 views
1617
455
1 month ago 00:09:36 1
Веселый Отдых/relaxing vacation
1 month ago 04:00:02 2
[4 Hours] Harry Potter ASMR Ambience + Dialogue ◈ Study & Relax w/ the Characters ◈ Multiple Scenes
1 month ago 01:40:53 1
cs_deagle5 | Intelligent DnB / Jungle Mix
1 month ago 00:01:27 1
Starfish Walking on the Beach
1 month ago 00:12:54 1
SpaceX is FAST... Starship Booster 13 Static Fire Complete | SpaceX Boca Chica
1 month ago 00:03:17 1
SWITCHUP! - Haunted (feat. Ezra Henderson)
1 month ago 00:38:50 4
Get It Together, Intel: Core Ultra 9 285K CPU Review & Benchmarks vs. 7800X3D, 9950X, More
1 month ago 01:13:20 1
Hardcore Heaven Volume 5 (1999) - CD 2 (Scott Brown & Vinylgroover)