5 ms·
None. It's code organizational syntactic sugar and abstraction that incurs a runtime penalty (vtables). Go ditched OO for similar reasons. Haskell, Erlang, an
by sacnoradhq 4y ago
None. It's code organizational syntactic sugar and abstraction that incurs a runtime penalty (vtables).
Go ditched OO for similar reasons.
Haskell, Erlang, and more get along fine without OO.
(OO crested with Smalltalk, Java, Ruby, Python, and JS (more prototypal though). Let's not talk about C++98)
- metaltyphoon 4y agoDon’t trait objects work the same way as vtables (fat pointer)?
- Gigachad 4y agoMonomorphisation solves this. The compiler duplicates functions for every type you use them with in the finished binary.