by gexos · 11y ago · 0 comments
The original Unix operating system was written in assembler, and the applications in a mix of assembler and an interpreted language called B, which had the virtue that it was small enough to run on the PDP-7. But B was not powerful enough for systems programming, so Dennis Ritchie added data types and structures to it. The resulting C language evolved from B beginning in 1971; in 1973 Thompson and Ritchie finally succeeded in rewriting Unix in their new language. This was quite an audacious move; at the time, system programming was done in assembler in order to extract maximum performance from the hardware, and the very concept of a portable operating system was barely a gleam in anyone's eye. As late as 1979, Ritchie could write: “It seems certain that much of the success of Unix follows from the readability, modifiability, and portability of its software that in turn follows from its expression in high-level languages”, in the knowledge that this was a point that still needed making.
1972 Modern
---- ------
foo; int foo;
foo 1; int foo = 1;
foo[]; int *foo;
foo[] 1, 2, 3; int foo[] = { 1, 2, 3 };
char foo[][]; char **foo;
No struct, union, or static. I'm wondering if locals not marked with auto are static. Also "extern foo" is used as a forward declaration to function or int foo.No preprocessor.
1972 Modern
---- ------
char foo[][]; char **foo;
Really? I see the former quite a bit, and it makes it clearer you mean an array.[1]: https://en.wikipedia.org/wiki/Burroughs_large_systems#B5000
(To head off complaints about what "portable means": portable enough that people did port Unix and C programs to many architectures, unlike the case with the Burroughs OS and programs.)
So the Unix claims of firsts need qualifiers to be absolutely true, but are true in spirit even when phrased casually: the earlier exceptions are mostly just curiosities.