comp.lang.ada
 help / color / mirror / Atom feed
* The making of compilers
@ 2002-02-24 23:45 tony gair
  2002-02-25 12:53 ` Marc A. Criley
                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: tony gair @ 2002-02-24 23:45 UTC (permalink / raw)


After sticking my neck out and being shot out out of the sky by the big
guns.....................................

I heard from a lecturer in 1990 that compilers were built by writing a
language subset compiler in assembler (or C or C++ or.....) and then by
using that subset to step by step extend the language to its desired form.

And he was really clever he was , he had glasses and a beard and everything.







^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-02-24 23:45 The making of compilers tony gair
@ 2002-02-25 12:53 ` Marc A. Criley
  2002-02-25 14:55 ` Robert Dewar
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: Marc A. Criley @ 2002-02-25 12:53 UTC (permalink / raw)


tony gair wrote:
> 
> After sticking my neck out and being shot out out of the sky by the big
> guns.....................................
> 
> I heard from a lecturer in 1990 that compilers were built by writing a
> language subset compiler in assembler (or C or C++ or.....) and then by
> using that subset to step by step extend the language to its desired form.

That is one approach to coding a compiler.  Another is writing it in a
different language, such as the "C-path" Ada compilers, or writing a
VHDL compiler in Pascal (and Univac Pascal at that!) as I did many years
ago.  Then there's implementing it using a different version of the same
language, like writing an Ada 95 compiler with Alsys Ada 83--which I
recall hearing is how GNAT started out.

> 
> And he was really clever he was , he had glasses and a beard and everything.

No glasses, but I do have a beard and long hair, just like Dr.
Science!   :-) :-)

Marc A. Criley
Consultant
Quadrus Corporation
www.quadruscorp.com



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-02-24 23:45 The making of compilers tony gair
  2002-02-25 12:53 ` Marc A. Criley
@ 2002-02-25 14:55 ` Robert Dewar
  2002-02-27  1:16   ` Adrian Hoe
  2002-02-26  1:05 ` Nick Roberts
  2002-03-01  2:58 ` Keith Thompson
  3 siblings, 1 reply; 23+ messages in thread
From: Robert Dewar @ 2002-02-25 14:55 UTC (permalink / raw)


"tony gair" <tonygair@nespamtome.btinternet.com> wrote in message news:<a5btuv$f62$1@knossos.btinternet.com>...
> After sticking my neck out and being shot out out of the sky by the big
> guns.....................................
> 
> I heard from a lecturer in 1990 that compilers were built 
> by writing a language subset compiler in assembler (or C 
> or C++ or.....) and then by using that subset to step by 
> step extend the language to its desired form.

Yes, that's indeed the most reasonable approach if there are no
existing compilers for the language. For example, Alsys Ada was
initially implemented using a subset compiler written in PL/1.

By the time GNAT was being created, the Alsys compiler
already existed, and we first wrote in Ada 83, and bootstrapped using
the Alsys compiler on a Sun, then once
we were bootstrapped, we step by step extended, so that
now we use quite a lot of Ada 95 features.

> And he was really clever he was , he had glasses and a 
> beard and everything.

I am not sure of the reason for this frivolous comment,
but he was giving a perfectly reasonable account of how
things are done. Your tone seems to indicate skepticism,
but in this case I am afraid the skepticism comes from
ignorance, and glasses-and-beard knew what he was talking
about :-)



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-02-24 23:45 The making of compilers tony gair
  2002-02-25 12:53 ` Marc A. Criley
  2002-02-25 14:55 ` Robert Dewar
@ 2002-02-26  1:05 ` Nick Roberts
  2002-02-26  2:22   ` GVD for Mac OS X? Michael Card
  2002-02-26 15:16   ` The making of compilers tony gair
  2002-03-01  2:58 ` Keith Thompson
  3 siblings, 2 replies; 23+ messages in thread
From: Nick Roberts @ 2002-02-26  1:05 UTC (permalink / raw)


On Sun, 24 Feb 2002 23:45:35 +0000 (UTC), "tony gair"
<tonygair@nespamtome.btinternet.com> strongly typed:

