| ▲ | vincent-manis a day ago | |
My vague recollection is that the kernel in Unix v2 (still called UNIX in those days) was written in assembly language, but that many of the commands were written in B. Because B was interpretive on the PDP-11 (it suffered from the same problem as BCPL, in that it expected a word-addressed machine), it would have been impractical to use it in the kernel. If I recall correctly, the first Unix to reach Berkeley was some kind of v2. The C compiler appeared in v3, and the kernel rewrite happened for Version 4, which is the version described in the paper. Using .S for assembly language source is a historical accident, by the time the majority of code was written in C, .a was defined as the conventional filetype for archive (ar) files. | ||
| ▲ | gwynforthewyn a day ago | parent [-] | |
The timeline you're presenting matches what I recall, also. Nice! That tidbit about .S vs .a is a lovely detail. "A Research Unix Reader" has other cultural details called out that're similar - https://doc.cat-v.org/unix/unix-reader/A.Research.Unix.Reade.... Two of my favourites are the idea that originally a shell script couldn't be part of a pipeline ("programs that were likely to read from shell scripts, especially sh and ed, were made to read their input one character at a time. It was impossible to pipe into a shell script because the standard input was already dedicated to the script. For the same reason a program in a shell script could not take input from a terminal except when given the terminal’s real name.") and this note from the man page for sort v1: > A bug note in join(1) declares, ‘‘The [field-specification] conventions of join, sort, comm, uniq, look and awk(1) are wildly incongruous.’’ Although these programs are often used together, they remain, like American weights and measures, sturdily eccentric. I remember thinking that commands were weirdly unsimilar as I was first learning them; it took this many years for me to see one of the early authors wrote an oopsie about them :) | ||