“Open is Good - yomm2: Fast, Orthogonal Open Methods”
summary
Library yomm2 implements open multi-methods as free functions that add polymorphic behavior to existing class hierarchies without modifying them, supporting multiple dispatch, multiple and virtual inheritance, and ordinary overloads. It requires registering the involved types and calling an initialization step; private members are not accessible by default. Benchmarks show single-argument open-method calls run about 16–20% slower than compiler virtual calls while using dispatch tables and integer indexes, and the implementation is available on GitHub as yomm2.
AI-written summary · about
chapters (12)
- 0:00Intro
- 0:17Case study
- 3:50Visitor
- 4:50Function Table
- 6:26Expression Problem
- 8:05Open Methods
- 8:38Library
- 11:34Value
- 12:41Multiple Dispatch
- 15:16Calling Open Methods
- 21:27Questions Comments
- 29:53Performance
related talks
55mHow to "OO" in C++
49mPolymorphism != Virtual: Easy, Flexible Runtime Polymorphism Without Inheritance
01h 35mRuntime Polymorphism: Back to the Basics
01h 08mRuntime Polymorphism: Back to the Basics
01h 02mFree Your Functions!
01h 00mDynamic Polymorphism with Metaclasses and Code Injection
01h 16mPolymorphism, Cohesion, and Coupling in C++
33mPrototypes: Object-Orientation, Functionally
