News for hackers. Stuff that matters.
Re:Streams in Java 8 by pron on Sunday February 09, 2014 @06:18PM (#7207910)
Java's type erasure, while once considered a disadvantage, is now being recognized as one of the reasons other statically typed languages can be ported to the JVM. If Java reified types, it would make interoperability with other type systems extremely hard.
Re:Streams in Java 8 by overgard on Sunday February 09, 2014 @06:22PM (#7207927)
Yet somehow they made F# and scala run on the CLR. So: I'm calling bullshit.
Re:Streams in Java 8 by javafu2 on Sunday February 09, 2014 @06:51PM (#7208072)
F# team ask for modifications of the CLR (covariant delegates), porting a language on the CLR if you are not Microsoft is hard.

Scala never really run on the CLR, it's a vaporware, sorry a work in progress.

Re:Streams in Java 8 by adriaanm on Sunday February 09, 2014 @09:32PM (#7208740)
Yep, scala's .net back-end is discontinued, and one of the main challenges (I worked on it a bit) was indeed generating the proper generic signatures. (I hear people are using ikvm these days.)
Re:Streams in Java 8 by gracenotes on Monday February 10, 2014 @02:41AM (#7209661)
For more context on why F# does in fact run into problems, see https://visualstudio.uservoice.com/forums/121579-visual-stud.... To my understanding, F# only allows type variables to vary, not type constructors (all generic variables must be escorted by a concrete type), and to go a step further, it doesn't allow type constructors to be used as higher-kinded type variables, which is useful sometimes. I see no reason why these couldn't be implemented on top of the JVM, though.
Re:Streams in Java 8 by anaphor on Sunday February 09, 2014 @07:34PM (#7208295)
I've never understood why Java programmers dislike type erasure. In my mind, runtime type inspection is a bad idea for a supposedly statically typed language. It just seems like people are complaining that they can't do something they probably shouldn't be. If there's something you can't do without it then that means Java is poorly designed, not that type erasure is a bad idea.
Re:Streams in Java 8 by pron on Sunday February 09, 2014 @07:38PM (#7208309)
To be fair, erased generics force autoboxing of primitives. Anyway, Java's combination of static and runtime types, though not pure by any measure, has actually proven quite useful.
Re:Streams in Java 8 by kvb on Monday February 10, 2014 @10:10AM (#7211429)
I see this claim fairly often, but it seems like wishful thinking to me. There's nothing stopping a language targeting .NET from erasing its own generics to `List<object>`, `Map<object>`, `T<object>` if necessary, which would achieve almost exactly what you'd get with Java's erasure. And in the meantime, Java's approach requires any generic class containing arrays to box small value types, wasting large amounts of memory when those arrays are large.
Re:Streams in Java 8 by _pmf_ on Monday February 10, 2014 @12:27AM (#7209312)
> is now being recognized as one of the reasons other statically typed languages can be ported to the JVM

No, I really don't think so.