is there any program that convert from java into assembley(ex. MIPS) or vice verca
Sun's (and other) JVMs (Java Virtual Machine) already do that for you: a Java
compiler compiles Java source code to 'byte code', a machine code for a virtual
machine. After such code is loaded and executed (interpreted by the JVM) it is
monitored by a 'hotspot' mechanism.
After it has decided that a particular code will probably be interpreted frequently
it fires off a JIT (Just In Time) compiler that translates (compiles) the byte codes
for the virtual machine to real machine code. This JIT compiler differs per processor
for obvious reasons.
From that moment on nothing is interpreted by the JVM anymore: the CPU itself
executes that piece of code. There are two JVMs: a 'client' version and a 'server'
version. The first one acts a bit more conservative w.r.t. JIT compilation while the
second one aggressively uses the JIT compiler so it executes compiled Java code
faster than the other one. There is no need to play with external compilers anymore:
the JVM can do the job fine. In fact it can produce more optimized code than a
static compiler can because it 'knows' more about the code than a static compiler
does, IOW, the task of compilation has been split in two parts:
a) compilation from source code to byte code;
b) translation from byte code to machine code.
Modern JVMs can easily compete and are even faster than good C or C++ compilers.
kind regards,
Jos