Does anybody have any good resources on the history of the popularity of C? I'm looking for data to resolve a claim that C is so prolific and influential because it's so easy to write a C compiler.
Hmmmm, I don't know what's been written, but old Dr. Dobbs and Byte Mag are where I would start from 1975-85 (which I have in my attic, but lack a good index).
Let me give you my experience and recollections, although Larry may scream that catalog of memories he is colored by what he likes to call the UNIX club.
Academics in the mid-late 70s all got UNIX with full sources to originally the Ritchie C Compiler and later the Johnson compiler. Plus had access to yacc/lex and the first editions of the dragon book.
Before C (or B) shows up there already were 'system programming languages' such as BCPL, BLISS, PL/360, and ESPOL (much leads full languages like Fortran, Algol family, PL/1) which people were also trying to use for systems work.
In '73, C had been retargeted for the PDP-10 by Alan Snyder @ MIT https://github.com/PDP-10/Snyder-C-compiler, but I believe that was a rewrite not a port of the Ritchie compiler. I believe this was the first retarget, at least outside of the MH. Before that C has been retargeted to the Honeywell, Interdata and I believe the S/360 -- Steve and Doug can probably say more.
The 8-bit microprocessor arrives on the scene in 75 and the 16-bit ones 4 years later. Many of us at different universities wrote assemblers and linkers for the same, often in C under UNIX. CMU had a SAIL based 6502 assembler in the CS Dept that was used to burn ROMs, but it ran on the PDP-10. There must have been an 8080 assembler over there too, but I don't remember it. The 10s were more difficult to use in the EE building and tough to use with the KIM-1s. I wrote one for the 6502, 8085, and the Z80 for the EE department on our 11/34 UNIX V6 system. Ted Kowalski wrote the predecessor to the eventual UNIX cu(1) program, which we called connect(1) that allowed us to download code to the KIM's (and other micros) from the UNIX systems that we had in the EE lab (which he took back to USG, was rewritten and went into both PWB and eventually TS and V7).
The Purdue 8-bit micro suite would eventually become popular because it supported full relocation and linker, which microprocessor support tools like the one I wrote did not. There was group at Purdue in EE that started to retarget the Ritchie C Compiler, but I've lost track what happen. Mike Zuhl or Ward Cummingham might remember what became of that (more in a minute) - I'm pretty sure Ward was mixed up in the that -- check his web site you might find stuff there, or we can ask either of them (Steinhart might know some of it too, as we all working with the original Microprocessor team in Tek Walker Road in the late 1970s).
The first microprocessor targeted C compiler I personally used was the one from Teletype Corporation which had retargeted the Ritchie C Compiler to the Z80 in 1977/78 IIRC (that Phil Karn brought to CMU). He and I hacked it to use my assembler and got it to spit out 8085 code for our semester project for Steely Dan's Real-Time course. This was the original C compiler he used for the KA9Q TCP/IP, although at some point he switched Leor Zohlman's Brain-Damaged Systems (BDS) compiler (https://en.wikipedia.org/wiki/BDS_C) after we both left CMU.
In the late 1970s (
'78 I think), Dennis Allison was teaching
a course at Stanford. The assignment was to developed TinyBasic
(for the 6502
IIRC). Some of these got presented at an early AMW (talk to Bob Berg if you want try to find the date).
This idea spread to a lot of places and the idea of 'TinyX' or SmallX was started. By the late 1979/early 1980, Ron Cain (one of his students I believe) used an SRI based UNIX system to develop his 'Small C' that he would publish the sources to in Byte and eventually a book that was used to teach (which I still have): https://en.wikipedia.org/wiki/Small-C. The Small C compiler would get retargeted to the other 8-bit micros and you can find most of them with a search engine.
The best I can tell, Leor and Ron worked independently of each other. Leor's compiler was a tad more complete and he actually wrote a UNIX clone for the Z80 with it (I don't remember if Leor has fp support, Ron did not). Leor had access to the Ritchie compiler, but he seems to have written it himself (you can search for and download the sources and decide yourself). Leor showed many of us his systems running on 3 8" floppies at the Boston USENIX in the early 1980s [I remember dmr playing with it and remarked how much it reminded him of early UNIX on the PDP-11].
Also, after I left CMU in 1979, I took the Ritchie compiler and retargeted to what would become the 68000 (it was not yet released or numbered when I started). Paul Blanter of Tek labs wrote the assembler and Steve Glaser and I hacked v7's ld a little. This was the original tool suite for the Magnolia system. The folks in the MIT RTS Group had started to retarget the Johnson compilers to the 8086, the 68000 and eventually the Z8000 as part of the NU project and Trix (I know Jack Test, who had previously been at Stanford had is hand in this -- tjt wrote the MIT 68000 assembler that used an MIT hacked version of V7's old, I think John Siber did the C8086). Around the same time, CMU started the Mach project and created the macho format. Robert Baron and Mike Accetta were heavily involved, but I think they took the MIT compilers as the basis for some of that work.
At some point (Steve can fill us in) I thought someone in USG started to retarget his compilers for USG. This is the source of the AT&T assembler and is what ISC started with when they did the 386 ports a few years later for AT&T that Heinz talked about a few weeks ago.
Meanwhile, Gordon Letwin who had been Purdue, EE, brought the Purdue assemblers and forked from the C compiler work at some point. He and Bob Greenberg did the start of the compilers for original Xenix work for the 8086, we would have to ask Bob or Gordon for more details [Gordon is believed to be the source the terrible curse, called the 'far' pointer].
By the early 1980s, a number of UNIX ports start and many C Compilers show up. I think the John Bass did the Onyx Z8000 C compiler independent of the MIT code base, but the MIT NU C compilers and the NU UNIX port would become used by a lot of the 'JAWS' work that would start to ramp in the early 1980s.
Anyway -- the point is we all had access to the UNIX sources (sorry Larry) we start to hack on them. Plus different Universities doing compiler work, like Andy Tannenbaum release compilers (ACK) independent of the AT&T code origin but built/bootstrapped from UNIX/the UNIX toolkit. Waterloo, Edinburgh, and others also all put something out. Plus you start to commercial C implementations like Intermetrics, Tartan Labs, Greenhills (in fact IIRC the Apple Mac C Compiler was developed under contract by Greenhills).
What I am leaving out is the BASIC and Pascal wars that were going on at the same time. The 8-bits micros, in particular, went BASIC crazy. The 'CS types' at many Universities (like mine at CMU) had been considered BASIC, C, and Fortran as 'ugly' and were using an Algol or a more Algol-like language as the future (Pascal was premier teaching language at the time). For issues, we can talk about in COFF, Pascal diverged (in 1980 at one of the Hatfield and McCoy parties at Steve Glaser's, a couple of us counted 14 incompatible 'HP-BASIC's and 8 different 'Tek Pascal' in use).
Here comes the final thing that happened...
By the early, mid-80s, all us UNIX folks were happy using UNIX derived C compiler, like the NU suite. But as Larry points out, there was a whole group of people that could not get UNIX sources or tools. Stallman sets out to build his Gnu system and he needs a language and compiler. I've always been amazed he did not use LISP, other than the first tool he wanted was EMACS, and get got CMU (Gosling's) codebase to start. CMU-EMACS was in C (plus his 'mock-lisp' creation). So rms needed a C compiler and starts to hack mock-lisp to be more to his taste. But to make it widespread he needs a C compiler and microprocessor tools. So he starts to write his famous compiler -- which to me is that key thing he did. The Gnu project would release tools that ran pretty much anywhere and targeted the popular micro's and generated 'good enough code.'
Cole's Law -- 'Simple Economics always beats Sophisticated Architecture.'
It turns out Paul Winalski and I were just talking about this last week. I very much believe C 'won' the war for economic reasons.
UNIX being 'Open Source' in the 70s to the Unversity types, did allow us to hack and >>share<< the compilers, either Ritchie or Johnson based. Moore's Law caused the 16-bit micros to flourish and they ended up in systems. Unix taught a number of programmers the language and the tool suite, then we went to the real world and wanted it. Stallman's tools were there.
It did not matter that there were 'better' languages (Pascal had forked, we also had new languages from OCAM to Modula, eventually C++ et al). The Gnu C compiler was cheap (free) and that was the final stroke.
Clem