>I heard from a lecturer in 1990 that compilers were built by writing a
>language subset compiler in assembler (or C or C++ or.....) and then by
>using that subset to step by step extend the language to its desired form.

Where is this question leading, Tony?

-- 
Nick Roberts



^ permalink raw reply	[flat|nested] 23+ messages in thread

* GVD for Mac OS X?
  2002-02-26  1:05 ` Nick Roberts
@ 2002-02-26  2:22   ` Michael Card
  2002-02-26  4:52     ` jim
  2002-02-26 15:16   ` The making of compilers tony gair
  1 sibling, 1 reply; 23+ messages in thread
From: Michael Card @ 2002-02-26  2:22 UTC (permalink / raw)


Hello CLA-

Does anyone know if GVD will be ported to mac OS X? I know it comes
bundled with GNAT for Solaris, but I did not now if it was/will be
included with the Mac OS X beta of GNAT.

- Mike



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: GVD for Mac OS X?
  2002-02-26  2:22   ` GVD for Mac OS X? Michael Card
@ 2002-02-26  4:52     ` jim
  0 siblings, 0 replies; 23+ messages in thread
From: jim @ 2002-02-26  4:52 UTC (permalink / raw)


Already done.  Alan and Drew Reynolds have got it running and will be
posting it on the mac os x website at www.adapower.net/macos real soon
now.

info on this kind of thing is better addressed to the mac os x ada
mailing list.  info on subscribing is at the above website url.

best jim


In article
<250220022121524662%thehouseofcards@remove.this.part.mac.com>, Michael
Card <thehouseofcards@remove.this.part.mac.com> wrote:

> Hello CLA-
> 
> Does anyone know if GVD will be ported to mac OS X? I know it comes
> bundled with GNAT for Solaris, but I did not now if it was/will be
> included with the Mac OS X beta of GNAT.
> 
> - Mike



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-02-26  1:05 ` Nick Roberts
  2002-02-26  2:22   ` GVD for Mac OS X? Michael Card
@ 2002-02-26 15:16   ` tony gair
  2002-02-26 15:33     ` Hyman Rosen
                       ` (2 more replies)
  1 sibling, 3 replies; 23+ messages in thread
From: tony gair @ 2002-02-26 15:16 UTC (permalink / raw)



"Nick Roberts" <nickroberts@ukf.net> wrote in message
news:3c7ad99f.19503740@news.cis.dfn.de...
> On Sun, 24 Feb 2002 23:45:35 +0000 (UTC), "tony gair"
> <tonygair@nespamtome.btinternet.com> strongly typed:
>
> >I heard from a lecturer in 1990 that compilers were built by writing a
> >language subset compiler in assembler (or C or C++ or.....) and then by
> >using that subset to step by step extend the language to its desired
form.
>
> Where is this question leading, Tony?
>
> --
> Nick Roberts
Nick,

When I heard this method I was fascinated by the elegance of it. I was also
very
interested to hear the responses of M Criley and 99% of R Dewar's who both
gave
interesting examples of constructing their own compilers

I did not know where the question was leading but I was seeking to validate
the approach I
heard was used, which was after all, a long time ago. And if I dare say it,
hear of ways other people
have made their compilers.

Tony





^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-02-26 15:16   ` The making of compilers tony gair
@ 2002-02-26 15:33     ` Hyman Rosen
  2002-02-28 22:09     ` Nick Roberts
  2002-03-01  5:02     ` Robert Dewar
  2 siblings, 0 replies; 23+ messages in thread
From: Hyman Rosen @ 2002-02-26 15:33 UTC (permalink / raw)


tony gair wrote:
> When I heard this method I was fascinated by the elegance of it.
 > I was also very interested to hear the responses of M Criley and
 > 99% of R Dewar's who both gave interesting examples of constructing
 > their own compilers

Dewar was also involved in creating Realia COBOL,
which was also written in itself.




^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-02-25 14:55 ` Robert Dewar
@ 2002-02-27  1:16   ` Adrian Hoe
  2002-02-27 17:46     ` Jeffrey Carter
  0 siblings, 1 reply; 23+ messages in thread
From: Adrian Hoe @ 2002-02-27  1:16 UTC (permalink / raw)


