Objects? No Thanks!
summary
Claim: replace runtime virtual interfaces with static class templates to get C++ expressiveness without object overhead. Using GCC and small NXP LPC boards the blink example shows the macro C version is 16 bytes and 9 cycles the naive virtual C++ version grows to 68 bytes plus 12 bytes RAM and 65 cycles while the template approach compiles down to the same code as the macro version. The demo blinks an LED on real hardware and the templates produce zero RAM overhead.
AI-written summary · about
chapters (26)
- 0:00Start
- 0:18Micro-controllers are everywhere
- 1:17Some small micro-controllers
- 2:07Small microcontroller economics
- 3:14Small micro-controller programming
- 4:24Code re-use
- 5:36So why should C++ be used?
- 8:01Test case: blink a LED
- 8:16Blink a LED in C
- 10:26abstraction
- 12:13Metrics
- 12:50Generated code (C++00-style)
- 16:50Alternative: compile-time polymorphism
- 17:42Run-time polymorphism
- 19:51Blink: some (ugly?) details
- 22:44Four pin archetypes
- 23:54Type narrowing
- 28:15Pin invert template
- 29:06Some more pin & port decorators
- 31:00consequences (2)
- 33:26Long term view
- 36:36Next steps
- 38:01Devirtualization?
- 40:48C++ language issues
- 41:58C++ language wishlist
- 42:43Summary
related talks
06mLightning Talk: Cute Approach for Polymorphism in C++
20mSecrets of the DOM Virtual Machine
01h 03mSo, you want to use C++ Modules ...cross platform
01h 10mC++ Reflection Is Not Contemplation
04mCalling code w/o headers...
01h 01mAbstraction the true superpower of C++
49mApplied Modern C++: beyond type erasure and visitor pattern
01h 00mC++ Mythbusters
