James Gosling, the creator of the Java language, is a Sun Microsystems vice president and fellow. Gosling spoke with eWEEK senior editor Darryl K. Taft at JavaOne and discussed the open-sourcing of Java, new directions for the Java platform and programming in general, new Sun technology and competing with Microsoft.
What comes next with the JVM [Java Virtual Machine]? Its basically 32-bit and Java-language centric. What does Sun have to do to upgrade it? Does it need a major re-vamp?
Well, we have lots of plans for change. You said its 32-bit; its actually been both 32-bit and 64-bit for years. If you have a machine with a lot of memory on it you can run… We actually qualify our GC [garbage collection] algorithms up to 500 gigabytes of RAM. Not many people in the world have 500 gigs of RAM, but Sun has sold those boxes for years.
Were now worrying about 2-terabyte GC qualification. And we do a lot of stuff around optimization. We have big project going on right now with Intel to do very special targeted optimizations for all these sort of exotic cases to get really great performance on Intel chips.
But in terms of doing special things for other languages, there are actually quite a few languages targeted at the Java VM for quite a while. And it actually works pretty well for a wide variety of languages. There are some languages that are very hard to do, like C and C++. And thats mostly because theres no way to do them correctly without creating huge security holes. And thats part of the problem with C and C++. Their naked pointers are just a problem.
How about C#?
Well, C# is strange, because C# has got these protected and unprotected, managed and unmanaged code portions. And their managed code is basically a cut-and-paste from the Java manual. But they use the unmanaged world way too much. And in general we believe the unmanaged world with naked pointers is like just a really dumb idea. But for some of the scripting languages there are issues around method calling that we could do better. And weve got a project going on to try to add like one or two bytecodes to make dynamic method dispatch in Python and Ruby faster.
Microsoft recently announced their Dynamic Language Runtime (DLR) and portability of its CLR (Common Language Runtime), which would put .Net on par with Java in terms of portability. Do you see them actually pulling that off?
People have done ports of CLR to other platforms. But it isnt CLR that matters. Getting something to run CLR is not a big engineering feat. Its mostly marketing. And the reason is that what a developer sees is partly the language, which gets mapped to the underlying machine – which is what the JVM and the CLR do. But another piece of it is all of the libraries. So, yes, they announced that theyre porting the CLR. But one of the one of the big libraries that people in the .Net world talk to is what? Excel. And Word. So are they porting word to Linux or whatever? Not that I know of.
So you take all the stacks of the Microsoft .Net APIs… What fraction of them is going to be available on this other platform? So thats going to tell you a lot about what fraction of .Net apps will actually run over there.
So that dynamic method dispatch project you mentioned, is that similar to what Microsoft is doing with its DLR, where theyre trying to support dynamic languages like Python and Ruby?
I dont think theres a need for a separate runtime. In fact it would be a bad idea because one of the things that one really wants to get is interoperability against all of these platforms. Weve got a pretty nice implementation of Ruby that runs on the Java Virtual Machine. Its not complete right now, but for the pieces where the JRuby-to-bytecode compiler is there, it actually runs significantly faster than native Ruby. Plus which it gives you access to this huge mass of Java APIs. And if youre using various other scripting technologies on top of the Java platform, you can take JavaScript with the Rhino engine and you get to tie Ruby and JavaScript together when you use the versions that are sitting on top of the common VM.
If youve got a common VM amongst these languages then youve got a really powerful story on the synergies amongst these systems.
So can you program JavaFX Script using Suns dynamic languages?
Well, its an interesting scripting language because it was really designed with the JVM in mind. So it needs no extra help. And, not quite today, because the current implementation is a preview release, but the compiler thats in the works will give really excellent performance. And its not so much the performance, its more about size.
So it will be distributed through the browser?
It generates things that look like applets. So, yeah…
What are your thoughts on the popularity of Ruby and Ruby on Rails as sort of becoming a default language for “cool” programmers?
I rarely write software that would work in the Ruby world. So I personally find it a little mystifying. Theres just no way that you could write edge-finding algorithms and image convolutions in Ruby. But its got a lot to recommend it and weve put a lot of energy into supporting it. And one of the things that weve been doing with the app server is making the GlassFish server host all kind of containers. And Ruby on Rails apps are deployed with GlassFish containers with really nice performance, scale and manageability…
What are your thoughts on Domain Specific Languages (DSLs)?
I have sort of a love/hate thing about them. Theyre one of those things that I consider sort of a guilty pleasure like sneaking ice cream. If what youre doing is stuff thats focused on some domain that theres a domain-specific language available for its really great. I really like them. I mean JavaFX Script is a domain-specific language. If youre doing a graphical user interface its great, if youre doing something else its not so great.
If used appropriately they work wonderfully. If used inappropriately… Like if you try to do a graphical user interface programming using ML youll be very unhappy.
Where it gets difficult for me is where youve got large complex systems that have parts that have user interface programming, this area is web front end, this area is hard math, this area looks like AI [artificial intelligence], this area looks like real-time device control… one of the things about Java is you can actually do all of those things within the one language framework. It may not be perfectly tuned to any one of them, but its pretty damned good at all of them.
Whereas the domain specific languages work really good at a certain thing, but when you have to cross domains then you get into trouble.
The Next Big Thing
What do you see as the next big thing? Whats the next big language or programming environment? And if you cant readily say what it is, what kinds of stuff would it have to have?
It depends on your view of the scale of what the next big thing is needed. When youre building technology its always in service of something else. So the next big thing in development is triggered by the next big thing in the social evolution of the web or the way technologies go. And if you look at what triggered Java it was all about the implications of networking. And pretty much every design decision on Java in the early days was the difference between standalone computing and network computing.
So maybe the question is whats the next big thing thats going to cause that level of shift? And I guess I have a couple of candidates. One is that Im generally concerned about the way that multi-threading is going. The Moores Law exponential has been shifting over to the number of cores. Javas got a pretty good threading model that works pretty well for things like transaction processing. But for other kinds of problems… We seem to be doubling the number of cores every couple of years. The hot desktop machines right now have eight cores. You look forward 20 years and thats like an 8,000-CPU machine on the desktop. How the hell will anybody write programs for that?
And one of the really interesting questions for me is how that crosses over and what does that cross over to?
One area that interests me is AI. And when you get to that level of power many AI techniques actually work.
There have been studies to look at when the processing power of a desktop PC actually surpasses that of a human brain. And many of the guesses have said 2022. So what does programming look like in that world? And what does our relationship with those machines look like?
Do you give Eclipse any credit for helping to spur innovation in the Java world?
Oh, yeah! Oh, yeah! We were sort of ambling around with NetBeans, and then when IBM released the whole Eclipse thing, it was like: Yeah, we like a good race.
But even beyond the race. Some of the projects theyve spawned have advanced the platform considerably.
Oh, yeah. But this is competition in terms of a sports match rather than a military conflict.
Is Sun doing anything to help get more young people, under-represented people, and more women involved in computer science? Any educational initiatives?
At some level Sun is a bunch of aging Berkeley hippies. Were OK with making money, but its really a cause. Its really kind of a strange company to work for.
We do quite a lot. We support the BlueJ effort. They are a bunch of educators that really care about teaching kids. And one of their issues has been how do you motivate kids to want to learn to program. So they came up with Greenfoot, which is an extension to BlueJ where kids can build their own video game using Java. And theyve gotten pretty enthusiastic response.
Youve spoken about having a daughter before; do you have any advice on how to get more women and young girls interested in computer science? Whats the magic potion?
I have two of daughters, and I wish I knew. I have no ability to generalize. I have two specific cases. My older daughter… The fact that I am who I am has made her sort of resistant to even trying anything in the field.
I tried really hard to get her interested in technology. I got her all kinds of books and toys, but she never paid any attention to them. But then with history books, she read Winston Churchills A History of the English-Speaking Peoples at like age nine and she read Mein Kampf at about that same year. And I cant read that stuff. But she took a programming course last semester and she actually admitted that she liked it.
But my other daughter is totally different. She picks up Legos and builds things and we think shes going to be an engineer.
So I dont know how you influence them. I dont think you really can influence them. You can just make sure they dont have social barriers.
What do you think about the popularity of OSGi [the Open Services Gateway Initiative]? Sun was a backer of it and then you guys backed away.
Well, it turned into a really strange patent corral…
Check out eWEEK.coms for the latest news, reviews and analysis in programming environments and developer tools.