Re:The Unsound Playground: Java and Scala's Type Systems are...
by johncolanduoni on Sunday November 27, 2016 @08:42PM
(#13052848)
> having type erasure is among the best features of Java
Until you try to use something like a List<int> without wasting incredible amounts of memory. This is even worse in a VM with custom value types (like the CLR), which also have to deal with boxing.
> For example F# doesn't support higher-kinded types because the CLR doesn't support higher-kinded types and introducing support for HKT would mean for the F# compiler to basically do type erasure by itself, which would place it at a serious disadvantage versus the host language in terms of performance.
So the solution is to push the performance disadvantage into the VM so all languages are equally screwed?
Until you try to use something like a List<int> without wasting incredible amounts of memory. This is even worse in a VM with custom value types (like the CLR), which also have to deal with boxing.
> For example F# doesn't support higher-kinded types because the CLR doesn't support higher-kinded types and introducing support for HKT would mean for the F# compiler to basically do type erasure by itself, which would place it at a serious disadvantage versus the host language in terms of performance.
So the solution is to push the performance disadvantage into the VM so all languages are equally screwed?