Re: Possible to write compiler to Java VM? (I volunteer to summarize)

jbuck@Synopsys.COM (Joe Buck)
25 Jan 1996 15:01:30 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: Possible to write compiler to Java VM? (I volunteer to summarize) basile.starynkevitch@cea.fr (1996-01-20)
Re: Possible to write compiler to Java VM? (I volunteer to summarize) gough@dstc.qut.edu.au (John Gough) (1996-01-21)
Possible to write compiler to Java VM? (I volunteer to summarize) fjh@cs.mu.OZ.AU (1996-01-23)
Re: Possible to write compiler to Java VM? (I volunteer to summarize) andi@complang.tuwien.ac.at (Andreas Krall) (1996-01-23)
Re: Possible to write compiler to Java VM? (I volunteer to summarize) boutell.com@holly.aa.net (1996-01-23)
Re: Possible to write compiler to Java VM? (I volunteer to summarize) darius@phidani.be (Darius Blasband) (1996-01-23)
Re: Possible to write compiler to Java VM? (I volunteer to summarize) jbuck@Synopsys.COM (1996-01-25)
Re: Possible to write compiler to Java VM? (I volunteer to summarize) anicolao@cgl.UWaterloo.CA (1996-01-25)
Re: Possible to write compiler to Java VM? (I volunteer to summarize) lwall@sems.com (1996-01-25)
Re: Possible to write compiler to Java VM? (I volunteer to summarize) will@ccs.neu.edu (1996-01-27)
Re: Possible to write compiler to Java VM? (I volunteer to summarize) hbaker@netcom.com (1996-01-27)
Re: Possible to write compiler to Java VM? (I volunteer to summarize) balld@sunSITE.unc.edu (1996-01-27)
Re: Possible to write compiler to Java VM? (I volunteer to summarize) david.hopwood@lady-margaret-hall.oxford.ac.uk (1996-01-29)
| List of all articles for this month |

From: jbuck@Synopsys.COM (Joe Buck)
Newsgroups: comp.lang.java,comp.compilers
Date: 25 Jan 1996 15:01:30 -0500
Organization: Synopsys Inc., Mountain View, CA 94043-4033
References: 96-01-037 96-01-063
Keywords: translator, interpreter

In a discussion of reimplementing other languages for the Java bytecode
engine, boutell.com@holly.aa.net (Thomas Boutell) writes:
>C++: see above, but more so. C++ does have several features which are
>missing from Java, most notably multiple inheritance and generic types
>(templates).


Ah, but Java does have multiple inheritance, with restrictions. In
Java, a class may be derived from one base class and may implement any
number of interfaces. But interfaces are simply what C++ calls
abstract base classes, with the additional restriction that they may
not contain data members. Thus a Java class that "extends" another
class and "implements" one or more interfaces is an example of
multiple inheritance. It turns out that some of the most common uses
of multiple inheritance in C++ meet these restrictions
(e.g. Stroustrup's recommendations on the design of container classes
in "The Design and Evolution of C++").


In other cases, data members for the second class can be faked in a
number of ways (e.g. stored in a HashTable someplace), so it should be
possible to retarget C++ multiple inheritance to Java. C++ Classes
that are used in multiple inheritance might have to be turned into
Java interfaces together with a basic implementation of that
interface.


Templates, on the other hand, may be added to Java.
--
-- Joe Buck <jbuck@synopsys.com> (not speaking for Synopsys, Inc)
--


Post a followup to this message

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