3 ms·
I understand that traits are something like typeclasses or interfaces: are single-method traits kept around as traits, or is the function itself passed around i
by mrkgnao 9y ago
I understand that traits are something like typeclasses or interfaces: are single-method traits kept around as traits, or is the function itself passed around in the optimized output?
I'm actually suddenly curious about how other functional language compilers look compared to GHC.
- paulddraper 9y agoAbstract classes can be efficiently encoded, since the JVM understands that. The Scala collections collapse common sets of traits into abstract classes. Traits are copied, always I think. Only traits with all final methods could even possibly be not duplicated.