dewar@gnat.com (Robert Dewar) wrote in message news:<5ee5b646.0202250655.6fd2bfb8@posting.google.com>...
> "tony gair" <tonygair@nespamtome.btinternet.com> wrote in message news:<a5btuv$f62$1@knossos.btinternet.com>...
> > After sticking my neck out and being shot out out of the sky by the big
> > guns.....................................
> > 
> > I heard from a lecturer in 1990 that compilers were built 
> > by writing a language subset compiler in assembler (or C 
> > or C++ or.....) and then by using that subset to step by 
> > step extend the language to its desired form.
> 
> Yes, that's indeed the most reasonable approach if there are no
> existing compilers for the language. For example, Alsys Ada was
> initially implemented using a subset compiler written in PL/1.
> 
> By the time GNAT was being created, the Alsys compiler
> already existed, and we first wrote in Ada 83, and bootstrapped using
> the Alsys compiler on a Sun, then once
> we were bootstrapped, we step by step extended, so that
> now we use quite a lot of Ada 95 features.
> 
> > And he was really clever he was , he had glasses and a 
> > beard and everything.
> 
> I am not sure of the reason for this frivolous comment,
> but he was giving a perfectly reasonable account of how
> things are done. Your tone seems to indicate skepticism,
> but in this case I am afraid the skepticism comes from
> ignorance, and glasses-and-beard knew what he was talking
> about :-)

Interesting! One can find a lot of Ada resources on the net. History,
codes, compilers, etc. Why there isn't any Ada compilers' histories?
This could be very interesting topic to add to the Ada resources.

                              -- Adrian Hoe
                              -- http://greenlime.com/users/adrian.hoe



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-02-27  1:16   ` Adrian Hoe
@ 2002-02-27 17:46     ` Jeffrey Carter
  2002-03-01  5:00       ` Robert Dewar
  0 siblings, 1 reply; 23+ messages in thread
From: Jeffrey Carter @ 2002-02-27 17:46 UTC (permalink / raw)


Adrian Hoe wrote:
> 
> dewar@gnat.com (Robert Dewar) wrote in message news:<5ee5b646.0202250655.6fd2bfb8@posting.google.com>...
> > Yes, that's indeed the most reasonable approach if there are no
> > existing compilers for the language. For example, Alsys Ada was
> > initially implemented using a subset compiler written in PL/1.

My recollection of a talk by Ichbiah (at the time) was that they wrote
the Alsys compiler in Ada 83 and wrote a program (presumably in PL/1) to
translate Ada 83 to PL/1. Once the executable worked well enough, of
course, they stopped using the translator and just compiled the compiler
with the compiler.

-- 
Jeffrey Carter
Beard, but no glasses since LASIK (except reading glasses)



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-02-26 15:16   ` The making of compilers tony gair
  2002-02-26 15:33     ` Hyman Rosen
@ 2002-02-28 22:09     ` Nick Roberts
  2002-02-28 22:14       ` Pat Rogers
  2002-03-01  5:02     ` Robert Dewar
  2 siblings, 1 reply; 23+ messages in thread
From: Nick Roberts @ 2002-02-28 22:09 UTC (permalink / raw)


On Tue, 26 Feb 2002 15:16:50 +0000 (UTC), "tony gair"
<tonygair@nespamtome.btinternet.com> strongly typed:

>...
>When I heard this method I was fascinated by the elegance of it. I was
>also very interested to hear the responses of M Criley and 99% of R 
>Dewar's who both gave interesting examples of constructing their own
>compilers.
>
>I did not know where the question was leading but I was seeking to
>validate the approach I heard was used, which was after all, a long time
>ago. And if I dare say it, hear of ways other people have made their
>compilers.

Well, as a member of AdaOS, Tony, you will know I'm writing an Ada
compiler.

The method I'm using couldn't be more different: I'm writing a 'hardened'
Prolog-like interpreter (CGL); the compiler will then be programmed in this
language, as a large set of declarations which, in essence, successively
transform structures (until we get to machine code).

Of course, whether this approach is any good or not is another question
entirely. ;-)

However, your interest is interesting to me! I will be seeking assistance
with the compiler, once I've got the CGL interpreter working (probably late
this year).

