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
3 months ago 00:06:33 1
Крик души Отзовитесь
3 months ago 00:07:25 1
Спасите Лохматые Души/Save the Shaggy Souls
3 months ago 00:08:37 1
РАК грозит всему живому/Cancer threatens all living things
3 months ago 00:03:32 3
Petey Pablo - Need For Speed (Need For Speed Underground OST) [HQ]
3 months ago 00:02:52 2
Static-X- The Only
3 months ago 00:08:51 1
Пока он спит/While he’s sleeping.
3 months ago 00:09:28 1
Три Ягодки! Спасите!/Three Berries! Help!
3 months ago 00:07:43 1
Наша Безответственность Их Боль/Our Irresponsibility Their Pain!
3 months ago 00:44:41 1
Kuraj-Bambey - Tech House Mix @singomakers HQ January 2024
3 months ago 00:05:25 6
Driven Pheasant and Partridge Shooting at Belvoir Castle
3 months ago 00:10:54 1
Они у нас НЕ рождаются/They’re not born to us.
3 months ago 00:15:50 1
Зверьё МЫ а не они/The beast is us, not them.
3 months ago 00:17:06 1
Пусть они лучше не родятся/I’d rather they weren’t born
4 months ago 00:09:59 1
Будьте людьми
4 months ago 00:08:41 1
Ответ на фразу Хватит Хапать/The answer to the phrase Stop Hoarding
4 months ago 00:09:06 1
ЭТО ВСЁ для 3000 собак/This is all for 3,000 dogs
4 months ago 10:59:13 1
Liquid Ink Abstract Multi Color - 11 Hours - 4K - OLED Safe
4 months ago 11:28:01 1
Abstract Color Mix Screensaver - 11 Hours - 4K - OLED Safe - No Burn-in
4 months ago 00:02:56 1
Static-X - The Only (Official Music Video) | Warner Vault
4 months ago 00:03:13 1
Ollie - Here Now (Lyrics)
4 months ago 00:06:54 1
Спасибо за ЖИЗНЬ/Thank you for LIFE
4 months ago 01:00:04 1
[ 432 Hz ] 1 HOUR LOOP Ark Patrol - Let Go (slowed instrumental)
4 months ago 00:02:59 1
Static-X - The Only (Space Marine AI Cover)
4 months ago 00:08:31 1
Дети Искалеченные Живодерами/Children Mutilated by Monsters