> Is it much much easier to make byte code than assembly code? I
> mean, I understand why running on a VM makes sense as far as
> instantly inheriting all the massive amounts of things out here for
> Java .... but would it be possible to shoot for something down the
> road that, behind the scenes, uses jvm whenever you say,
> "import" . . .and writes and compiles assembler whenever you are
> doing purely algorithmic things?
There are (at least) two reasons not to go that way:
1) The JVM provides a lot of infrastructure for programming languages
that otherwise each compiler/interpreter would have to reinvent.
Memory handling with garbage collection, for example. And of course a
lot of platform-specific OS interfacing. Reinventing them is not only
a lot of work, but also creates compatibility barriers in multi-
language programming. It is very difficult to combine languages A and
B if each of them has its own memory management.
2) Compiling to a mix of native code and JVM bytecode brings up a lot
of ugly platform dependencies, the kind that makes the Java native
interface so unpleasant to use.
There is a reason why virtual machines like the JVM and CLI (.Net/
Mono) are gaining popularity. They provide security (by supervising
programs' acces to the machine resources), portability,
infrastructure, and the possibility to mix languages easily. There is
a performance price to pay for this, but apparently more and more
people are willing to do so, and at the same time that price is going
down.
Konrad.
That's a pretty major problem. :-)
--
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e
That's a pretty major problem. :-)
On Tuesday 20 January 2009 08:01:19 ivant wrote:
> IIRC, the only major complain Rich has about JVM is the lack
> of tail-call optimization.
Too late:
http://mail.openjdk.java.net/pipermail/mlvm-dev/2009-January/000331.html