Earlier quoted context omitted.
Explanation: https://news.ycombinator.com/item?id=5748762
Why not just: char waste[however-many-bytes-are-needed]; ?
Dennis Ritchie’s first C compiler (c. 1972)
61–70 of 163 posts
Re: Dennis Ritchie’s first C compiler (c. 1972)
#62Re: Dennis Ritchie’s first C compiler (c. 1972)
#63Earlier quoted context omitted.
Yes, bootstrapping with regard to languages is the trick of getting that first compiler running so you can compile the rest of the compiler. It has been done many times. The first assemblers were written directly in machine language. The first compilers were written in assembly. Many implementations of FORTRAN, ALGOL, COBOL, etc. As late as the 1970s it was not unknown to write a new high level language directly in m…
> Steve Woz's BASIC for the Apple II was "hand-assembled", as he put it. Very cool - so basically (haha) Woz's integer BASIC was bootstrapped by writing it in assembly language and translating it into machine code by hand. I wonder if someone (Woz?) has written a 6502 assembler in integer BASIC to allow it to bootstrap itself?
Re: Dennis Ritchie’s first C compiler (c. 1972)
#64https://github.com/mortdeus/legacy-cc/blob/ccbe90a2803e2cc7e... “auto” exists in the initial version.
Re: Dennis Ritchie’s first C compiler (c. 1972)
#65So how do you "bootstrap" compile this? I mean without cheating, say on a rebuilt computer after all computers where destroyed?
Edit: Elsewhere in-thread, retrac posted a detailed summary of how C developed from B.
Re: Dennis Ritchie’s first C compiler (c. 1972)
#66The original keywords - https://github.com/mortdeus/legacy-cc/blob/master/last1120c/... Interestingly, long was commented
It makes sense long would have needed a comment. It needs a comment because “long” and “double” are terrible names for data types. Long what ? Double length what ? Those type names could easily have opposite meanings and meant long floating point / double length integer. WORD/DWORD are nearly as bad - calling something a "word" incorrectly implies the data type has something to do with strings. If you don't believe m…
Why should a non programmer understand programming terms? Words have different meanings in different contexts. That's how words work. There is no need to make these terms understandable to anyone. The layman does not need to understand the meaning of long or word in C source code.
Ask a non-golf player what is an eagle or ask a physicist, a mathematician and a politic the meaning of power.
Word and long may have been poor word choices, but asking a non-programmer is not a good way to test it.
Re: Dennis Ritchie’s first C compiler (c. 1972)
#67This is gold. I like how the files are named 00 01 10 11 because long filenames are scary. hshsiz 100; hshlen 800; /* 8*hshsiz */ hshtab[800]; These were at file scope. I assume they default to int, but when was the demand for = added?
IMO, it is close to Assembly:
* you reserve space and possibly set an original value with "hshsiz DB 100" or "paraml DB ?"
* assignment is a different business which involves a runtime instruction (MOV)
Hence the same difference (no = sign for the first, passive, compile-time operation; an = sign for the second, active, runtime operation) in this proto-C.
(Of course, this doesn't answer your question of "when" did the syntax of those 2 operation fuse :-) )
Re: Dennis Ritchie’s first C compiler (c. 1972)
#68Earlier quoted context omitted.
It was written in B. And B was written in B. To trace the bootstrap up into the high level, you have to go further back than the PDP-11. To bootstrap B on the PDP-7 and GE-635 machines he had access too, Ritchie wrote the minimum subset required to compile a compiler in B, in a language known as TMG (in the vein of, and a big influence on, Yacc and similar). This minimal bootstrap was then used to compile a B compile…
When people say bootstrapping, is this how all computer languages came to be? Or there has been multiple attempts at bootstrapping? What I’m getting at is whether all languages have a single root.
Re: Dennis Ritchie’s first C compiler (c. 1972)
#69https://github.com/mortdeus/legacy-cc/blob/ccbe90a2803e2cc7e... “auto” exists in the initial version.
And what does it mean there? (automatic storage duration)
Edit : I know it’s also storage specifier but it also does type deduction here, hope I’m not confused with the terminology