4 ms·
The real implication here is that Java behaves funny because of backwards compatibility. We're quite a distance away from < jdk1.5 days... What's the weather l
by exabrial 10y ago
The real implication here is that Java behaves funny because of backwards compatibility. We're quite a distance away from < jdk1.5 days... What's the weather like to update the Java memory model or type system to take care of these obscure cases? We managed to add a new opcode to the JVM (invokeDynamic) and the world survived!
- brianpgordon 10y agoinvokeDynamic is maybe not the best example because it didn't break code that used to compile fine. There are other examples (e.g. see for Java 8 http://www.oracle.com/technetwork/java/javase/8-compatibility-guide-2156366.html http://www.oracle.com/technetwork/java/javase/8-compatibilit...) where they've broken actual source backwards compatibility.
- _old_dude_ 10y agoIt's the opposite actually. Here the erasure is a good thing otherwise the bug described in the blog will have break the VM. The type system is broken because it supposes you have a type that exists and in the code you send null instead. If generics were in the VM, this kind of bug would have break the VM but 'thanks' to the way generics are handled in order to be backward compatible, a cast is inserted so this bug in the type system do not break the VM.