Re: Java Backend

14 Mar 2003 11:06:26 -0500

          From comp.compilers

Related articles
Java Backend (Ben L. Titzer) (2003-03-09)
Re: Java Backend (Basile STARYNKEVITCH) (2003-03-14)
| List of all articles for this month |

Newsgroups: comp.compilers
Date: 14 Mar 2003 11:06:26 -0500
Organization: - Les Ours
References: 03-03-011
Keywords: Java
Posted-Date: 14 Mar 2003 11:06:26 EST

>>>>> "Ben" == Ben L Titzer <> writes:

        Ben> I'm currently developing a compiler in Java for an evolving
        Ben> language of my own design. I have completed much of the
        Ben> frontend and will be starting on the big fat middle (program
        Ben> analysis and optimization that precedes machine specific
        Ben> optimizations). I will soon need a backend, and would prefer
        Ben> not to embark on my own.

I'm not sure it answers your concern, but you could [also] consider on
of the solutions below:

1. generating JVM bytecodes (there are some Java libraries doing this)

2. generating C code (Mercury, ... compiler implementation do|did
      that) -perhaps using several GCC extensions- and compile it with
      GNU GCC (or TinyCC see on x86).

3. using the C-- compiler and generate C-- code. See for details. C-- is an intermediate language
      specifically designed for compiler writers. The QuickC-- compiler
      implementation is free and opensource, and targets several common

4. using the GNU lightning library to generate code. See for more. GNU lightning
      library is useful for machine code generation, using a abstract
      RISCy model.

I wish that your implementation will be (or is already)
opensource. New languages cannot succeed without free implementations.

If you generate code (with solutions 2,3, or 4) you probably will need
to plug in a garbage collector & runtime system. In addition of
Boehm's conservative GC, you might consider using my Qish runtime, an
opensource precise (mostly copying generational) garbage collector
[LGPL license] available on and the current tar ball
being and Qish aims
precisely machine generated code.

I suggest to not put too much effort on code generation for a new
evolving language design (this entails using solutions similar to
those above). Having a working compiler which generate not very good
code is much better than not having any working compiler!

Good luck.


email: basile<at>starynkevitch<dot>net
aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net
8, rue de la Fa´encerie, 92340 Bourg La Reine, France

Post a followup to this message

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