Stewart Stremler wrote:
Java gets compiled (i.e., transformed) into bytecode, which is a
binary intermediate format, which then gets interpreted; Sun's
JIT takes the bytecode and further translates it into the local
hardware's machine instructions.
So yes, Java's interpreted, but then, so is the Linux kernel,
when I run it on my PPC mac under VirtualPC.
Java _can_ be interpreted, but with JIT, it is not interpreted; instead
it is compiled at runtime. I get the sense that you know the
distinction, but it did not come through clearly (at least to me) in the
paragraphs above. With JIT, you take a performance hit while the
compilation takes place (when the code loads), but you do not incur any
performance penalties when running the code, as you would when using
interpreted Java.
Also, Java can be compiled into native code with gcj[1], which produces
a compiled binary just like typical C or C++ compilers.
So, what this shows, as was stated before in this thread, is that the
language is a specification, and the runtime environment is typically an
implementation detail. I think that failing to make this distinction is
one of Sun's failures. Branding both the language and the platform as
Java has caused at least some confusion. For example, Jython (Python
compiled into Java bytecode) helps blur the line.
-- Rick
[1]: http://gcc.gnu.org/java/
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg