[comp.lang.ada] looking for a public domain ada compiler

WSR5672@TNTECH.BITNET (11/15/89)

Does anyone know of a good public domain Ada compiler?

I need something would run on UNIX (Sun workstations)  or ULTRIX (Vax 750).

        Has GNU made any plans to produce one?

                                                Scott Redmon
                                                Tenn. Tech. University

karl@grebyn.com (Karl Nyberg) (11/16/89)

   Date:     Wed, 15 Nov 89 09:53 CST
   From: <haven!VMA.CC.CMU.EDU!WSR5672%TNTECH.BITNET>

   Does anyone know of a good public domain Ada compiler?

Depends on what you mean by GOOD...  I understand there's some stuff from
Florida State that may be available for reproduction costs (Ted - is this
true?).  Also, I think certain flavors of the AL/S may be licensed for
government use (and certain non-distribution use) in a way that is pretty
cheap.

   I need something would run on UNIX (Sun workstations)  or ULTRIX (Vax 750).

I think the FSU stuff is on the Sun, while the ALS stuff is VAX/VMS based.

	   Has GNU made any plans to produce one?

I asked about this a year or so ago.  I seem to recall the response was
along the lines that there was more important stuff to be done, namely the
operating system, with the limited resources that they had.  It was in the
queue of things to be done, but they had no schedule or people interested in
doing the work.  I think the effort is primarily a matter of taking the
existing C (and C++) compilers, the Ada grammar, adding some semantic
analysis (non-trivial), probably having to rework some of the intermediate
language, building specialized runtimes for Ada, and possibly tweaking the
code generator(s).  Oh yeah, the optimizer.  Might actually prove to be a
useful collection of projects for a term course in compiler writing.

Many compiler vendors also provide significant educational discounts.  I
seem to recall something on the range of 70-90% off for some vendors.

-- Karl --

hudgens@ray.met.fsu.edu (Jim Hudgens) (11/18/89)

I am posting this for Dr. Baker.  Please send any responses to 
him directly, and not to me. 

--------------------------------------------------------------


This is a response to a recent message from Karl Nyberg on
"comp.lang.ada", which apparently was itself in response to a
person looking for a public-domain Ada compiler.  Since my name
and a compiler I worked on here at FSU was mentioned, I feel
compelled to fill in some information, though I'm afraid it may
not help the solve the original problem much.

Below, Karl's remarks are indicated by ">", and parts of what
appears to be the original query are indicated by ">>".

> Depends on what you mean by GOOD...  I understand there's some
> stuff from Florida State that may be available for reproduction
> costs (Ted - is this true?).

I have made copies of the FSU Ada compiler available to people who
want to use it for research or education (not for profit), without
royalty, but it is not "public domain".  FSU (and the authors)
claim copyright to this material.  (The situation is pretty much
similar to UNIX source code.)  The compiler source code and
reports are also available to government contractors through the
NTIS, I believe.

I don't claim the FSU compiler is GOOD, though I would rather
Karl's had not made the remark above.  It was a research and
educational project that started in 1980, on which Greg Riccardi
and I worked part-time with some student assistants.  It suffered
from kludges to handle massive language changes in the 1982-84
period, after major compiler design decisions had been made.  If I
had known what we were in for when we started, I would probably
not have done it.  We did stick it through, however, and validated
the compiler in 1985.  As far as I know, our compiler was the
first serious effort to produce a cross-compiler for a small
embedded computer architecture.

The hardest part of doing the compiler was getting it to meet the
nit-picking semantic requirements of validation.  The
second-hardest part was doing cross-development and repeatedly
running thousands of tests on the single-board computers (bare
16-bit machines with 48K of RAM), via 1200 baud modems.  Another
major problem was that we had to start completely from scratch.
(That is, we had to develop our own Pascal-based parser-generator
and code-generator tools, and our own bare-machine runtime
environment.)

I suspect the FSU compiler is not likely to be of much use to the
person who originated this query, since it is a cross compiler for
a very uncommon host/target pair-- CDC Cyber/Zilog Z8002.
Moreover, it has not been maintained since it was validated in
1985.  There have been significant changes in the language since
then, and I am sure it is far from passing the current validation
tests.

I and some students have ported portions of the compiler, which
was written in ETH Pascal 6000 (with peculiarities due to 60-bit
words, 6-bit characters, and memory size limitations) so that it
will compile and run under Sun/UNIX with the Berkely "pc"
compiler, but it is not completely ported, and has not been tested
much.  We have used the front-end successfully here at FSU for
several instructional and research projects.  Most recently, one
Ph.D.  student here (Ted Giering) is now using it to do
source-to-source translation of Ada programs with restricted task
structures into Ada code modules that can be scheduled
deterministically.  A M.S.  student is currently working on a
68020 code generator.

