The earliest versions of the very first c compiler known to exist in the wild written by the late legend himself dmr.
These are not capable of being compiled today with modern c compilers like gcc. I am only posting these here for the enjoyment and reminiscing of the spark that ignited a soon to be trillion dollar industry. Enjoy. :)
You guys might be able to play around building
13 Comments
diginova
Also read how a compiler can be written in the same language – https://en.wikipedia.org/wiki/Bootstrapping_%28compilers%29
https://stackoverflow.com/a/18247926/15566831
Joker_vD
Funnily enough, it is emphatically not a single-pass compiler.
aap_
Probably one of my favorite pieces of software of all times. Learned so much from this!
bluetomcat
Interesting usage of "extern" and "auto". Quite different from contemporary C:
Looks like "extern" is used to bring global symbols into function scope. Everything looks to be "int" by default. Some array declarations are specifying a size, others are not. Are the "sizeless" arrays meant to be used as pointers only?
tanelpoder
The first publicly available version of Oracle Database (v2 released in 1979) was written in assembly for PDP-11. Then Oracle rewrote v3 in C (1983) for portability across platforms. The mainframes at the time didn't have C compilers, so instead of writing a mainframe-specific database product in a different language (COBOL?), they just wrote a C compiler for mainframes too.
dark-star
My favorite function, which some might say even made it into Windows ;-)
ChrisMarshallNY
This is my favorite function :): https://github.com/mortdeus/legacy-cc/blob/936e12cfc756773cb…
FeistySkink
Missed opportunity not calling it LegaC.
smackay
1972 is the answer to the question on the lips of everybody too busy to look at the source files.
ModernMech
I thought the first C compiler was written in B.
90s_dev
The thing I always loved about C was its simplicity, but in practice it's actually very complex with tons of nuance. Are there any low level languages like C that actually are simple, through and through? I looked into Zig and it seems to approach that simplicity, but I have reservations that I can't quite put my finger on…
tempodox
Highly interesting!
This is a culture shock. Did the PDP-11 not distinguish between `char` and `int`?
ZhiqiangWang
Can't stop thinking about Ken Thompson Hack. This should be a clean one …