Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Depends 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.



Yes.

Haskell still needs to do some stuff at runtime for type classes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: