On Apr 17, 2017, at 1:33 PM, Chuck Guzis via cctalk <cctalk at classiccmp.org>
wrote:
On 04/17/2017 01:23 PM, Guy Dawson via cctalk wrote:
I think timing had a lot to do with C's
success.
It's a decent language and at the time powerful and flexible compared
to other languages. Universities picked up UNIX and C and taught a
lot of students. The went forth taking their skills with them.
C is pretty much mandatory if you wanted to use Unix. And Unix was one
of the very few "portable" operating systems. So, initially, you saw C
only in Unix shops.
The original K&R C is also sufficiently simple and sufficiently sloppy that one can
hack together a compiler that works well enough in a very short amount of time and that
can run on or at least target a relatively small system, even an early-1980s micro. And if
you need to produce better code, you just need to change what you wrote, because there?s
such a close correspondence between C code and generated assembly.
So if you?re bringing up a platform and have some access to Unix or Unix-like tools, what
do you do, invent your own infrastructure? Or just sit down for a week with lex & yacc
and knock out a C compiler? (Maybe even piggybacking on your installation?s existing cpp?)
Heck, some environments never even became self-hosting: I hear turning a new build of the
Amiga OS still required some build steps to be performed on a Sun 3, and others to be
performed with different compilers, assemblers, etc. No unified toolchain there!
People also still get upset that modern compilers reject things like obvious NULL
dereferences as undefined behavior. ?It should just dereference 0, who knows, that might
be fine!? The ?as-if? rule wasn?t nearly as much of a thing in the 1970s and early 1980s
as it is in modern compilers.
-- Chris