On Sat, 29 Sep 2001 18:18:19 -0700, Somazx Interesting <somazx@...> wrote:
> I'm really uninformed on this topic, but its a fantasy of mine:
> I hear the latest version of some compiler for linux (gcc?) can compile java
> code to a specific platform.
> I'm wondering if jEdit could be compiled specificly for linux/x86 and run a
> lot faster? If this is possible any chance a version will be availble for
> download like this?
First, I should point out that most modern Java virtual machine implementations
include a 'just-in-time compiler' which does what you describe, only at load
time, rather than at compile time. Among others, the current-version IBM and
Sun VMs do this.
Of course, this doesn't make your question irrelevant, because this means you
can incur a delay when loading and compiling a class file. Among other things,
the gcj package avoids this by compiling an input class file (or Java source
file) or files into native object code, and then links them with its 'libgcj'
library which provides the Java runtime class library.
This approach offers improved performance (compilation to machine code is done
at compile time, not at load time) without sacrificing portability (that
machine code is still generated from regular class files or source).
The only problem I can see with gcj is the fact that it's an _extremely_
immature piece of software at the moment. Though it can handle simple Java
programs and do so quite well, both gcj itself and libgcj suffer from severe
disadvantages. A short list:
- The Java source compiler in gcj is basically a compiler for JDK1.0 code. Not
even inner classes are understood, unless they've changed that...
- Libgcj is, as far as I know, an incomplete JDK1.0 class library
implementation. No AWT, for one thing.
So, the conclusion I've arrived at is that gcj should be used to boost
performance in programs it can handle, but the number of programs it can
handle is a rather short list.
I hope this situation improves soon, as the advantages I've pointed out above,
and probably others that I haven't thought of, make gcj quite appealing.