Is It Time for Java++?
I was just teaching a class on Java threading, which is by far the weakest part of the Java language. The discussion inevitably comes around to how to fix the problems, and language-level solutions are often mentioned. Though there is a very-early-stage proposal for a JSR that will add a library of threading primitives to the language, a library-based solution is an awkward solution at best. It would be better to augment the language itself. Moreover, threading is just the tip of the iceberg. Javas access privileges are too weak; Java needs a true, constrained, enumerated type; the list is endless. Theres a point at which solving these problems solely through libraries becomes unworkable. Library-based code is simply too complex in unnecessary ways.
A year or so ago, I proposed (in an article for IBM) that the language be modified in a few minor ways to provide elegant, language-level solutions for some of Javas multitude of threading problems. I discovered, though, that its almost impossible to make changes even minor ones that dont affect the bytecode to the language itself. Sun has an iron grip on the language, and they just dont want to relinquish control, even if the new language would be backwards compatible with the old one.
I find this attitude unfortunate. Computer languages have a limited lifetime, and one of the reasons for the limit is that, as our knowledge of computing improves, we want languages that support new ways of looking at the computer. OO (object-oriented) languages like Java are a classic example. Theres not a thing you can do in Java that you couldnt do in C, but it sure would be a lot harder to do it in C. I had been hoping that Java would avoid obsolescence through the JSR process that the language itself could evolve to fix known defects and support new ways of programming. Sun, in its infinite wisdom, would see the libraries surrounding Java grow while the language itself ossifies, however.
So whats a mother to do? One solution is to develop a new language that fixes Javas problems, but whose compiler creates standard bytecode (or even Java source code, much like the original C++ compiler worked). This way you could write in the new language while still being able to leverage legacy code and libraries. Im tempted to do it in my copious spare time (thats a joke), but a project of the magnitude of a compiler is a significant amount of work. Perhaps, given enough nudging, Sun itself could be persuaded to loosen up a bit. Wed all benefit if Java didnt go the way of PL/1.
Allen Holub
Senior Editor