mardi 24 février 2015

Why are there no java compiler alternatives to allow new functionality?

For example, a new java compiler could allow for some breaking backwards compatibility to allow for things like overloading on generic types like:



void foo(List<String> arr);
void foo(List<Integer> arr);


Or to allow things like generics over primitive types



void foo(List<int> arr);


Now I am not suggesting these are trivial changes, or that everyone would even use such a compiler, but I was curious why I could not find ANY alternatives to javac. Even if you never modified the bytecode spec, some of these changes (and others) could be implemented purely at compile time. If nothing else, it could allow a nice testbed to merge changes back to mainline in some fashion (I get that changing the semantics of the language means it is no longer "Java", but let's call it J++ or something).


I like Java's backwards compatibility first mentality, but I was surprised this is not an approach people have taken over completely new languages like Kotlin/Ceylon/etc.


Is there more going on here that prevents this from happening?


Aucun commentaire:

Enregistrer un commentaire