Once upon a time, I never imagined I would say this, but erasure actually
turns out to have been a Good Thing(tm)
There aren't really that many scenarios where you need reification.

More importantly, it's allowed the JVM to support Scala's far richer type
system, and still interoperate with Java.  Compiling Scala against .NET is
less pleasant, mostly because the CLR otherwise tries to enforce a type
system that doesn't align with Scala's!  So Scala on .NET also uses type
erasure.

Note: This is not specifically a pro-Scala posting, I'm just using it as a
familiar example of alternate type systems and the risks of reified types,
as well as alternative solutions to the problems of erasure that don't
require reification.

Still, there *are* scenarios where you want to know the type parameter(s) of
some object.  This is as true in Scala as it is in Java.  How is the problem
solved?  With Manifests, and with the much maligned feature of implicit
parameters:
http://stackoverflow.com/questions/3587286/how-does-scalas-2-8-manifest-work
http://stackoverflow.com/questions/3213510/what-is-a-manifest-in-scala-and-when-do-you-need-it


Far from being an abomination, it looks like erasure is one of the few
moments in Java's history where it was able to successfully dodge the burden
of yet another feature that gets superceeded after being eternally chained
to the shrine of backwards compatibility.



On 31 August 2010 15:51, Russel Winder <[email protected]> wrote:

> On Tue, 2010-08-31 at 10:24 -0400, Robert Casto wrote:
> > I very much like where this thread is headed.
> >
> > Having viable options with Java that Oracle can not touch sounds like
> > a win for the community. There is a lot of value in those libraries
> > that can be leveraged by a developer. That makes them productive and
> > of benefit to a company. If all we have to do is change the underlying
> > VM to something that is safe from Oracle, then so be it. I'm sure that
> > VM would get a lot more attention from the community to make it great
> > for production use.
>
> Perhaps the JVM could then support type parameters and the abomination
> that is type erasure could be dispensed with.
>
> --
> Russel.
>
> =============================================================================
> Dr Russel Winder      t: +44 20 7585 2200   voip:
> sip:[email protected] <sip%[email protected]>
> 41 Buckmaster Road    m: +44 7770 465 077   xmpp: [email protected]
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
>



-- 
Kevin Wright

mail/google talk: [email protected]
wave: [email protected]
skype: kev.lee.wright
twitter: @thecoda

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