Re: Java Backend

Basile STARYNKEVITCH <basile@starynkevitch.net>
14 Mar 2003 11:06:26 -0500

          From comp.compilers

Related articles
Java Backend titzer@expert.ics.purdue.edu (Ben L. Titzer) (2003-03-09)
Re: Java Backend basile@starynkevitch.net (Basile STARYNKEVITCH) (2003-03-14)
| List of all articles for this month |
From: Basile STARYNKEVITCH <basile@starynkevitch.net>
Newsgroups: comp.compilers
Date: 14 Mar 2003 11:06:26 -0500
Organization: http://lesours.starynkevitch.net/ - Les Ours
References: 03-03-011
Keywords: Java
Posted-Date: 14 Mar 2003 11:06:26 EST

>>>>> "Ben" == Ben L Titzer <titzer@expert.ics.purdue.edu> 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 www.tinycc.org on x86).


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


4. using the GNU lightning library to generate code. See
      http://www.gnu.org/software/lightning/ 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 http://freshmeat.net/projects/qish and
http://starynkevitch.net/Basile/qishintro.html the current tar ball
being http://starynkevitch.net/Basile/qish-0.9.tar.gz 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.


--


Basile STARYNKEVITCH http://starynkevitch.net/Basile/
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.