From mboxrd@z Thu Jan 1 00:00:00 1970 From: wkt@tuhs.org (Warren Toomey) Date: Tue, 27 Sep 2005 08:04:29 +1000 Subject: [TUHS] C compiler In-Reply-To: <001801c5c2d0$7c87fc40$2f01a8c0@myhome.westell.com> References: <001801c5c2d0$7c87fc40$2f01a8c0@myhome.westell.com> Message-ID: <20050926220429.GA88706@minnie.tuhs.org> On Mon, Sep 26, 2005 at 03:28:33PM -0400, Bill Cunningham wrote: > In some of the eary versions of unix if I'm correct you had to generate > the C compiler. Now how was that done? Was the compiler written in assembly > and the assembler generated crt0 crt1 and so on? If you had a distribution tape, then it came with C compiler binaries and source. You used the compiler binaries to rebuild the compiler. Obviously, to get to that point was a bit harder. A good reference to this is "The Development of the C Language" by Dennis Ritchie, available at http://cm.bell-labs.com/cm/cs/who/dmr/chist.html A quick read seems to indicate that Ken created a language called B which was patterned on BCPL, with a compiler initially in assembly language. Then Ken rewrote the B compiler in B and bootstrapped it using the existing compiler. Then Dennis extended the B language to become NB, which then evolved to become C. Along the way, new language features were added in to the compiler, but the features couldn't be used _in_ the compiler until they worked. As noted on this page, http://cm.bell-labs.com/cm/cs/who/dmr/primevalC.html, Dennis says "Evolving compilers written in their own language are careful not to take advantage of their own latest features." Cheers, Warren