Assistants will need to be familiar with (or willing to learn): the
nitty-gritty of Ada 95; assembly programming and the 32-bit Intel
Architecture; the basics of compilation; practical declarative programming
(preferably Prolog). Offers most welcome!

-- 
Nick Roberts



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-02-28 22:09     ` Nick Roberts
@ 2002-02-28 22:14       ` Pat Rogers
  0 siblings, 0 replies; 23+ messages in thread
From: Pat Rogers @ 2002-02-28 22:14 UTC (permalink / raw)


"Nick Roberts" <nickroberts@ukf.net> wrote in message
news:3c7e7534.6355746@news.cis.dfn.de...
> On Tue, 26 Feb 2002 15:16:50 +0000 (UTC), "tony gair"
> <tonygair@nespamtome.btinternet.com> strongly typed:
<snip>
> The method I'm using couldn't be more different: I'm writing a 'hardened'
> Prolog-like interpreter (CGL); the compiler will then be programmed in this
> language, as a large set of declarations which, in essence, successively
> transform structures (until we get to machine code).
>
> Of course, whether this approach is any good or not is another question
> entirely. ;-)

Are you familiar with the original Ada/Ed compiler, written in SetL?





^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-02-24 23:45 The making of compilers tony gair
                   ` (2 preceding siblings ...)
  2002-02-26  1:05 ` Nick Roberts
@ 2002-03-01  2:58 ` Keith Thompson
  2002-03-01  5:35   ` OT, was " tmoran
  2002-03-01 19:35   ` Robert Dewar
  3 siblings, 2 replies; 23+ messages in thread
From: Keith Thompson @ 2002-03-01  2:58 UTC (permalink / raw)


"tony gair" <tonygair@nespamtome.btinternet.com> writes:
> After sticking my neck out and being shot out out of the sky by the big
> guns.....................................
> 
> I heard from a lecturer in 1990 that compilers were built by writing a
> language subset compiler in assembler (or C or C++ or.....) and then by
> using that subset to step by step extend the language to its desired form.

That's a pretty common approach.  These days, though, there's almost
never any need to start with assembler; it's far easier to start with
a higher-level language.

The first-generation TeleSoft Ada subset compiler, which I used to
work on, was written in Pascal.  The version of Pascal we used was
derived from UCSD Pascal.  (The Pascal compiler compiled itself, and
had done so for several generations of development; I don't know how
it was first bootstrapped.)

Once the first-generation subset compiler was sufficiently reliable
and supported enough features, the second-generation compiler was
written in the Ada subset supported by the first-generation compiler.
After a while, the second-generation compiler was expanded to support
all the features supported by the first-generation compiler.  At that
point, we started using the second-generation compiler to compile
itself, and pretty much abandoned both the first-generation Ada subset
compiler and the Pascal compiler.  The hosting compiler was usually a
few generations behind the product compiler, and was updated less
often.

Note that a compiler doesn't necessarily have to be self-hosting;
there are advantages and disadvantages.  One advantage is that you
only have one language to support, and if you run across a bug in the
hosting compiler, you can probably fix it yourself.  Also, increases
in the speed of the generated code result in faster compilation speed
as soon as you change hosting compilers.

On the other hand, the language you're implementing may not be a good
one for implementing compilers.  You could write a Fortran compiler in
Fortran (I'm sure it's been done), but personally I'd rather use Ada
or some other more suitable systems language.  It *may* be possible to
create an Intercal implementation in Intercal, but it's certainly not
a sane idea.  (I would have thought that Cobol was a poor language for
implementing a compiler, but Robert Dewar and others apparently did
just that with Realia Cobol.)

-- 
Keith Thompson (The_Other_Keith) kst@cts.com  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-02-27 17:46     ` Jeffrey Carter
@ 2002-03-01  5:00       ` Robert Dewar
  2002-03-01 17:33         ` Jeffrey Carter
  0 siblings, 1 reply; 23+ messages in thread
From: Robert Dewar @ 2002-03-01  5:00 UTC (permalink / raw)


