by choeger · 4y ago · 0 comments
1. Polymorphism 2. Specialization of code and data structures
Both aspects only go well together with global compilation which basically enforces static linking, unless you either substantially improve the ABI or introduce some artificial language limits regarding composition.
Personally, I think that it should be possible to extend the C-ABI with some meaningful form of specialization: You effectively only need offsets and sizes in order to specialize code. But I don't have a prototype to explore this idea further.
Specialization eliminates nearly all overhead of polymorphism so there's no disincentive against using it.