3 ms·
So, generic type erasure is still a bad idea.
by StrawberryFrog 15y ago
So, generic type erasure is still a bad idea.
- masklinn 15y agoDepends how much of your language happens at runtime. In very statically typed languages such as Haskell, type erasure works just fine (that's what GHC does), though it does give the impression of taking more namespace surface when you need generic type varargs (e.g. you can have `Foo<T>` and `Foo<T, U>` when your generic types are reified, if they're erased you'll need `Foo<T>` and `Foo1<T, U>`, there are two types in either case, but reified generics give the impression of a single type with a variable number of type arguments). Erased generics are a bad idea when your type system is full of holes (easy to bypass) and lots happen at runtime, as is the case in Java.
- eru 15y agoYes. Haskell still needs to do some stuff at runtime for type classes.