There are plenty of benefits to a more type-safe VM, such as the
ability to do code sharing and optimizations which would otherwise be
impossible. Also, I find it truly annoying that one can not
say ...implements Comparable<T>, Comparable<U>, especially
when you come from C#. Erasure makes it look like there's a flaw in
the type-system, since the two types truly are different.

On Aug 31, 6:35 pm, Cédric Beust ♔ <[email protected]> wrote:
> Hi Russel,
>
> On Tue, Aug 31, 2010 at 7:51 AM, Russel Winder <[email protected]> wrote:
> > Perhaps the JVM could then support type parameters and the abomination
> > that is type erasure could be dispensed with.
>
> I'm surprised by the intensity of your statement, it's quite unusual coming
> from you :-)
>
> In a regular Java code base, I would say that the amount of reflection is
> very low, probably 5% or less (already a generous number in my opinion,
> since most of it is probably because of annotations).
>
> Out of these 5%, how much really needs access to erased type information?
> That number is probably vanishingly small.
>
> And the thing is: if you really need this information, you can have it to
> some extent with
>
>    - getGenericType
>    - Or even better, the very clever
> TypeLiteral<http://google-guice.googlecode.com/svn/trunk/javadoc/com/google/injec...>
>    .
>
> Overall, I think erasure has worked very well in practice, so I'm curious to
> hear why you think it's such a disaster?
>
> --
> Cédric

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to