Jeffrey Carter <jeffrey.carter@boeing.com> wrote in message news:<3C7D1B7A.5A17002E@boeing.com>...
> My recollection of a talk by Ichbiah (at the time) was that they wrote
> the Alsys compiler in Ada 83 and wrote a program (presumably in PL/1) to
> translate Ada 83 to PL/1. Once the executable worked well enough, of
> course, they stopped using the translator and just compiled the compiler
> with the compiler.


Yes, that's exactly right, and that's what I meant by a
subset compiler written in PL/1 (converting Ada to another
language is one possible way of writing a compiler for
Ada, even today there are Ada 95 compilers that work by
translating to C).



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-02-26 15:16   ` The making of compilers tony gair
  2002-02-26 15:33     ` Hyman Rosen
  2002-02-28 22:09     ` Nick Roberts
@ 2002-03-01  5:02     ` Robert Dewar
  2002-03-01  8:25       ` tony gair
  2 siblings, 1 reply; 23+ messages in thread
From: Robert Dewar @ 2002-03-01  5:02 UTC (permalink / raw)


"tony gair" <tonygair@nespamtome.btinternet.com> wrote in message news:<a5g8t2$97b$1@helle.btinternet.com>...
> I was also very interested to hear the responses of M.
> Criley and 99% of R Dewar's who both gave
> interesting examples of constructing their own compilers

Very entertaining response (especially the 99% :-) :-)



^ permalink raw reply	[flat|nested] 23+ messages in thread

* OT, was Re: The making of compilers
  2002-03-01  2:58 ` Keith Thompson
@ 2002-03-01  5:35   ` tmoran
  2002-03-01 19:35   ` Robert Dewar
  1 sibling, 0 replies; 23+ messages in thread
From: tmoran @ 2002-03-01  5:35 UTC (permalink / raw)


There was a company in the 1960's, I think, that developed some technology
for making fast Fortran compilers (or making Fortran compilers, fast?).
They had lots of ads and presumably took the (Fortran) world by storm.
Does this ring any bells with anyone?



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-03-01  5:02     ` Robert Dewar
@ 2002-03-01  8:25       ` tony gair
  0 siblings, 0 replies; 23+ messages in thread
From: tony gair @ 2002-03-01  8:25 UTC (permalink / raw)



"Robert Dewar" <dewar@gnat.com> wrote in message
news:5ee5b646.0202282102.7aeb0a63@posting.google.com...
> "tony gair" <tonygair@nespamtome.btinternet.com> wrote in message
news:<a5g8t2$97b$1@helle.btinternet.com>...
> > I was also very interested to hear the responses of M.
> > Criley and 99% of R Dewar's who both gave
> > interesting examples of constructing their own compilers
>
> Very entertaining response (especially the 99% :-) :-)

Go and ................. write a compiler or something...






^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-03-01  5:00       ` Robert Dewar
@ 2002-03-01 17:33         ` Jeffrey Carter
  2002-03-01 19:03           ` Florian Weimer
  0 siblings, 1 reply; 23+ messages in thread
From: Jeffrey Carter @ 2002-03-01 17:33 UTC (permalink / raw)


Robert Dewar wrote:
> 
> Jeffrey Carter <jeffrey.carter@boeing.com> wrote in message news:<3C7D1B7A.5A17002E@boeing.com>...
> > My recollection of a talk by Ichbiah (at the time) was that they wrote
> > the Alsys compiler in Ada 83 and wrote a program (presumably in PL/1) to
> > translate Ada 83 to PL/1. Once the executable worked well enough, of
> > course, they stopped using the translator and just compiled the compiler
> > with the compiler.
> 
> Yes, that's exactly right, and that's what I meant by a
> subset compiler written in PL/1 (converting Ada to another
> language is one possible way of writing a compiler for
> Ada, even today there are Ada 95 compilers that work by
> translating to C).

I guess we use different terms for the same thing: I wouldn't use the
term "written in PL/1" to describe translating Ada to PL/1 anymore than
I'd say something compiled using a compiler that outputs C was "written
in C".

-- 
Jeffrey Carter



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-03-01 17:33         ` Jeffrey Carter
@ 2002-03-01 19:03           ` Florian Weimer
  0 siblings, 0 replies; 23+ messages in thread
From: Florian Weimer @ 2002-03-01 19:03 UTC (permalink / raw)


Jeffrey Carter <jeffrey.carter@boeing.com> writes:

> I guess we use different terms for the same thing: I wouldn't use the
> term "written in PL/1" to describe translating Ada to PL/1 anymore than
> I'd say something compiled using a compiler that outputs C was "written
> in C".

Isn't the language called "PL/I"?



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-03-01  2:58 ` Keith Thompson
  2002-03-01  5:35   ` OT, was " tmoran
@ 2002-03-01 19:35   ` Robert Dewar
  2002-03-01 21:15     ` Keith Thompson
                       ` (2 more replies)
  1 sibling, 3 replies; 23+ messages in thread
