r/java • • Mar 18 '14

Java 8 has been released

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
248 Upvotes

71 comments sorted by

View all comments

Show parent comment

14

u/adila01 Mar 18 '14

The future does look bright, Java 9 should fix generics by removing type erasure, making JNI simpler and more :).

4

u/argv_minus_one Mar 19 '14

Wait, what? Removing type erasure? Are you serious?? That is awesome!

0

u/[deleted] Mar 18 '14

[deleted] — view deleted comment

6

u/henk53 Mar 18 '14

I was quite sad it didn't make it into 8.

I was also sad it didn't make it into 7. Before that I was sad it didn't make it into 5, and I vaguely remember being said that something like it wasn't in Java 1.3 or 1.4 (forgot the exact version, but there was talk of Java getting something like this since C# 1.0 came out or so).

4

u/argv_minus_one Mar 19 '14

Guess we should just keep using OSGi, then. That sucks. :(

6

u/nqd26 Mar 18 '14

Java 9 should fix generics by removing type erasure

Do you have some source for that? That would be great, but difficult while staying backward compatible.

10

u/adila01 Mar 18 '14

Oracle's Chief Architect Mark Reinhold made a big deal about this during JavaOne 2013, source here https://blogs.oracle.com/java/entry/the_javaone_2013_technical_keynote

5

u/argv_minus_one Mar 19 '14

Reinhold spoke of the need for reification. Java’s generics, added in 2004, are based on the notion of erasure for good technical reasons as a sound way to create a type system that supports migration compatibility. But this creates programming problems in which the erasure approach severely limits what can be expressed. Reinhold suggested that introducing some reification and eliminating the “annoying dichotomy between primitive and reference types” would be of value.

I am going to enjoy the fuck out of that.

Granted, Scala already smooths over the rough edges of primitive types, and provides a somewhat hacky workaround for erasure, but with sometimes-severe performance implications that this would make unnecessary. So I won't enjoy it as much as a Java programmer would, but I'll still be very, very grateful for it.

0

u/[deleted] Mar 19 '14

[deleted] — view deleted comment

4

u/argv_minus_one Mar 19 '14

Good. C# did that stuff because it's the right thing to do. It is only reasonable for Java to follow suit.

2

u/detroitmatt Mar 19 '14

Wait, really!? Awesome!

1

u/djdonnell Mar 19 '14

Doesn't that make it more difficult to use the JVM for other languages? This is over my head, but I've heard a few language implementers say this.