Part II: Suns Gosling: Java Is Open Source and Doing Just Fine

Q&A: James Gosling, the father of Java, sits down for a candid interview with eWEEK about the open-sourcing of Java.

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.

/zimages/3/28571.gifClick here to read Part I of this interview.

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.

Next Page: The Next Big Thing