Question

What do you think? Will the JVM ever get support for generics?

Quite likely that would not only require substantial changes to the JVM, but also to the class file format, but languages running on the VM would greatly benefit from it.

Edit: The Java language actually supports some sort of generics as a compile time feature, which adds some casts to the bytecode, which people had to add manually before.

The decision to not introduce changes to the JVM or the class file specification was well understood at these times, because they didn't want to break backward-compatibility and Java was the only significant language for the JVM these days.

While this decision might have been appropriate for the Java language, it has significantly reduced the amount of freedom other languages have to choose how they want to implement generics on the VM.

Considering that Sun/Oracle have proclaimed to make the JVM a friendlier place for alternative languages, will they actually do what they promised or consider they that the low cost addition of "InvokeDynamic" is enough?

Was it helpful?

Solution

In my opinion it is unlikely.

It would simply be too disruptive to apply these changes to the Java language. Linguistic and runtime backwards compatibility with two different models of generics would be a nightmare for the designers.

And without, Java to drive changes to the JVM, it is hard to see how Oracle would / could justify doing the work required.

The only possibilities I see are:

  • Oracle decides to develop a successor language to Java (that is not backwards compatible) that does generics, closures and a whole bunch of things better. That would be a really brave business decision, and I don't think Oracle is capable of making it.

  • A bunch of other people / companies get together and fork the JVM specification and the codebase. That's also a brave move to make.

I don't think it is likely that Oracle would resource a major change to the JVM just to support languages that they had no commercial interest in. We are talking about here Oracle ... where the business types have a much tighter control over what the engineering types get to do than in the dying Sun days. (Hey ... we could start a whole Jack Vance theme going here :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top