In case anyone is interested in working with the compiler, here is
a brief sketch of it: The parser and final code generator make use
of (ambiguous) S-attributed grammars, and a set of Pascal LALR(1)
parser and attribute-processor generating tools I cooked up
locally.  The final code generation is from a fairly
machine-independent form of prefix code, based on the work of
Ganapathi and Fischer.  The semantic analysis is written in
Pascal, in a LISP-like style making heavy use of linked lists and
high-level operators (with functions and procedures as
parameters).  The intermediate structures used in semantic
analysis are software-paged in and out from a direct-access disk
file, and manipulated locally via Pascal pointers.  The "middle"
of the compiler traverses the graph-like linked structures built
by the semantic analysis phase and translates them to prefix-code.
The runtime system is written in Z8002 assembly code, based on a
design originally coded in Ada.

> Also, I think certain flavors of the AL/S may be licensed for
> government use (and certain non-distribution use) in a way that is
> pretty cheap.

Yes, if you are a government contractor (and most universities
are), you ought to be able to get the original AL/S, or maybe one
of the improved variants.  It is reputed to be a great time and
space hog, but the code is written in Ada and reputed to be
readable and modifiable.  (I have not looked at it myself, so I
don't know these things for certain.)

>> I need something would run on UNIX (Sun workstations) or ULTRIX
>> (Vax 750).

> I think the FSU stuff is on the Sun, while the ALS stuff is
> VAX/VMS based.

What I recall about the AL/S agrees with Karl.  I don't think the
AL/S is available in a UNIX/ULTRIX hosted version, but again I
don't know for certain.  The FSU compiler that was validated ran
under CDC NOS, but as I have explained above we have ported parts
of it to the Sun.

I think I remember hearing that DARPA is funding David Fisher's
company, Incremental Systems, in Pittsburgh to do something they
may conceive of as a "public domain" Ada compier or front-end.  I
don't know any of the details.

>>	   Has GNU made any plans to produce one?

> I asked about this a year or so ago.  I seem to recall the
> response was along the lines that there was more important stuff
> to be done, namely the operating system, with the limited
> resources that they had.  It was in the queue of things to be
> done, but they had no schedule or people interested in doing the
> work.  I think the effort is primarily a matter of taking the
> existing C (and C++) compilers, the Ada grammar, adding some
> semantic analysis (non-trivial), probably having to rework some of
> the intermediate language, building specialized runtimes for Ada,
> and possibly tweaking the code generator(s).  Oh yeah, the
> optimizer.  Might actually prove to be a useful collection of
> projects for a term course in compiler writing.

I am sorry to hear that GNU is not interested in doing one.  I
think a GOOD public-domain Ada compiler would be a big boost to
Ada, encouraging both use of Ada and development of Ada software
tools.  One of the big problems with Ada for software tools is the
overloading.  One can't even do an accurate cross-reference
listing without doing overload resolution.  The separate
compilation and other complelx visibility rules make things even
worse.  In short, you can't do decent tools that process Ada
source code without repeating most of what is in the front end of
an Ada compiler.

I have been interested in helping out with such a public-domain
compiler for some time, but don't know where the funding would
come from.  Using the Gnu-C code generator and tools may be a good
idea, but I have some reservations.  To be really useful, the
compiler should be written in Ada.  Moreover, from what I learned
and what I have heard from others who attempted to use existing
code generators for Ada, it would require some changes to the
optimizer, code generator, and intermediate language -- hence,
ideally, cooperation with those maintaining Gnu-C.  The semantic
analysis is definitely "non-trivial", if you want to be able to
validate and also want it to run in a reasonable amount of time.
This is closely connected with the design of the semantic database
you need for separate compilation.  In short, it is a big job if
you want to produce a good quality result.

Based on my experience teaching first and second-term compiler
courses, I don't think an Ada compiler produced as a course
project would be any good.  I'd rather bet on a couple of
experienced people working full-time for about a year.

> Many compiler vendors also provide significant educational
> discounts.  I seem to recall something on the range of 70-90% off
> for some vendors.

Yes, I have seen educational and quantity commercial discounts
similar to those Karl reports.  Site licenses are also available.
We have received very reasonable prices from those vendors we have
contacted (Verdix, RR, Meridian), and I expect other vendors are
competitive.  In fact, it is clearly more effective for us here at
FSU to buy our compilers from commercial vendors and concentrate
our time on research, than to port and maintain our own compiler.

--Ted Baker

  Prof. Ted Baker, B-173
  Dept. of Computer Science
  Florida State University
  Tallahassee, FL 32306-4019
 
  (904) 644-5452
  tbaker@ajpo.sei.cmu.edu
  baker@cs.fsu.edu

-------------------------------------------------------------------
-- 
Jim Hudgens					-- Nothing to disclaim.
Dept of Meteorology, Florida State Univ.	hudgens@ray.met.fsu.edu