« previous post | next post »

It's possible that you don't know who Dennis Ritchie was. Even if you do, you should read some of his obituaries, and think about the ways in which he changed the world: Steve Lohr, "Dennis Ritchie, Trailblazer in Digital Era, Dies at 70", NYT; Elizabeth Flock, "Dennis Ritchie, father of C programming language and Unix, dies at 70", Washington Post; Cade Metz, "Dennis Ritchie: The Shoulders Steve Jobs Stood On", Wired News; Mark Memmott, "Dennis Ritchie, C Programmer And Unix Co-Creator, Has Died", NPR.

Johnny Truant, commenting on that last piece, contributed a tribute that Dennis would have appreciated:

#include "stdio.h"

int main(void)

{

printf("goodbye, world

");

return 0;

}

(Though everyone who knew Dennis, or who knows what he did for the world, would object to that return value.)

During my 15 years at Bell Labs — 1975-1990 — Dennis Ritchie's office was around the corner from mine, and we interacted from time to time in ways that were always productive (at least for me), and often amusing. Here's a small example of how I remember him.

The old-time Unix file system (or at least the file systems in Version 6 and Version 7, my first exposure to Unix) limited file names to 14 characters. This limitation existed partly because computer memory was a precious resource; partly because interacting with programs and editing files on an ASR-33 was slow; but mainly, I think, because what Richard Gabriel later called "the New Jersey approach" took the view that "Simplicity is the most important consideration in a design".

The Unix culture favored short identifiers in general: programs like ed, cd, ls, cat, cc, sed, su; directory names like bin, lib, etc, dev; userids like dmr, bwk, mvm. Against this background, 14 characters is a long name; and as Brian Kernighan put it in Unix for Beginners (1979), "14 characters … is enough to be descriptive". In order to have arbitrary-length file names, you'd need to add another layer of indirection to the file-system data structures; and as Richard Gabriel later wrote about the Bell Labs Unix ethos, "All reasonably expected cases should be covered. Completeness can be sacrificed in favor of any other quality. In fact, completeness must be sacrificed whenever implementation simplicity is jeopardized."

However, Unix escaped from Bell Labs — that's part of the story of how Dennis Ritchie helped change the world — and folks in Berkeley had looser (or at least different) moral standards. By 1982 or so, the Berkeley flavor of Unix had developed a file system with arbitrary (or at least much longer) possible file names. So one day, someone sent me a tar tape that had been made on a Berkeley system. And because they'd had the bad taste to take extensive advantage of those longer-than-14-character file names, my attempt to un-tar the tape was a disaster.

Specifically, as I recall, the overlong file names were simply silently truncated; aside from often concealing their identity and purpose, this caused later files with the same initial 14 letters to overwrite earlier ones.

So I went around the corner to discuss this problem with my colleagues in the Unix research department. Someone patiently explained to me why the 14-character limit was, on balance, a Good Thing. Someone else — certainly not Dennis — may even have suggested that tar's silent truncation of file names was the Right Thing to Do. Some inconclusive theological controversy ensued.

After talking it over with Dennis, I concluded that re-writing the V7 file system would be too much trouble, as well a violation of local cultural norms, but that modifying tar would be both fairly easy and culturally acceptable. So I got the source code, and hacked tar so that when it encountered over-long file names, it mapped them into 14-character versions guaranteed to be unique, at least insofar as 14 alphanumeric characters permitted, and at the end it wrote out a file giving the table of correspondences between the original file names and the new ones.

This allowed me to get at whatever it was that was on that foreign tape, so I was satisfied. I sent the code around by email to some people that I thought might be able to use it, with a brief note explaining what it was good for, and expressing the hope that this solution would be acceptable "even to those stalwart puritans in the unix research department". Dennis wrote back that it was indeed acceptable, signing his response "Stal".

And for some time after that, he continued to use that nickname in private email to me.

Permalink