Re: Possible to write compiler to Java VM?

mw@ipx2.rz.uni-mannheim.de (Marc Wachowitz)
30 Jan 1996 18:27:27 -0500

          From comp.compilers

Related articles
[10 earlier articles]
Re: Possible to write compiler to Java VM? darius@phidani.be (Darius Blasband) (1996-01-29)
Re: Possible to write compiler to Java VM? stt@copperfield.camb.inmet.com (1996-01-29)
Re: Possible to write compiler to Java VM? ncohen@watson.ibm.com (1996-01-29)
Re: Possible to write compiler to Java VM? RLS@psu.edu (1996-01-30)
Re: Possible to write compiler to Java VM? mg@asp.camb.inmet.com (1996-01-30)
Re: Possible to write compiler to Java VM? jeff@uh.edu (Jeff M Younker) (1996-01-30)
Re: Possible to write compiler to Java VM? mw@ipx2.rz.uni-mannheim.de (1996-01-30)
Re: Possible to write compiler to Java VM? salomon@silver.cs.umanitoba.ca (1996-01-30)
Re: Possible to write compiler to Java VM? bothner@cygnus.com (1996-01-30)
Re: Possible to write compiler to Java VM? tmb@best.com--Internet (1996-01-30)
Re: Possible to write compiler to Java VM? hbaker@netcom.com (1996-01-30)
Re: Possible to write compiler to Java VM? stt@henning.camb.inmet.com (1996-01-30)
Re: Possible to write compiler to Java VM? dewar@cs.nyu.edu (1996-01-31)
[10 later articles]
| List of all articles for this month |

From: mw@ipx2.rz.uni-mannheim.de (Marc Wachowitz)
Newsgroups: comp.lang.java,comp.compilers
Followup-To: comp.lang.java,comp.compilers
Date: 30 Jan 1996 18:27:27 -0500
Organization: ---
References: 96-01-037 96-01-089 96-01-109
Keywords: C, translator

David Hopwood (david.hopwood@lady-margaret-hall.oxford.ac.uk) wrote:
> Here is my estimation of how hard it would be to translate various languages
> to the JVM. YMMV.
[...]
> Impossible automatically:
> C, C++


Though I didn't ever read the C standard (and only parts of an earlier draft
of the C++ standard), in the light of what I've read from people who did, it
appears that there are generally too many assumptions about what a C program
can expect from its environment (and I even think there are many useful ones
which at least can be changed with reasonable effort not to expect too much,
particular with the help of a relatively "clean" implementation offering the
programmer good diagnostics about impurities instead of silent malfunction).
For example (as far as I know), pointers need only be meaningful within some
object (with a special case wrt. pointing directly after the end of arrays);
there's no requirement to map pointers to a large continuous memory area (as
the poor souls programming on segmented architectures know - but there their
problems have more to do with addressing objects exceeding the fixed segment
size, not so much the partitioning of the address space itself). I'd say the
task of implementing a completely standard conforming and useful C to JavaVM
translator isn't even conceptually very difficult, and a similar performance
as when compiling from Java source could be obtained with reasonable effort.
What would be more hard work is probably the creation of a reasonable inter-
face to the many libraries (particularly systems programming stuff like what
comes with Unix and variants) which typical C programs use. [I don't want to
speculate about C++, as I'm not sufficiently up to date wrt. the development
to guess about the complexity even for a C++ front-end, not to mention which
additional problems it would create for the back-end. Given that C++ was and
maybe sometimes still is also translated to C source code, it might be quite
possible - though the existing C++ to C code generation strategies might not
yield acceptable performance for a simple C to JavaVM translator, without an
additional knowledge about areas for improvement of certain patterns.]


------------------------------------------------------------------------------
                                Marc Wachowitz <mw@ipx2.rz.uni-mannheim.de>


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.