Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #1319

Re: ant spray

From Jean-David Beyer <jeandavid8@verizon.net>
Newsgroups comp.os.linux.misc
Subject Re: ant spray
Date 2011-06-02 11:04 -0400
Organization Institute for Regimented Whimsey
Message-ID <is88qj0nv5@news5.newsguy.com> (permalink)
References <34f7b530-8ccb-4771-b4fd-2cc240decccc@bl1g2000vbb.googlegroups.com> <9q-dndAIC41YAXrQnZ2dnUVZ_sSdnZ2d@posted.localnet>

Show all headers | View raw


Robert Heller wrote:

> 
> Gcc needs Gcc installed in order to compile Gcc.  Talk about chicken
> and egg...
> 
Ever ask how the first compiler was written? In assembler, of course.
But how was the first assembler written? Someone wrote it on paper,
assembled it on paper, and then punched the paper tape on the
FlexoWriter. Talk about lifting one's self up by ones bootstrap.

There are a lot of bootstrapping tasks in this business. It tends to be
forgotten. Booting an IBM 704 mainframe was already a challenge. The
usual way was to put a punched card into the card reader, press CLEAR,
press LOAD CARDS. That card could have up to 24 instructions on it. The
first two had to be sufficient unto themselves to load at least the rest
of the card. Those 24 instructions had to be enough to load the rest of
the deck. Then the machine was up. You probably did not want to punch
very many programs like that. So someone came up with an assembler. They
then wanted relocatable decks, libraries, etc. So the first assembler
had to be punched in, in binary. It was not much of an assembler, but it
was enough to get a better assembler in, and so on so now we have
FORTRAN, ALGOL 60, JOVIAL, ..., C++, and even higher level languages
such as SQL. It has been quite an adventure.

I wrote a couple of compilers, and I sure did not write them in binary.
One was in assembler, but it was a relatively simple language. Another I
was in a hurry, and it would not have a lot of users, perhaps several
hundred. I wrote it in SNOBOL-4 and actually compiled it in SPITBOL. I
wanted to run it on two different kinds of computers, one IBM System/360
machines, and one by Computer Control Company (24-bit machines with a
very different instruction set. Rather than provide two different code
generators to the compiler, I had it produce as output, FORTRAN-IV
source code, and let the native FORTRAN compiler produce the binaries
for the machines involved. That compiler was pretty funny. The first
pass produced FORTRAN comment cards that described concisely what was
needed. The second pass retained the comments and followed each comment
with the FORTRAN code necessary to execute the comments.

So what is the problem of writing a compiler in itself? Once the first
one is bootstrapped, all you need to do to compile one is to compile it
using the previous version. I once used and ALGOL-60 compiler that was
written in ALGOL-60. For those who do not know, ALGOL-60 was primarily
meant for mathematical work, not the kind of thing you need to write a
compiler. It was better than writing it in FORTRAN, though.


-- 
  .~.  Jean-David Beyer          Registered Linux User 85642.
  /V\  PGP-Key: 9A2FC99A         Registered Machine   241939.
 /( )\ Shrewsbury, New Jersey    http://counter.li.org
 ^^-^^ 10:40:01 up 1 day, 19:11, 3 users, load average: 5.06, 4.97, 4.88

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

ant spray "john@wexfordpress.com" <john@wexfordpress.com> - 2011-06-02 06:00 -0700
  Re: ant spray Robert Heller <heller@deepsoft.com> - 2011-06-02 09:23 -0500
    Re: ant spray "john@wexfordpress.com" <john@wexfordpress.com> - 2011-06-02 07:43 -0700
    Re: ant spray John Hasler <jhasler@newsguy.com> - 2011-06-02 09:40 -0500
    Re: ant spray Jean-David Beyer <jeandavid8@verizon.net> - 2011-06-02 11:04 -0400
      Re: ant spray "Charlie Gibbs" <cgibbs@kltpzyxm.invalid> - 2011-06-03 10:27 -0800
        Re: ant spray Alan Meyer <ameyer2@yahoo.com> - 2011-06-06 16:43 -0400
          Re: ant spray Alan Meyer <ameyer2@yahoo.com> - 2011-06-06 16:47 -0400

csiph-web