From: Robert Dewar @ 2002-03-01 19:35 UTC (permalink / raw)


Keith Thompson <kst@cts.com> wrote in message news:<yecelj5c7uh.fsf@king.cts.com>...
> I would have thought that Cobol was a poor language for
> implementing a compiler, but Robert Dewar and others 
> apparently did just that with Realia Cobol.

My guess is that Keith is not a COBOL expert :-) Seriously
usually this kind of opinion comes from people who do not
know COBOL well. COBOL is a general purpose language with
many attractive features, and is perfectly suitable for
writing compilers.

In our case, one of the really big advantages in writing
the COBOL compiler in COBOL was speed, the Realia COBOL
compiler is far far faster than other compilers around
for the PC. To give an idea of the speed, on a 25MHz
386, the compiler (about 120K Sloc) would bootstrap in
under two minutes. Of course on a modern fast PC, running
perhaps 40 times faster, that should be down to well
under 10 seconds (I have not run it recently). That kind
of speed is welcome when developing large programs such
as a compiler :-)

Robert Dewar



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-03-01 19:35   ` Robert Dewar
@ 2002-03-01 21:15     ` Keith Thompson
  2002-03-02  0:50     ` John H. Lindsay
  2002-03-02  1:13     ` Adrian Hoe
  2 siblings, 0 replies; 23+ messages in thread
From: Keith Thompson @ 2002-03-01 21:15 UTC (permalink / raw)


dewar@gnat.com (Robert Dewar) writes:
> Keith Thompson <kst@cts.com> wrote in message
> news:<yecelj5c7uh.fsf@king.cts.com>...
> > I would have thought that Cobol was a poor language for
> > implementing a compiler, but Robert Dewar and others 
> > apparently did just that with Realia Cobol.
> 
> My guess is that Keith is not a COBOL expert :-)

You are quite correct.  Most of my exposure to COBOL consists of a
couple of hours of lecture in a comparative programming languages
class.  We spent a week on Fortran and COBOL; the instructor said it
was for resume purposes.

> Seriously usually this kind of opinion comes from people who do not
> know COBOL well. COBOL is a general purpose language with many
> attractive features, and is perfectly suitable for writing
> compilers.

Insert old "ADD ONE TO COBOL" joke here.  8-)}

Now, if you can write a self-hosting Intercal compiler, I'll be
impressed.  You can bootstrap it using Malbolge if you like.  (Topic?
What topic?)

-- 
Keith Thompson (The_Other_Keith) kst@cts.com  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-03-01 19:35   ` Robert Dewar
  2002-03-01 21:15     ` Keith Thompson
@ 2002-03-02  0:50     ` John H. Lindsay
  2002-03-02  1:13     ` Adrian Hoe
  2 siblings, 0 replies; 23+ messages in thread
From: John H. Lindsay @ 2002-03-02  0:50 UTC (permalink / raw)


Hi folks:

Robert Dewar wrote:
> 
> Keith Thompson <kst@cts.com> wrote in message news:<yecelj5c7uh.fsf@king.cts.com>...
> > I would have thought that Cobol was a poor language for
> > implementing a compiler, but Robert Dewar and others
> > apparently did just that with Realia Cobol.
> 
> My guess is that Keith is not a COBOL expert :-) Seriously
> usually this kind of opinion comes from people who do not
> know COBOL well. COBOL is a general purpose language with
> many attractive features, and is perfectly suitable for
> writing compilers.
.....

