Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!ames!oliveb!Ozona!chase
From: chase@Ozona.orc.olivetti.com (David Chase)
Newsgroups: comp.lang.modula2
Subject: Re: M-3 ||| (was: re: M-3 ???)
Message-ID: <33717@oliveb.olivetti.com>
Date: 5 Dec 88 03:36:01 GMT
References:  <1032@paris.ics.uci.edu>
Sender: news@oliveb.olivetti.com
Reply-To: chase@Ozona.UUCP (David Chase)
Organization: Olivetti Research Center, Menlo Park, CA
Lines: 38

In article <1032@paris.ics.uci.edu> Doug Schmidt  writes:
>From what I understand, there are some individuals already working on
>a modula-2 compiler for the GNU project.  Assuming that modula-2 is at
>least a partial subset of modula-3 it might be worthwhile to determine
>how far along this work is, and whether portions of it might be reused
>for a modula-3 version.                           One of the big wins
>might be to avoid having to work out the details of an optimizer and
>code-genertor for multiple target machines, since much of this is
>available from the FSF.

[Note -- I'm writing a C-generating backend right now for it, but
that's not necessarily public domain.  I'm also on what might be
called the "Modula-3 peanut gallery".  Other people here and at
Olivetti STL are working on related language tools.]

I would advise anyone seriously considering doing a compiler for
Modula-3 to read the report v-e-r-y c-a-r-e-f-u-l-l-y.  The authors of
the report didn't waste any words.  I'm also willing to answer
questions (as time permits) from implementors, since I'd prefer that
compilers for Modula-3 work well and actually compile (roughly) the
same language.  I've had some sad times porting C and Pascal code; I'd
like to avoid a proliferation of incompatible dialects of Modula-3.

It's not clear how much could be re-used; there is a superficial
resemblance, but Modula-3 has a few "added features" that make life
more difficult.  Writing a good optimizing compiler it for looks like
a real chore, especially since intermediate codes designed for C,
Fortran, and Pascal don't seem to have the right hooks for exception
handling and concurrency (the C "volatile" declaration is best for
describing device registers, not shared variables.  It'll do the job,
but your optimizer will generate inferior code).  It's not hard if
your optimizer uses very simple schemes for register assignment, but
that's not the sort of thing I like to depend on.  (ADA has the same
problems, if not worse, with its exception handling.)  I'll welcome
suggestions from anyone who has them; right now I'm casually pursuing
Davidson and Benitez's VPO.

David