Will the JVM extend to handle generics?

What do you think? Will the JVM ever get generic support?

It is likely that this will not only require significant changes in the JVM, but also in the class file format, but languages ​​running on the virtual machine will greatly benefit from this.

Editing. The Java language actually supports some kinds of generics as a compile-time function that adds some casts to bytecode, before which people had to add manually before.

The decision not to make changes to the JVM or the class file specification was well understood at this time because they did not want to break backward compatibility, and Java was the only meaningful language for the JVM these days.

Although this solution may have been suitable for the Java language, it has significantly reduced the freedom of speech that other languages ​​have to choose, how they want to implement generics in a virtual machine.

Given that Sun / Oracle has announced that they will make the JVM a friendlier place for alternative languages, will they really do what they promised, or do they think the InvokeDynamic add-on is reasonably inexpensive?

+3
source share
1 answer

In my opinion, this is unlikely.

It would just be too damaging to apply these changes to the Java language. Linguistic and backward compatibility with two different types of generics would be a nightmare for designers.

, Java JVM, , Oracle / .

, :

  • Oracle - Java ( ), , . -, , Oracle .

  • / JVM . .

, , Oracle JVM , . Oracle... , , , . (... , : -)

+4

Source: https://habr.com/ru/post/1753809/


All Articles