Then, one day, I got this one, which I did not understand:
Ken Thompson has an automobile which he helped design. Unlike most automobiles, it has neither speedometer, nor gas gauge, nor any of the numerous idiot lights which plague the modern driver. Rather, if the driver makes any mistake, a giant "?" lights up in the center of the dashboard. "The experienced driver", he says, "will usually know what's wrong.
I now know that Ken Thompson was one of the creators of unix. In this fortune, the car is unix, and the giant '?' is the dreaded 'segmentation fault' error that plagues beginning unix/C programmers and which provides no useful information.
I have always felt a little bit bad for him, being teased in this way (and why does Dennis Ritchie get off so easy?). Apparently, though, Mr. Thompson and I work at the same company now, so maybe I will have a chance to comfort him.
12 comments:
Only tangentially related to your post, my favorite fortune cookie of all time remains "Your lucky number is 1."
That's brilliant!
Wait, I don't get it.
Oh, wait, that's brilliant!
My lucky number is i. Which means I will never be lucky. :-(
I got that in a cookie from a Chinese Mathemeticians' Restaurant.
Hey, what would the Scheme Car look like? I bet it would be an omnibus with little nested buses like a russian doll. And to driver is a mysterious person dressed in a yellow jumpsuit with the Y-Combinator as a logo. And everybody is rockin' out to a disco beat with the lyrics pumping out in Isaac Hayes voice: "CAR CAR CDR CAR CDR CDR CAR CAR CONS CAR..."
After each thing it did, a Scheme car would have to tell itself to continue being a car.
That might be annoying, but the nice thing is that you don't have to drive home after going somewhere; you just save a continuation before you leave, and invoke it to go instantly home.
Oh fuck yeah! You press a "continuation" button on the side of the bus and it collapses into a briefcase. After work, you put the briefcase on the ground and it expands back into a bus. The only problem is, all the context comes with it. So if it was raining before, and it's sunny now, when the continuation continues, it will be raining again. Freak!
And if you're riding on the bus, and other riders are invoking continuations, then, since you don't perceive the time you are frozen, you look out the window and you're just warping from place to place. There are signs inside the bus saying, "Please be considerate and do not invoke continuations gratuitously."
It is a nice comparison because most of the actual system they have a error for everything. You could figure it out and they have tools to identify the problem. but in some unix bases system, users usually know how it works so they can find very easy the problem. If you want to avoid any problem Generic Viagra . This fix everything.
Actually, the "?" referred to is the one and only error message that the ed editor would emit; it has nothing to do with segmentation faults.
The "?" reminds me of ed ("the standard text editor"), but the way it's used in the fortune, it reminds me so much of the vagueness of the segmentation fault.
Went looking for the old BSD "fortune" and landed here.
Yes I believe it's about ed. The original "ed" program (Thompson had been exposed to the QED editor on the Berkeley Time Sharing System, he wrote a version for MIT's CTSS (Time Sharing System for the IBM 7090) which introduced regular expressions (may have compiled them to machine code) when he was on the Multics project, and wrote a QED for Multics in BCPL (the inspiration for the B language), which was ported to G(E)COS and used at Bell Labs on the GE/Honeywell systems there.
The PDP-7 version of ed at
https://github.com/DoctorWkt/pdp7-unix/blob/master/src/cmd/ed1.s#L769
has this:
error:
lac d1
sys write; 1f; 1
jmp advanc
1:
077012
Which writes ?\n to file descriptor 1 (stdout), and is a pretty common error routine in the PDP-7 UNIX utilities (often printing the filename first).
I don't see the first of three files for ed in the extant 2nd Edition Sources:
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V2/cmd
But here's a tidbit of a V2 (PDP-11) program with the same idiom:
error:
mov $1,r0
sys write; 1f; 2
sys exit
1:
nl: <\n>
Post a Comment