JDK 1.5 Alpha released | Time to shoehorn in multiple inheritance?
By
greenrd (Fri Jan 02, 2004 at 03:56:27 PM EST) (
all tags)
OK, so Java JDK 1.5 alpha has been released. You're not supposed to know the download link (unless you're a a special "Sun customer" - or even just a member of
Javalobby, heh) - but our old friend Heise
leaked it on Xmas eve. (You don't have to be able to read German to find the link.)
Now that Java will officially have generics (even though they say everything is subject to change at this stage, blah blah legal boilerplate, it's a betting certainty nevertheless by now) I'm rethinking my research language Hubris (not yet released). I had been developing a separate language partly because I thought its features were too radically different to Java.
But now Java will have generics, I've thought about how to hack and bodge on multiple inheritance (with implicit resolution unlike in C++) and the wonderfully juicy concept of private inheritance (didn't realise C++ has that until recently, but it does) onto Java 1.5. I've designed the preprocessor in my head, and I think it's quite inspired, if I do say so myself.
It won't be a perfect hack, but it will be enough for me to "transliterate" some Hubris code (by hand at first). And it should be somewhat compatible with most other unofficial Java language extensions (such as my favourite, AspectJ) - which is often the huge annoyance with Java language extensions - use one extension, you can't use any others. Or not many, anyway.
Look out for a Free Software implementation of Java + Multiple Inheritance + Private Inheritance in the coming months (barring any major unforseen hiccoughs). I'll post a link here.
The biggest drawback will be something like this: you won't be able to inherit from multiple classes that you can't change - i.e. either you can't change them for legal reasons, or for operational reasons. But then, I don't see how any competing multiple inheritance workaround could do that either, so it can't be fixed without re-speccing Java.
Perhaps Java 3 will have full multiple inheritance for all classes... Dream on.
Anyway, I am of course willing to be hired to work on this project full-time, if anyone wants to splurge some cash on it. Shouldn't take long.