home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / STEN / STEN09.MSA / NEWS.TXT / APP_1.ASC next >
Text File  |  2010-04-21  |  35KB  |  788 lines

  1.  
  2. Appendix A: Hacker Folklore
  3. ***************************
  4.  
  5. This appendix contains several legends and fables which illuminate the
  6. meaning of various entries in the lexicon.
  7.  
  8. The Meaning of `Hack'
  9. =====================
  10.  
  11. "The word {hack} doesn't really have 69 different meanings", according
  12. to Phil Agre, an MIT hacker.  "In fact, {hack} has only one meaning, an
  13. extremely subtle and profound one which defies articulation.  Which
  14. connotation is implied by a given use of the word depends in similarly
  15. profound ways on the context.  Similar remarks apply to a couple of
  16. other hacker words, most notably {random}."
  17.  
  18. Hacking might be characterized as "an appropriate application of
  19. ingenuity".  Whether the result is a quick-and-dirty patchwork job or
  20. a carefully crafted work of art, you have to admire the cleverness
  21. that went into it.
  22.  
  23. An important secondary meaning of {hack} is `a creative practical
  24. joke'.  This kind of hack is easier to explain to non-hackers than the
  25. programming kind.  Accordingly, here are some examples of practical
  26. joke hacks:
  27.  
  28. In 1961, students from Caltech (California Institute of Technology in
  29. Pasadena) hacked the Rose Bowl football game.  One student posed as a
  30. reporter and `interviewed' the director of the University of
  31. Washington card stunts (such stunts involve people in the stands who
  32. hold up colored cards to make pictures).  The reporter learned exactly
  33. how the stunts were operated, and also that the director would be out
  34. to dinner later.
  35.  
  36. While the director was eating, the students (who called themselves the
  37. `Fiendish Fourteen') picked a lock and stole one of the direction
  38. sheet blanks for the card stunts.  They then had a printer run off
  39. 2300 copies of the blank.  The next day they picked the lock again and
  40. stole the master plans for the stunts, large sheets of graph paper
  41. colored in with the stunt pictures.  Using these as a guide, they made
  42. new instructions for three of the stunts on the duplicated blanks.
  43. Finally, they broke in once more, replacing the stolen master plans
  44. and substituting the stack of diddled instruction sheets for the
  45. original set.
  46.  
  47. The result was that three of the pictures were totally different.
  48. Instead of spelling "WASHINGTON", the word "CALTECH" was flashed.
  49. Another stunt showed the word "HUSKIES", the Washington nickname,
  50. but spelled it backwards.  And what was supposed to have been a
  51. picture of a husky instead showed a beaver.  (Both Caltech and MIT use
  52. the beaver as a mascot.  Beavers are nature's engineers.)
  53.  
  54. After the game, the Washington faculty athletic representative said,
  55. "Some thought it ingenious; others were indignant."  The Washington
  56. student body president remarked, "No hard feelings, but at the time
  57. it was unbelievable.  We were amazed."
  58.  
  59. This is now considered a classic hack, particularly because revising
  60. the direction sheets constituted a form of programming.
  61.  
  62. Another classic hack:
  63.  
  64. Some MIT students once illicitly used a quantity of thermite to weld a
  65. trolley car to its tracks.  The hack was actually not dangerous, as
  66. they did this at night to a parked trolley.  It took the transit
  67. people quite a while to figure out what was wrong with the trolley,
  68. and even longer to figure out how to fix it.  They ended up putting
  69. jacks under the trolley and cutting the section of track on either
  70. side of the wheel with oxyacetylene torches.  Then they unbolted the
  71. wheel, welded in a new piece of track, bolted on a new wheel, and
  72. removed the jacks.  The hackers sneaked in the next night and stole
  73. the fused track and wheel!
  74.  
  75. The pranksters' plunder was later used as the trophy at the First Annual
  76. All-Tech Sing.  They carted it in on a very heavy duty dolly up the
  77. freight elevator of the Student Center.  Six feet of rail and a trolley
  78. wheel is a *lot* of steel.
  79.  
  80. A rather similar hack, perpetrated by a fraternity at CMU, cost their
  81. campus its trolley service.
  82.  
  83. Though these displayed some cleverness, the side-effect of expensive
  84. property damage was definitely an esthetic minus.  The best hacks are
  85. harmless ones.
  86.  
  87. And another:
  88.  
  89. One winter, late at night, an MIT fraternity hosed down an underpass
  90. that is part of a commuter expressway near MIT.  This produced an ice
  91. slick that `trapped' a couple of small cars: they didn't have the
  92. momentum or traction to climb out of the underpass.  While it was
  93. clever to apply some simple science to trap a car, it was also very
  94. dangerous as it could have caused a collision.  As such, this was a
  95. very poor hack overall.
  96.  
  97. And yet another:
  98.  
  99. On November 20, 1982, MIT hacked the Harvard-Yale football game.  Just
  100. after Harvard's second touchdown against Yale in the second quarter, a
  101. small black ball popped up out of the ground at the 40-yard line, and
  102. grew bigger, and bigger, and bigger.  The letters "MIT" appeared all
  103. over the ball.  As the players and officials stood around gawking, the
  104. ball grew to six feet in diameter and then burst with a bang and a
  105. cloud of white smoke.
  106.  
  107. As the Boston Globe later reported, "If you want to know the truth,
  108. M.I.T. won The Game."
  109.  
  110. The prank had taken weeks of careful planning by members of MIT's
  111. Delta Kappa Epsilon fraternity.  The device consisted of a weather
  112. balloon, a hydraulic ram powered by Freon gas to lift it out of the
  113. ground, and a vacuum-cleaner motor to inflate it.  They made eight
  114. separate expeditions to Harvard Stadium between 1 and 5 AM, in which
  115. they located an unused 110-volt circuit in the stadium, and ran buried
  116. wiring from the stadium circuit to the 40-yard line, where they buried
  117. the balloon device.  When the time came to activate the device, two
  118. fraternity members had merely to flip a circuit breaker and push a
  119. plug into an outlet.
  120.  
  121. This stunt had all the earmarks of a perfect hack: surprise,
  122. publicity, the ingenious use of technology, safety, and harmlessness.
  123. The use of manual control allowed the prank to be timed so as not to
  124. disrupt the game (it was set off between plays, so the outcome of the
  125. game would not be unduly affected).  The perpetrators had even
  126. thoughtfully attached a note to the balloon explaining that the device
  127. was not dangerous and contained no explosives.
  128.  
  129. Harvard president Derek Bok commented: "They have an awful lot of
  130. clever people down there at MIT, and they did it again."  President
  131. Paul E. Gray of MIT said, "There is absolutely no truth to the rumor
  132. that I had anything to do with it, but I wish there were."
  133.  
  134. Still another:
  135.  
  136. At Stevens Tech, a programmer, having seen the {Cookie Bear} program
  137. on the ITS systems, proceeded to write his own version for TOPS-10.
  138. Unlike the ITS one, this version, called TSCB (Time-Sharing Cookie
  139. Bear) was able to simultaneously harass multiple users at a time with
  140. numerous {bells and whistles}.  It had a mode to look for a
  141. particular user or program name and pounce as soon as it saw either;
  142. it accepted wildcards (e.g. the command `BOTHER [3??,*]' would sic the
  143. bear on all Chemistry Department users); and it had commands to hide
  144. as various other programs (making detection difficult if not
  145. impossible).
  146.  
  147. Later on, it acquired other, nastier features; the `PUNISH' command
  148. would look for a particular user or program name and log that job out
  149. as soon as it saw it; the `IWANT' command could grab a reserved device
  150. from another user, etc.
  151.  
  152. This program became well-known in the Stevens folklore, and copies
  153. ended up on just about everywhere despite the efforts of the Computer
  154. Center administration to eradicate it.  Fortunately, this program
  155. required privileges to work; unfortunately, the ability of Computer
  156. Center employees to get and use these privileges with impunity lead to
  157. a strong `us vs. them' mentality among Stevens hackers.
  158.  
  159. Finally, here is a great story about one of the classic computer hacks.
  160.  
  161. Back in the mid-1970s, several of the system support staff at Motorola
  162. discovered a relatively simple way to crack system security on the
  163. XEROX CP-V timesharing system.  Through a simple programming strategy,
  164. it was possible for a user program to trick the system into running a
  165. portion of the program in `master mode' (supervisor state), in which
  166. memory protection does not apply.  The program could then poke a large
  167. value into its `privilege level' byte (normally write-protected) and
  168. could then proceed to bypass all levels of security within the
  169. file-management system, patch the system monitor, and do numerous
  170. other interesting things.  In short, the barn door was wide open.
  171.  
  172. Motorola quite properly reported this problem to XEROX via an official
  173. `level 1 SIDR' (a bug report with an intended urgency of `needs to be
  174. fixed yesterday').  Because the text of each SIDR was entered into a
  175. database that could be viewed by quite a number of people, Motorola
  176. followed the approved procedure: they simply reported the problem as
  177. `Security SIDR', and attached all of the necessary documentation,
  178. ways-to-reproduce, etc.
  179.  
  180. XEROX sat on their thumbs...they either didn't realize the severity of
  181. the problem, or didn't assign the necessary operating-system-staff
  182. resources to develop and distribute an official patch.
  183.  
  184. Months passed.  The Motorola guys pestered their XEROX field-support
  185. rep, to no avail.  Finally they decided to take Direct Action, to
  186. demonstrate to XEROX management just how easily the system could be
  187. cracked and just how thoroughly the security safeguards could be
  188. subverted.
  189.  
  190. They dug around in the operating-system listings and devised a
  191. thoroughly devilish set of patches.  These patches were then
  192. incorporated into a pair of programs called `Robin Hood' and `Friar
  193. Tuck'.  Robin Hood and Friar Tuck were designed to run as `ghost jobs'
  194. (daemons, in UNIX terminology); they would use the existing loophole
  195. to subvert system security, install the necessary patches, and then
  196. keep an eye on one another's statuses in order to keep the system
  197. operator (in effect, the superuser) from aborting them.
  198.  
  199. So... one day, the system operator on the main CP-V software
  200. development system in El Segundo was surprised by a number of unusual
  201. phenomena.  These included the following:
  202.  
  203.    * Tape drives would rewind and dismount their tapes in the middle of a
  204.      job.
  205.    * Disk drives would seek back and forth so rapidly that they'd attempt
  206.      to walk across the floor (see {walking drives}).
  207.    * The card-punch output device would occasionally start up of itself and
  208.      punch a {lace card}.  These would usually jam in the punch.
  209.    * The console would print snide and insulting messages from Robin Hood
  210.      to Friar Tuck, or vice versa.
  211.    * The XEROX card reader had two output stackers; it could be instructed
  212.      to stack into A, stack into B, or stack into A unless a card was
  213.      unreadable, in which case the bad card was placed into stacker B.  One
  214.      of the patches installed by the ghosts added some code to the
  215.      card-reader driver... after reading a card, it would flip over to
  216.      the opposite stacker.  As a result, card decks would divide themselves
  217.      in half when they were read, leaving the operator to recollate them
  218.      manually.
  219.  
  220. Naturally, the operator called in the operating-system developers.  They
  221. found the bandit ghost jobs running, and X'ed them... and were once
  222. again surprised.  When Robin Hood was X'ed, the following sequence of
  223. events took place:
  224.  
  225.      !X id1
  226.  
  227.      id1: Friar Tuck... I am under attack!  Pray save me!
  228.      id1: Off (aborted)
  229.  
  230.      id2: Fear not, friend Robin!  I shall rout the Sheriff of 
  231.           Nottingham's men!
  232.  
  233.      id1: Thank you, my good fellow!
  234.  
  235. Each ghost-job would detect the fact that the other had been killed,
  236. and would start a new copy of the recently-slain program within a few
  237. milliseconds.  The only way to kill both ghosts was to kill them
  238. simultaneously (very difficult) or to deliberately crash the system.
  239.  
  240. Finally, the system programmers did the latter... only to find
  241. that the bandits appeared once again when the system rebooted!  It
  242. turned out that these two programs had patched the boot-time OS image
  243. (the kernel file, in UNIX terms) and had added themselves to the list
  244. of programs that were to be started at boot time...
  245.  
  246. The Robin Hood and Friar Tuck ghosts were finally eradicated when the
  247. system staff rebooted the system from a clean boot-tape and
  248. reinstalled the monitor.  Not long thereafter, XEROX released a patch
  249. for this problem.
  250.  
  251. It is alleged that XEROX filed a complaint with Motorola's management about
  252. the merry-prankster actions of the two employees in question.  It is
  253. not recorded that any serious disciplinary action was taken against
  254. either of them.
  255.  
  256. The Untimely Demise of Mabel the Monkey
  257. =======================================
  258.  
  259.    The following, modulo a couple of inserted commas and
  260. capitalization changes for readability, is the exact text of a famous
  261. USENET message.  The reader may wish to review the definitions of
  262. {PM} in the main text before continuing.
  263.  
  264.      Date: Wed 3 Sep 86 16:46:31-EDT
  265.      From: "Art Evans" <Evans@TL-20B.ARPA>
  266.      Subject: Always Mount a Scratch Monkey
  267.      To: Risks@CSL.SRI.COM
  268.  
  269. My friend Bud used to be the intercept man at a computer vendor for
  270. calls when an irate customer called.  Seems one day Bud was sitting at
  271. his desk when the phone rang.
  272.     
  273.      Bud:       Hello.                 Voice:      YOU KILLED MABEL!!
  274.      B:         Excuse me?             V:          YOU KILLED MABEL!!
  275.  
  276. This went on for a couple of minutes and Bud was getting nowhere, so he
  277. decided to alter his approach to the customer.
  278.     
  279.      B:         HOW DID I KILL MABEL?   V: YOU PM'ED MY MACHINE!!
  280.  
  281. Well, to avoid making a long story even longer, I will abbreviate what had
  282. happened.  The customer was a Biologist at the University of Blah-de-blah,
  283. and he had one of our computers that controlled gas mixtures that Mabel (the
  284. monkey) breathed.  Now, Mabel was not your ordinary monkey.  The University
  285. had spent years teaching Mabel to swim, and they were studying the effects
  286. that different gas mixtures had on her physiology.  It turns out that the
  287. repair folks had just gotten a new Calibrated Power Supply (used to
  288. calibrate analog equipment), and at their first opportunity decided to
  289. calibrate the D/A converters in that computer.  This changed some of the gas
  290. mixtures and poor Mabel was asphyxiated.  Well, Bud then called the branch
  291. manager for the repair folks:
  292.  
  293.      Manager:     Hello
  294.      B:           This is Bud, I heard you did a PM at the University of
  295.                   Blah-de-blah.
  296.      M:           Yes, we really performed a complete PM.  What can I do
  297.                   for you?
  298.      B:           Can you swim?
  299.  
  300. The moral is, of course, that you should always mount a scratch monkey.
  301.  
  302.               ~~~~~~~~~~~~~~~~~~~~~~ 
  303.  
  304. There are several morals here related to risks in use of computers.
  305. Examples include, "If it ain't broken, don't fix it."  However, the
  306. cautious philosophical approach implied by "always mount a scratch
  307. monkey" says a lot that we should keep in mind.
  308.  
  309.      Art Evans
  310.      Tartan Labs
  311.  
  312. TV Typewriters: A Tale Of Hackish Ingenuity
  313. ===========================================
  314.  
  315. Here is a true story about a glass tty.  One day an MIT hacker was in
  316. a motorcycle accident and broke his leg.  He had to stay in the
  317. hospital quite a while, and got restless because he couldn't {hack}.
  318. Two of his friends therefore took a terminal and modem for it to the
  319. hospital, so that he could use the computer by telephone from his
  320. hospital bed.
  321.  
  322. Now this happened some years before the spread of home computers, and
  323. computer terminals were not a familiar sight to the average person.
  324. When the two friends got to the hospital, a guard stopped them and
  325. asked what they were carrying.  They explained that they wanted to
  326. take a computer terminal to their friend who was a patient.
  327.  
  328. The guard got out his list of things that patients were permitted to
  329. have in their rooms: TV, radio, electric razor, typewriter, tape
  330. player...  no computer terminals.  Computer terminals weren't on the
  331. list, so they couldn't take it in.  Rules are rules, you know.
  332.  
  333. Fair enough, said the two friends, and they left again.  They were
  334. frustrated, of course, because they knew that the terminal was as
  335. harmless as a TV or anything else on the list... which gave them an
  336. idea.
  337.  
  338. The next day they returned, and the same thing happened: a guard
  339. stopped them and asked what they were carrying.  They said, "This is
  340. a TV typewriter!"  The guard was skeptical, so they plugged it in and
  341. demonstrated it.  "See?  You just type on the keyboard and what you
  342. type shows up on the TV screen."  Now the guard didn't stop to think
  343. about how utterly useless a typewriter would be that didn't produce
  344. any paper copies of what you typed; but this was clearly a TV
  345. typewriter, no doubt about it.  So he checked his list: "A TV is all
  346. right, a typewriter is all right... okay, take it on in!"
  347.  
  348. Two Stories About `Magic' (by Guy Steele)
  349. =========================================
  350.  
  351. When Barbara Steele was in her fifth month of pregnancy in 1981, her
  352. doctor sent her to a specialist to have a sonogram made to determine
  353. whether there were twins.  She dragged her husband Guy along to the
  354. appointment.  It was quite fascinating; as the doctor moved an
  355. instrument along the skin, a small TV screen showed cross-sectional
  356. pictures of the abdomen.
  357.  
  358. Now Barbara and I had both studied computer science at MIT, and we
  359. both saw that some complex computerized image-processing was involved.
  360. Out of curiosity, we asked the doctor how it was done, hoping to learn
  361. some details about the mathematics involved.  The doctor, not knowing
  362. our educational background, simply said, "The probe sends out sound
  363. waves, which bounce off the internal organs.  A microphone picks up
  364. the echoes, like radar, and send the signals to a computer --- and the
  365. computer makes a picture."  Thanks a lot!  Now a hacker would have
  366. said, "... and the computer *magically* (or {automagically})
  367. makes a picture", implicitly acknowledging that he has glossed over
  368. an extremely complicated process.
  369.  
  370. Some years ago I was snooping around in the cabinets that housed the
  371. MIT AI Lab's PDP-10, and noticed a little switch glued to the frame of
  372. one cabinet.  It was obviously a homebrew job, added by one of the
  373. lab's hardware hackers (no one knows who).
  374.  
  375. You don't touch an unknown switch on a computer without knowing what
  376. it does, because you might crash the computer.  The switch was labeled
  377. in a most unhelpful way.  It had two positions, and scrawled in pencil
  378. on the metal switch body were the words `magic' and `more magic'.
  379. The switch was in the `more magic' position.
  380.  
  381. I called another hacker over to look at it.  He had never seen the
  382. switch before either.  Closer examination revealed that the switch
  383. only had one wire running to it!  The other end of the wire did
  384. disappear into the maze of wires inside the computer, but it's a basic
  385. fact of electricity that a switch can't do anything unless there are
  386. two wires connected to it.  This switch had a wire connected on one
  387. side and no wire on its other side.
  388.  
  389. It was clear that this switch was someone's idea of a silly joke.
  390. Convinced by our reasoning that the switch was inoperative, we flipped
  391. it.  The computer instantly crashed.
  392.  
  393. Imagine our utter astonishment.  We wrote it off as coincidence, but
  394. nevertheless restored the switch to the `more magic' position before
  395. reviving the computer.
  396.  
  397. A year later, I told this story to yet another hacker, David Moon as I
  398. recall.  He clearly doubted my sanity, or suspected me of a
  399. supernatural belief in the power of this switch, or perhaps thought I
  400. was fooling him with a bogus saga.  To prove it to him, I showed him
  401. the very switch, still glued to the cabinet frame with only one wire
  402. connected to it, still in the `more magic' position.  We scrutinized
  403. the switch and its lone connection, and found that the other end of
  404. the wire, though connected to the computer wiring, was connected to a
  405. ground pin.  That clearly made the switch doubly useless: not only was
  406. it electrically nonoperative, but it was connected to a place that
  407. couldn't affect anything anyway.  So we flipped the switch.
  408.  
  409. The computer promptly crashed.
  410.  
  411. This time we ran for Richard Greenblatt, a long-time MIT hacker, who
  412. was close at hand.  He had never noticed the switch before, either.
  413. He inspected it, concluded it was useless, got some diagonal cutters
  414. and {dike}d it out.  We then revived the computer and it ran fine
  415. ever since.
  416.  
  417. We still don't know how the switch crashed the machine.  There is a
  418. theory that some circuit near the ground pin was marginal, and
  419. flipping the switch changed the electrical capacitance enough to upset
  420. the circuit as millionth-of-a-second pulses went through it.  But
  421. we'll never know for sure; all we can really say is that the switch
  422. was {magic}.
  423.  
  424. I still have that switch in my basement.  Maybe I'm silly, but I
  425. usually keep it set on `more magic'.
  426.  
  427. A Selection of AI Koans
  428. =======================
  429.  
  430.    These are some of the funniest examples of a genre of jokes told at
  431. the MIT AI lab about various noted hackers.  The original koans were
  432. composed by Danny Hillis.  In reading these, it is at least useful to
  433. know that Minsky, Sussman, and Drescher are AI researchers of note,
  434. that Tom Knight was one of the Lisp machine's principal designers, and
  435. that David Moon wrote much of Lisp machine Lisp.
  436.  
  437.                                  * * *
  438.  
  439.    A novice was trying to fix a broken Lisp machine by turning the power
  440. off and on.
  441.  
  442.    Knight, seeing what the student was doing spoke sternly: "You can not
  443. fix a machine by just power-cycling it with no understanding of what
  444. is going wrong."
  445.  
  446.    Knight turned the machine off and on.
  447.  
  448.    The machine worked.
  449.  
  450.                                  * * *
  451.  
  452. One day a student came to Moon and said, "I understand how to
  453. make a better garbage collector.  We must keep a reference count
  454. of the pointers to each cons."
  455.  
  456. Moon patiently told the student the following story:
  457.  
  458.       "One day a student came to Moon and said, `I understand how
  459.       to make a better garbage collector...
  460.  
  461. [Ed. note: Pure reference-count garbage collectors have problems with
  462.    circular structures that point to themselves.]
  463.  
  464.                                  * * *
  465.  
  466. In the days when Sussman was a novice, Minsky once came to him as
  467. he sat hacking at the PDP-6.
  468.  
  469.    "What are you doing?" asked Minsky.
  470.  
  471.    "I am training a randomly wired neural net to play Tic-Tac-Toe",
  472. Sussman replied.
  473.  
  474.    "Why is the net wired randomly?" asked Minsky.
  475.  
  476.    "I do not want it to have any preconceptions of how to play."
  477. Sussman said.
  478.  
  479.    Minsky then shut his eyes.
  480.  
  481.    "Why do you close your eyes?" Sussman asked his teacher.
  482.  
  483.    "So that the room will be empty."
  484.  
  485.    At that moment, Sussman was enlightened.
  486.  
  487.                                  * * *
  488.  
  489.    A disciple of another sect once came to Drescher as he was
  490. eating his morning meal.
  491.  
  492.    "I would like to give you this personality test", said the
  493. outsider, "because I want you to be happy."
  494.  
  495.    Drescher took the paper that was offered him and put it
  496. into the toaster, saying:
  497.  
  498.    "I wish the toaster to be happy, too."
  499.  
  500. OS and JEDGAR
  501. =============
  502.  
  503. This story says a lot about the the ITS ethos. 
  504.  
  505. On the ITS system there was a program that allowed you to see what is
  506. being printed on someone else's terminal.  It spied on the other guy's
  507. output by examining the insides of the monitor system.  The output spy
  508. program was called OS.  Throughout the rest of the computer science
  509. (and at IBM too) OS means `operating system', but among old-time ITS
  510. hackers it almost always meant `output spy'.
  511.  
  512. OS could work because ITS purposely had very little in the way of
  513. `protection' that prevented one user from trespassing on another's
  514. areas.  Fair is fair, however.  There was another program that would
  515. automatically notify you if anyone started to spy on your output.  It
  516. worked in exactly the same way, by looking at the insides of the
  517. operating system to see if anyone else was looking at the insides that
  518. had to do with your output.  This `counterspy' program was called
  519. JEDGAR (a six-letterism pronounced as two syllables: /jed'gr/), in
  520. honor of the former head of the FBI.
  521.  
  522. But there's more.  The rest of the story is that JEDGAR would ask the
  523. user for `license to kill'.  If the user said yes, then JEDGAR would
  524. actually {gun} the job of the {luser} who was spying.
  525. Unfortunately, people found this made life too violent, especially when
  526. tourists learned about it.  One of the systems hackers solved the
  527. problem by replacing JEDGAR with another program that only pretended
  528. to do its job.  It took a long time to do this, because every copy of
  529. JEDGAR had to be patched, and to this day no one knows how many people
  530. never figured out that JEDGAR had been defanged.
  531.  
  532. The Story of Mel, a Real Programmer
  533. ===================================
  534.  
  535. This was posted to USENET by its author Ed Nather (utastro!nather) on
  536. May 21, 1983.
  537.  
  538.      A recent article devoted to the *macho* side of programming
  539.      made the bald and unvarnished statement:
  540.  
  541.          Real Programmers write in Fortran.
  542.  
  543.      Maybe they do now,
  544.      in this decadent era of
  545.      Lite beer, hand calculators and "user-friendly" software
  546.      but back in the Good Old Days,
  547.      when the term "software" sounded funny
  548.      and Real Computers were made out of drums and vacuum tubes,
  549.      Real Programmers wrote in machine code.
  550.      Not Fortran. Not RATFOR. Not, even, assembly language.
  551.      Machine Code.
  552.      Raw, unadorned, inscrutable hexadecimal numbers.
  553.      Directly.
  554.  
  555.      Lest a whole new generation of programmers
  556.      grow up in ignorance of this glorious past,
  557.      I feel duty-bound to describe,
  558.      as best I can through the generation gap,
  559.      how a Real Programmer wrote code.
  560.      I'll call him Mel,
  561.      because that was his name.
  562.  
  563.      I first met Mel when I went to work for Royal McBee Computer Corp.,
  564.      a now-defunct subsidiary of the typewriter company.
  565.      The firm manufactured the LGP-30,
  566.      a small, cheap (by the standards of the day)
  567.      drum-memory computer,
  568.      and had just started to manufacture
  569.      the RPC-4000, a much-improved,
  570.      bigger, better, faster --- drum-memory computer.
  571.      Cores cost too much,
  572.      and weren't here to stay, anyway.
  573.      (That's why you haven't heard of the company, or the computer.)
  574.  
  575.      I had been hired to write a Fortran compiler
  576.      for this new marvel and Mel was my guide to its wonders.
  577.      Mel didn't approve of compilers.
  578.  
  579.      "If a program can't rewrite its own code",
  580.      he asked, "what good is it?"
  581.  
  582.      Mel had written,
  583.      in hexadecimal,
  584.      the most popular computer program the company owned.
  585.      It ran on the LGP-30
  586.      and played blackjack with potential customers
  587.      at computer shows.
  588.      Its effect was always dramatic.
  589.      The LGP-30 booth was packed at every show,
  590.      and the IBM salesmen stood around
  591.      talking to each other.
  592.      Whether or not this actually sold computers
  593.      was a question we never discussed.
  594.  
  595.      Mel's job was to re-write
  596.      the blackjack program for the RPC-4000.
  597.      (Port?  What does that mean?)
  598.      The new computer had a one-plus-one
  599.      addressing scheme,
  600.      in which each machine instruction,
  601.      in addition to the operation code
  602.      and the address of the needed operand,
  603.      had a second address that indicated where, on the revolving drum,
  604.      the next instruction was located.
  605.      In modern parlance,
  606.      every single instruction was followed by a GO TO!
  607.      Put *that* in Pascal's pipe and smoke it.
  608.  
  609.      Mel loved the RPC-4000
  610.      because he could optimize his code:
  611.      that is, locate instructions on the drum
  612.      so that just as one finished its job,
  613.      the next would be just arriving at the "read head"
  614.      and available for immediate execution.
  615.      There was a program to do that job,
  616.      an "optimizing assembler",
  617.      but Mel refused to use it.
  618.  
  619.      "You never know where its going to put things",
  620.      he explained, "so you'd have to use separate constants".
  621.  
  622.      It was a long time before I understood that remark.
  623.      Since Mel knew the numerical value
  624.      of every operation code,
  625.      and assigned his own drum addresses,
  626.      every instruction he wrote could also be considered
  627.      a numerical constant.
  628.      He could pick up an earlier "add" instruction, say,
  629.      and multiply by it,
  630.      if it had the right numeric value.
  631.      His code was not easy for someone else to modify.
  632.  
  633.      I compared Mel's hand-optimized programs
  634.      with the same code massaged by the optimizing assembler program,
  635.      and Mel's always ran faster.
  636.      That was because the "top-down" method of program design
  637.      hadn't been invented yet,
  638.      and Mel wouldn't have used it anyway.
  639.      He wrote the innermost parts of his program loops first,
  640.      so they would get first choice
  641.      of the optimum address locations on the drum.
  642.      The optimizing assembler wasn't smart enough to do it that way.
  643.  
  644.      Mel never wrote time-delay loops, either,
  645.      even when the balky Flexowriter
  646.      required a delay between output characters to work right.
  647.      He just located instructions on the drum
  648.      so each successive one was just *past* the read head
  649.      when it was needed;
  650.      the drum had to execute another complete revolution
  651.      to find the next instruction.
  652.      He coined an unforgettable term for this procedure.
  653.      Although "optimum" is an absolute term,
  654.      like "unique", it became common verbal practice
  655.      to make it relative:
  656.      "not quite optimum" or "less optimum"
  657.      or "not very optimum".
  658.      Mel called the maximum time-delay locations
  659.      the "most pessimum".
  660.  
  661.      After he finished the blackjack program
  662.      and got it to run,
  663.      ("Even the initializer is optimized",
  664.      he said proudly)
  665.      he got a Change Request from the sales department.
  666.      The program used an elegant (optimized)
  667.      random number generator
  668.      to shuffle the "cards" and deal from the "deck",
  669.      and some of the salesmen felt it was too fair,
  670.      since sometimes the customers lost.
  671.      They wanted Mel to modify the program
  672.      so, at the setting of a sense switch on the console,
  673.      they could change the odds and let the customer win.
  674.  
  675.      Mel balked.
  676.      He felt this was patently dishonest,
  677.      which it was,
  678.      and that it impinged on his personal integrity as a programmer,
  679.      which it did,
  680.      so he refused to do it.
  681.      The Head Salesman talked to Mel,
  682.      as did the Big Boss and, at the boss's urging,
  683.      a few Fellow Programmers.
  684.      Mel finally gave in and wrote the code,
  685.      but he got the test backwards,
  686.      and, when the sense switch was turned on,
  687.      the program would cheat, winning every time.
  688.      Mel was delighted with this,
  689.      claiming his subconscious was uncontrollably ethical,
  690.      and adamantly refused to fix it.
  691.  
  692.      After Mel had left the company for greener pa$ture$,
  693.      the Big Boss asked me to look at the code
  694.      and see if I could find the test and reverse it.
  695.      Somewhat reluctantly, I agreed to look.
  696.      Tracking Mel's code was a real adventure.
  697.  
  698.      I have often felt that programming is an art form,
  699.      whose real value can only be appreciated
  700.      by another versed in the same arcane art;
  701.      there are lovely gems and brilliant coups
  702.      hidden from human view and admiration, sometimes forever,
  703.      by the very nature of the process.
  704.      You can learn a lot about an individual
  705.      just by reading through his code,
  706.      even in hexadecimal.
  707.      Mel was, I think, an unsung genius.
  708.  
  709.      Perhaps my greatest shock came
  710.      when I found an innocent loop that had no test in it.
  711.      No test. *None*.
  712.      Common sense said it had to be a closed loop,
  713.      where the program would circle, forever, endlessly.
  714.      Program control passed right through it, however,
  715.      and safely out the other side.
  716.      It took me two weeks to figure it out.
  717.  
  718.      The RPC-4000 computer had a really modern facility
  719.      called an index register.
  720.      It allowed the programmer to write a program loop
  721.      that used an indexed instruction inside;
  722.      each time through,
  723.      the number in the index register
  724.      was added to the address of that instruction,
  725.      so it would refer
  726.      to the next datum in a series.
  727.      He had only to increment the index register
  728.      each time through.
  729.      Mel never used it.
  730.  
  731.      Instead, he would pull the instruction into a machine register,
  732.      add one to its address,
  733.      and store it back.
  734.      He would then execute the modified instruction
  735.      right from the register.
  736.      The loop was written so this additional execution time
  737.      was taken into account ---
  738.      just as this instruction finished,
  739.      the next one was right under the drum's read head,
  740.      ready to go.
  741.      But the loop had no test in it.
  742.  
  743.      The vital clue came when I noticed
  744.      the index register bit,
  745.      the bit that lay between the address
  746.      and the operation code in the instruction word,
  747.      was turned on ---
  748.      yet Mel never used the index register,
  749.      leaving it zero all the time.
  750.      When the light went on it nearly blinded me.
  751.  
  752.      He had located the data he was working on
  753.      near the top of memory ---
  754.      the largest locations the instructions could address ---
  755.      so, after the last datum was handled,
  756.      incrementing the instruction address
  757.      would make it overflow.
  758.      The carry would add one to the
  759.      operation code, changing it to the next one in the instruction set:
  760.      a jump instruction.
  761.      Sure enough, the next program instruction was
  762.      in address location zero,
  763.      and the program went happily on its way.
  764.  
  765.      I haven't kept in touch with Mel,
  766.      so I don't know if he ever gave in to the flood of
  767.      change that has washed over programming techniques
  768.      since those long-gone days.
  769.      I like to think he didn't.
  770.      In any event,
  771.      I was impressed enough that I quit looking for the
  772.      offending test,
  773.      telling the Big Boss I couldn't find it.
  774.      He didn't seem surprised.
  775.  
  776.      When I left the company,
  777.      the blackjack program would still cheat
  778.      if you turned on the right sense switch,
  779.      and I think that's how it should be.
  780.      I didn't feel comfortable
  781.      hacking up the code of a Real Programmer.
  782.  
  783. [This is one of hackerdom's great heroic epics, free verse or no.  In a
  784. few spare images it captures more about the esthetics and psychology
  785. of hacking than every scholarly volume on the subject put together.
  786. For an opposing point of view, see the entry for {real programmer}.]
  787.  
  788.