
The earliest known versions of Dennis Ritchie's first C compiler - jnord
https://github.com/mortdeus/legacy-cc
======
khedoros1
The Living Computer museum provides logins to several old pieces of hardware.
I wonder how many people are going to request logins to the PDP-11 to try to
build the C compiler?

~~~
technofiend
You may have your very own PDP-8, PDP-11, or PDP-10 simply by running SIMH.

~~~
khedoros1
Emulation's useful, but it's something that I've been doing in various forms
for over half of my life. There'd be a novelty to actually running something
on a 40 or 50 year old piece of refurbished hardware, adapted to run as a host
on the Internet.

~~~
technofiend
No doubt. I had a few raised eyebrows back when my company ditched a VAX
11/730 and I took it, but it was a VAX that ran on 110 and it was my very own.
Made a damn fine usenet node for the limited feed that went to it.

------
alexforster
There's type inference everywhere!

~~~
kccqzy
Or rather, undeclared types are assumed to be int. Is that what you are
talking about?

~~~
alexforster
The keyword "auto" means int?

~~~
swolchok
It means automatic storage duration (i.e., on the stack).
[https://stackoverflow.com/questions/2192547/where-is-the-
c-a...](https://stackoverflow.com/questions/2192547/where-is-the-c-auto-
keyword-used)

------
igravious
Holy heck. 1972. The year I was born.

And that PDP-11 emulator is a blast.

    
    
        RESTRICTED RIGHTS
        
        Use, duplication or disclosure is subject to
        restrictions stated in Contract with Western
        Electric Company, Inc.

------
doppioandante
How was this compiler bootstrapped?

~~~
mseepgood
By extending Ken Thompson's B compiler. The B compiler was initially written
in TMG before Thompson rewrote it in B. Then Richie added types like 'char'
and 'int' and called it NB ("new B"), then he added structs and C was born.

The TMG interpreter used by Thompson to create B was implemented for the PDP-7
by Doug McIlroy in PDP-7 assembly language:
[http://minnie.tuhs.org/pipermail/tuhs/2014-September/005149....](http://minnie.tuhs.org/pipermail/tuhs/2014-September/005149.html)

This is what TMG looked like:
[http://multicians.org/tmg.html](http://multicians.org/tmg.html)

------
federicoponzi
For some reason, I was a bit suprised for the extensive use of gotos. Thanks
for sharing this pearl!

~~~
salgernon
This is cute:

    
    
      	switch (o=symbol()) {
        ....
      /* short constant */
      	case 21:
      	case21:
    		*cp++ = block(1,21,ctyp,0,cval);
    		goto tand;
    
       .... elsewhere in the switch ....
    
            		cval = -cval;
    				goto case21;

