Post by Olafur GunnlaugssonPost by Ken ShawPost by FruttenboelIt's just a frontend for a C
compiler. It's a disgrace to the name.
Considering that GCC started out as a C compiler with other front ends
having been added to it over time, _every_ GCC front end is a front
end for a C compiler.
GCC started out as a Pascal compiler written by Jeff Broughton at the
Afaik Pastel, the joke was that it was "off-color Pascal" It had some
problems:
"I didn't really know much about optimizing compilers at the time, because
I'd never worked on one. But I got my hands on a compiler, that I was told
at the time was free. It was a compiler called PASTEL, which the authors say
means ``off-color PASCAL''. The string type sounds UCSDish.
From a quick search that made me land at
http://www.cs.clemson.edu/~mark/s1.html:
"Pastel was a very complicated language including features such as
parametrized types and explicit type parameters and many complicated things.
The compiler was of course written in this language, and had many
complicated features to optimize the use of these things. For example: the
type ``string'' in that language was a parameterized type; you could say
``string(n)'' if you wanted a string of a particular length; you could also
just say ``string'', and the parameter would be determined from the context.
Now, strings are very important, and it is necessary for a lot of constructs
that use them to run fast, and this means that they had to have a lot of
features to detect such things as: when the declared length of a string is
an argument that is known to be constant throughout the function, to save to
save the value and optimize the code they're going to produce, many
complicated things. But I did get to see in this compiler how to do
automatic register allocation, and some ideas about how to handle different
sorts of machines.
"Well, since this compiler already compiled PASTEL, what I needed to do was
add a front-end for C, which I did, and add a back-end for the 68000 which I
expected to be my first target machine. But I ran into a serious problem.
Because the PASTEL language was defined not to require you to declare
something before you used it, the declarations and uses could be in any
order, in other words: Pascal's ``forward'' declaration was obsolete,
because of this it was necessary to read in an entire program, and keep it
in core, and then process it all at once. The result was that the
intermediate storage used in the compiler, the size of the memory needed,
was proportional to the size of your file. And this also included
stack-space, you needed gigantic amounts of stack space, and what I found as
a result was: that the 68000 system available to me could not run the
compiler. Because it was a horrible version of Unix that gave you a limit of
something like 16K words of stack, this despite the existence of six
megabytes in the machine, you could only have 16Kw of stack or something
like that. And of course to generate its conflict matrix to see which
temporary values conflicted, or was alive at the same time as which others,
it needed a quadratic matrix of bits, and that for large functions that
would get it to hundreds of thousands of bytes. So i managed to debug the
first pass of the ten or so passes of the compiler, cross compiled on to
that machine, and then found that the second one could never run.
... "The new C compiler is something that I've written this year since last
spring. I finally decided that I'd have to throw out PASTEL. This C compiler
uses some ideas taken from PASTEL, and some ideas taken from the University
of Arizona Portable Optimizer."
-- Stallman lecture at KTH (Stockholm, Sweden), October 1986
Post by Olafur GunnlaugssonThe official line used to be that M2 was never implemented due to
problems, but it later turned out that it was a political decision,
apparently "thou shall program in C and LISP", and no buts.
BTW the GCC variant was not written by Stallman as is usually credited
but by Leonard H. Tower.
Wikipedia shares the credit. But indeed, you often see Stallman credited
alone.