the long way to the development of a compiler

"Stefano Lanzavecchia" <stf@apl.it>
28 Jun 2001 23:48:29 -0400

          From comp.compilers

Related articles
the long way to the development of a compiler stf@apl.it (Stefano Lanzavecchia) (2001-06-28)
Re: the long way to the development of a compiler lockner@chaos.cns.uni.edu (Matthew J.Lockner) (2001-07-01)
Re: the long way to the development of a compiler neelk@alum.mit.edu (2001-07-02)
Re: the long way to the development of a compiler dlindauer@notifier-is.net (david lindauer) (2001-07-02)
Re: the long way to the development of a compiler walter@nospamm-digitalmars.com (walter) (2001-07-02)
Re: the long way to the development of a compiler stf@apl.it (Stefano Lanzavecchia) (2001-07-02)
Re: the long way to the development of a compiler christian.bau@isltd.insignia.com (Christian Bau) (2001-07-02)
[5 later articles]
| List of all articles for this month |

From: "Stefano Lanzavecchia" <stf@apl.it>
Newsgroups: comp.compilers
Date: 28 Jun 2001 23:48:29 -0400
Organization: Compilers Central
Keywords: question
Posted-Date: 28 Jun 2001 23:48:29 EDT

I am a professional software developer, but I don't have the
background of a computer scientist (degree in Physics). While I am
trying to keep myself up-to-date as far as new technologies are
concerned, in the last couple of years I've tried to teach me
something more. In particular, fascinated by functional programming
languages, I've decided to teach myself how to "produce a new
language" or, in other terms, how to write a compiler or an
interpreter. My first experiments (lexing, parsing, manipulation of
ASTs) have all been successful. To reduce the time spent on searching
the internet for free papers on the various topics (sometimes too
advanced anyway) I've bought a couple of books, including the Dragon
book. The one topic that at the moment is at the top of my priority
list of things to learn is code generation for real CPUs. It was easy
to write a toy compiler targeting a simple stack machine and implement
an interpreter for the stack machine, but when I started thinking
about real CPUs (in particular x86 and its special purpose registers
and its asymmetric instruction set, but also the 6502 with its 3
registers or MIPS or Alpha) I discovered that I hadn't learned enough
from the mentioned books. Both instruction selection and register
allocation are topics that are still quite obscure to me from a
practical point of view (one thing is to read about graph colouring
and another one is to put it in practice). I've tried to read the
source code of the native OCaml compiler, but it's a bit too advanced
for my taste.


I guess what I am really looking for is a set of reasonably well
documented sample programs, that implement simple compilers with
simple, but working back-ends (but a recommendation for a book would
be equally good). For instance: I found the slides on
http://www.cs.caltech.edu/cs134/cs134b/ almost useful, if it wasn't
that they are just slides, and, as such, don't contain the actual
explanation. Moreover the code fragments are too... fragmented to
allow me to rebuild the context. No wonder, since it's an university
course and not an online course, but you get the point. A fully
fledged optimizing compiler (New Jersey's ML + MLRISC or GCC) are
still a bit too tough for me as learning tools.


While we are at it: I am also looking for references on SSA, from the
theoretical and the practical point of view.




Thanks in advance to whomever might help me.
--
WildHeart'2k1 - mailto:stf@apl.it
Homepage: http://come.to/wildheart/


Post a followup to this message

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