From: | NoeC@po1.cpi.bls.gov (Chris Noe') |
Newsgroups: | comp.lang.java,comp.compilers |
Date: | 19 Jan 1996 09:47:20 -0500 |
Organization: | Bureau of Labor Statistics |
References: | 96-01-037 96-01-045 |
Keywords: | translator, comment |
"Peter Seibel" <seibel@sirius.com> writes:
|So I'm asking you all: how easy/hard/impossible would it be to write a
|compiler for your favorite language(s) that compiles to Java VM
|byte-codes.
bnm@indica.bbt.com says...
>Don Box mentioned this in comp.object a few weeks ago, and the short
>answer is: YES. A few companies are working on this as we speak;
>sorry no details. An NCSA/Mosaic fellow mentioned Ada-95 as one
>language in the works by some other company.
>
>A compiler can target either a CPU or a VM. Either can be defined by
>an ISA (instruction set architecture).
--SNIP--
The very idea that a compiler (cross compiler, actually) can be built
to emit Java byte-codes from a foreign langauge stems from the idea
that the essence of the language is its syntax. This may be true of
some languages, but Java has at its core an extensive class
library. When a Java applet is written, the programmer reuses the code
in those libraries. A compiler which merely translates a legacy app
written in another language can take very little advantage of the Java
libraries. As a result, the executable will be large and cumbersome.
In fact, it may not be possible at all to automatically generate
byte-codes which will pass the security checks for code that was not
designed to operate within the security constraints of the Java model.
[I believe the counter-argument to the first point is that in many
cases the choice would be between cumbersome code and no code at all. -John]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.