Java compilers

  • Thread starter Olurotimi Ajayi-Dopemu
  • Start date
O

Olurotimi Ajayi-Dopemu

Are there Java compilers that allow the compiled code to be run from an existing operating system. IE compile source on linux run only on linux after compilation. This is mostly a speed question but if anyone can add pros or cons of this that would be great. Thanks a bunch.
 
A

Arne Vajhøj

Are there Java compilers that allow the compiled code to be run from
an existing operating system. IE compile source on linux run only on
linux after compilation. This is mostly a speed question but if
anyone can add pros or cons of this that would be great. Thanks a
bunch.

You mean a compiler that translate Java source code to binary
(AOT compiler).

There are certain products that does that. Jet Excelsior is one of
the more well known.

They have never really caught on.

The performance benefit is typical not existing or insignificant.

Arne
 
M

Marcel Müller

Are there Java compilers that allow the compiled code to be run from an existing operating system. IE compile source on linux run only on linux after compilation. This is mostly a speed question but if anyone can add pros or cons of this that would be great.

In most cases you can only loose.

The Java concept involves the JIT compiler that does exactly what you
are describing, but on each run of the JVM. So the only thing you can
save is the time for the JIT. You will agree, that this is always a O(1)
Problem regarding one application, adding some constant time to an
application run.

But on the other side there are several drawbacks.
First of all Linux is not Linux. There are different CPUs, different
ABIs and so on. So if you compile for a target platform, it must either
use the common denominator of a set of platforms or be specific to
exactly one existing machine with exactly one kernel and so on.

Taking the common denominator of let's say linux ELF on x64 leaves
different CPU features like AVX unused around.

Compiling for exactly one platform on the other side may result in code
that will no longer run after slight changes, like new hardware or
something like that.

So what are the benefits of precompiled byte code? Nu rule forbids
caching of the JIT results by the JVM. So the benefit of precompiled
code could be combined with the benefits of JIT. But as long as the time
taken for JIT compilation is comparably small even that makes no sense.


Marcel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top