3 ms·
Aside from backwards compatibility, what's good about type erasure for generics?
by int_19h 10y ago
Aside from backwards compatibility, what's good about type erasure for generics?
- jsmith0295 10y agoDoing it a better way is hard
- int_19h 10y agoIs it, though? The most basic implementation, where things are still erased at runtime by the JIT, should be fairly simple, although it will not give the expected perf gains, of course. Either way, CLR and C# did it a long time ago, and in the same time period when Java acquired its type-erased generics.
- jsmith0295 10y agoThey care too much about backwards compatibility I think. .NET had done generics this way from the beginning.
- dragonwriter 10y agoIt permits languages on the platform with substantially-richer compile-time type systems than the primary language on the platform with good interior stories (this was, IIRC, a substantial problem with Scala.NET.)