Java > Scala

Russel Winder russel at russel.org.uk
Wed Nov 30 00:36:22 PST 2011


On Wed, 2011-11-30 at 08:42 +0100, Jacob Carlborg wrote:
[...]
> > I wonder to what extent the inefficiencies he mentioned (such as the lambdas
> > being sugar for anon classes) could be due to the JVM itself. Or if the
> > reason is primarily something else, such as something about Scala's internal
> > design or just its implementation. Maybe Scala tries to maximize
> > compatibility with Java, and if so, maybe that's the main underlying cause?
> > Or again, maybe just inherent attributes of the JVM itself (although that
> > would run contrary to what I've heard many people claim about the modern
> > JVM)?
> 
> I think it has something to do with Scala trying to be compatible with Java.

There are lots of other issues, many relating to "type erasure" which is
a millstone for Java and something Scala now depends on -- all the
Manifest stuff is there to replace reification of type parameters for
generic types.

Java 9, 10, or 11 may well remove type erasure and reify the type
parameters in the class file and hence the verifier, running class, and
type checking.  CLR has already done this of course.

Java 8 will bring lambda functions as a part of the language not
realized via instantiating anonymous classes, this may well cause Scala
to rethink many things.  On the other hand Java will already have
rewritten it data structures library to allow for lambda functions.

Java with lambdas, looks like object-oriented programming is finally
dying ;-)

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20111130/193b3e25/attachment.pgp>


More information about the Digitalmars-d mailing list