I'll take Robert's word on this due to his direct experience 
with using COBOL for this and wide experience with compilers 
in general, but OTOH I have to say that it's possible to 
botch even the best choice-of-language situations with bad 
programming.  My case in point is the Burroughs Large 
Systems GPSS compiler, coded in Burroughs COBOL, a most 
difficult choice due to the capabilities of the (B) COBOL 
and some other COBOLs at that time (1975..1980).  (All the 
other (B) compilers, as far as I know, were written in (B) 
Algol 60 with its considerable extensions, a language that 
had a very strong relation to the (B) Large Systems hardware.)  
The COBOL language difficulties were subsequently fixed 
(STRING and UNSTRING, e.g. among other things) but the bad 
organization and bad coding made it terrible to use; it was 
as slow as maple syrup in Igloovik, produced inscrutable 
error messages and results that I couldn't account for.
The print-out of the compiler was about 60% Data Division 
and about 8 or 9 cm thick, and I had great difficulty 
following any of it to fix bits.  Other (B) compilers were 
pretty good and much much smaller on the whole.  

John.

-- 
John H. Lindsay                        jlindsay@kingston.net



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: The making of compilers
  2002-03-01 19:35   ` Robert Dewar
  2002-03-01 21:15     ` Keith Thompson
  2002-03-02  0:50     ` John H. Lindsay
@ 2002-03-02  1:13     ` Adrian Hoe
  2 siblings, 0 replies; 23+ messages in thread
From: Adrian Hoe @ 2002-03-02  1:13 UTC (permalink / raw)


dewar@gnat.com (Robert Dewar) wrote in message news:<5ee5b646.0203011135.12a13558@posting.google.com>...
> Keith Thompson <kst@cts.com> wrote in message news:<yecelj5c7uh.fsf@king.cts.com>...
> > I would have thought that Cobol was a poor language for
> > implementing a compiler, but Robert Dewar and others 
> > apparently did just that with Realia Cobol.
> 
> My guess is that Keith is not a COBOL expert :-) Seriously
> usually this kind of opinion comes from people who do not
> know COBOL well. COBOL is a general purpose language with
> many attractive features, and is perfectly suitable for
> writing compilers.
> 
> In our case, one of the really big advantages in writing
> the COBOL compiler in COBOL was speed, the Realia COBOL
> compiler is far far faster than other compilers around
> for the PC. To give an idea of the speed, on a 25MHz
> 386, the compiler (about 120K Sloc) would bootstrap in
> under two minutes. Of course on a modern fast PC, running
> perhaps 40 times faster, that should be down to well
> under 10 seconds (I have not run it recently). That kind
> of speed is welcome when developing large programs such
> as a compiler :-)
> 
> Robert Dewar


I remembered that I had worked on a COBOL project 10 years ago. I
wrote a command parser entirely in COBOL for my company project, fMRP.
This parser would parse business rules entered by its users. As I
still remembered, it contained not less than 9K SLOC.

I am not surprised that one can write a compiler using COBOL. :)

                                       -- Adrian Hoe
                                       -- http://adrianhoe.com



^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2002-03-02  1:13 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-24 23:45 The making of compilers tony gair
2002-02-25 12:53 ` Marc A. Criley
2002-02-25 14:55 ` Robert Dewar
2002-02-27  1:16   ` Adrian Hoe
2002-02-27 17:46     ` Jeffrey Carter
2002-03-01  5:00       ` Robert Dewar
2002-03-01 17:33         ` Jeffrey Carter
2002-03-01 19:03           ` Florian Weimer
2002-02-26  1:05 ` Nick Roberts
2002-02-26  2:22   ` GVD for Mac OS X? Michael Card
2002-02-26  4:52     ` jim
2002-02-26 15:16   ` The making of compilers tony gair
2002-02-26 15:33     ` Hyman Rosen
2002-02-28 22:09     ` Nick Roberts
2002-02-28 22:14       ` Pat Rogers
2002-03-01  5:02     ` Robert Dewar
2002-03-01  8:25       ` tony gair
2002-03-01  2:58 ` Keith Thompson
2002-03-01  5:35   ` OT, was " tmoran
2002-03-01 19:35   ` Robert Dewar
2002-03-01 21:15     ` Keith Thompson
2002-03-02  0:50     ` John H. Lindsay
2002-03-02  1:13     ` Adrian Hoe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox