÷ƒ’À;è TeX output 1995.03.25:2333‹ÿÿÿÿŸî>»�Ÿçd}�‘í÷� ŽŽ Äy?� ýIíÝ�‘ëÌó4ò"V½p cmbx10ßLiterate‘óFProgrammingŽ‘í»‰÷� Ÿ¿ˆ�‘$ýóò"V cmbx10ÂDonald–ÕTE.“Kn�®9uthŽŸ �‘$ýó|{Ycmr8­Computer–ÕXScience“DepartmenšÃŽt,“Stanford“Univ˜ersit˜y‘ÿJª,“Stanford,“CA“94305,“USAŽŸ ïȉ÷� Ÿ.��Ÿê�‘$ýó5Ò ž& cmb10àThe–Áauthor“and“his“assošGciates“ha•¸ãv“e–Áb˜een“exp˜erimenš¸ãting“for“the“past“sev˜eral“y˜ears“with“a“program-ޤ �‘$ýming–¨language“and“došGcumen�¸ãtation“system“called“óßêêW‘ÿ*ªe“understand“a“compli-Ž¡�cated–ÕÉsystem“bš¸ãy“understanding“its“simple“parts,‘ïLand“b˜yŽ¡�understanding–àthe“simple“relations“b�Get•¸ãw“een–àthose“partsŽ¡�and–Štheir“immediate“neighš¸ãb�Gors.‘ÜIf“w˜e“express“a“pro-Ž¡�gram–âas“a“wš¸ãeb“of“ideas,‘ùw˜e“can“emphasize“its“structuralŽ¡�prop�Gerties–UUin“a“natural“and“satisfying“w•¸ãa“y‘ÿ*ª.ަ�‘ ÈWEB–Ó«itself“is“cš¸ãhie y“a“com˜bination“of“t˜w˜o“other“lan-Ž¡�guages:‘ƒO(1)–^a“do�Gcumen�¸ãt“formatting“language“and“(2)“aŽ¡�programming–òÍlanguage.‘PïMy“protot�¸ãyp�Ge“ÈWEB“«system“usesŽŽŽŽŸê»�’ ’èóm#½R cmss10¾submitted–UUto“THE“COMPUTER“JOURNAL‘ ÷ó6pÚãi cmssdc10á1ŽŒ‹*Ÿî>»�Ÿîd}�’Î}/­D.–ÕXE.“KNUTHŽŽ Äy?��� ýE†Á�‘íT�‘þU>Ÿ'EŽ‘ãxX–¿�as“the“do�Gcumen�¸ãt“formatting“language“and“óo´‹Ç cmr9¬P‘ÿ:«AS-ޤ �‘íî¹CAL–/Æ«as“the“programming“language,‘7Ibut“the“same“prin-Ž¡�‘íî¹ciples–JÁwš¸ãould“apply“equally“w˜ell“if“other“languages“w˜ereŽ¡�‘íî¹substituted.‘){Instead–’‘of“T�‘þU>Ÿ'EŽ‘ãxX,“one“could“use“a“languageŽ¡�‘íî¹lik�¸ãe–¤ Scrib�Ge“or“T‘ÿ*ªro ;‘ˆinstead“of“¬P‘ÿ:«ASCAL«,“one“could“useŽ¡�‘íADš¾9A«,–¬ALGOL«,“¬LISP«,“¬COBOL«,“¬F˜OR‘ÿ:«TRAN«,“¬APL«,“¬C«,“etc.,Ž¡�‘íî¹or–÷Ževš¸ãen“assem˜bly“language.‘R…The“main“p�Goin˜t“is“that“ÈWEBŽ¡�‘íis–niinherenš¸ãtly“bilingual,‘t®and“that“suc˜h“a“com˜bination“ofŽ¡�‘íî¹languages›Õkpro•¸ãv“es˜to˜b�Ge˜m“uc“h˜more˜p�Go“w“erful˜than˜eitherŽ¡�‘íî¹single–‚§language“bš¸ãy“itself.‘ù¼ÈWEB“«do�Ges“not“mak˜e“the“otherŽ¡�‘íî¹languages–UUobsolete;“on“the“con�¸ãtrary‘ÿ*ª,“it“enhances“them.Ž© ž@�‘÷îºI‘µJnaturally–µsc�¸ãhose“T�‘þU>Ÿ'EŽ‘ãxX“to“bšGe“the“do˜cumen�¸ãt“formattingŽ¡�‘íî¹language,›W°in–$the“ rst“ÈWEB“«system,˜b�Gecause“T�‘þU>Ÿ'EŽ‘ãxX“is“m�¸ãyŽ¡�‘íî¹o•¸ãwn›½×creation;�Ÿü^ÿóÙ“ Rcmr7®1Ž‘n‹«I‘½¼w“an“ted˜to˜acquire˜a˜lot˜of˜exp�GerienceŽ¡�‘íî¹in–ˆwharnessing“T�‘þU>Ÿ'EŽ‘ãxX“to“a“v‘ÿqÇarietš¸ãy“of“di eren˜t“tasks.‘-}I“c˜hoseŽ¡�‘íP‘ÿ:«ASCAL–ò «as“the“programming“language“b�Gecause“it“hasŽ¡�‘íî¹receiv•¸ãed›qåsuc“h˜widespread˜supp�Gort˜from˜educational˜in-Ž¡�‘íî¹stitutions–¾_all“o•¸ãv“er–¾_the“wš¸ãorld;‘òäit“is“not“m˜y“fa˜v˜orite“lan-Ž¡�‘íî¹guage–¡Dfor“system“programming,‘ô@but“it“has“b�Gecome“aŽ¡�‘íî¹\second–ïØlanguage"“for“so“man�¸ãy“programmers“that“itŽ¡�‘íî¹proš¸ãvides–©˜an“exceptionally“e ectiv˜e“medium“of“comm˜u-Ž¡�‘íî¹nication.‘~F‘ÿ*ªurthermore–IxÈWEB“«itself“has“a“macro-pro�GcessingŽ¡�‘íî¹abilitš¸ãy–|Àthat“mak˜es“¬P‘ÿ:«ASCAL«'s“limitations“largely“irrele-Ž¡�‘íî¹v‘ÿqÇan�¸ãt.ަ�‘÷îºDo�Gcumenš¸ãt–;ßformatting“languages“are“new˜comers“toŽ¡�‘íî¹the–Ïgcomputing“scene,‘ê1but“their“use“is“spreading“rapidly‘ÿ*ª.Ž¡�‘íî¹Therefore–ŽMI'm“con denš¸ãt“that“w˜e“will“bšGe“able“to“exp˜ectŽ¡�‘íî¹eac•¸ãh›ùÝmem“b�Ger˜of˜the˜next˜generation˜of˜programmers˜toŽ¡�‘íî¹bšGe–0lfamiliar“with“a“do˜cumenš¸ãt“language“as“w˜ell“as“a“pro-Ž¡�‘íî¹gramming–nîlanguage,‘µSas“part“of“their“basic“education.Ž¡�‘íî¹Once–Õka“pšGerson“kno�¸ãws“b˜oth“of“the“underlying“languages,Ž¡�‘íî¹there's–láno“tric�¸ãk“at“all“to“learning“ÈWEB«,“b�Gecause“the“ÈWEBŽ¡�‘íuser's–UUmanš¸ãual“is“few˜er“than“ten“pages“long.ަ�‘÷îºA‘”‡ÈWEB–”·«user“writes“a“program“that“serv�¸ães“as“the“sourceŽ¡�‘íî¹language–R@for“t•¸ãw“o›R@di eren“t˜system˜routines.‘hˆ(See˜Fig-Ž¡�‘íî¹ure–ź1.)‘Â÷One“line“of“pro�Gcessing“is“called“Ïwe‘ÿ}'aving‘¨7«theŽ¡�‘íî¹w�¸ãeb;‘it–†ÇprošGduces“a“do˜cumen�¸ãt“that“describ˜es“the“pro-Ž¡�‘íî¹gram–èhclearly“and“that“facilitates“program“main�¸ãtenance.Ž¡�‘íî¹The–O8other“line“of“pro�Gcessing“is“called“Ïtangling‘1µ«the“w�¸ãeb;Ž¡�‘íî¹it–Ulpro�Gduces“a“mac�¸ãhine-executable“program.‘r The“pro-Ž¡�‘íî¹gram–’and“its“došGcumen�¸ãtation“are“b˜oth“generated“fromŽ¡�‘íî¹the–´›same“source,‘ÔÀso“they“are“consistenš¸ãt“with“eac˜h“other.ŽŸfJÂ��Ÿ±õX��‘r ”T�‘þU>Ÿ'EŽ‘ãxXŽŽŸ '���‘NÆLÈTEXŽ�‘M‡�Ÿöó3*à=»G® manfntÞYŽŽ�‘jÅó !",š cmsy10·‘ÿ[Ú�‘þã�Ž–Ž>�‘þã�Ž“�‘þã�Ž‘ê!Ž��’˜-CÈDVIŽ�’–öÞYŽŽŽ¡����‘ òFŸüÈWEAVEŽŽ‘:27·%ŽŽŸñÆ���‘"ñÈWEBŽ�‘!²IŸöÞYŽŽŽŸ����‘²IŸÈTANGLEŽŽ‘:27·&ŽŽŸ ñÆ���‘NÆLÈPASŽ�‘M‡�ŸöÞYŽŽ�‘jÅ·‘ÿ[Ú�‘þã�Ž–Ž>�‘þã�Ž“�‘þã�Ž‘ê!Ž��’˜-CÈRELŽ�’–öÞYŽŽŽŸ ��‘hÚU¬P‘ÿ:«ASCALŽŽŽŽŸ<�‘íî¹áFigure‘*¨1.‘¿û¾Dual–UUusage“of“a“ÈWEB“¾ le.ŽŸ?�‘÷Let's–týlošGok“at“this“pro˜cess“in“sligh�¸ãtly“more“detail.‘'Sup-Ž¡�‘íî¹p�Gose–¸yš¸ãou“ha˜v˜e“written“a“ÈWEB“«program“and“put“it“in˜toŽ¡�‘íî¹a–aˆcomputer“text“ le“called“ÈCOB.WEB‘aB«(sa�¸ãy).‘–_T‘ÿ*ªo“gener-Ž¡�‘íî¹ate–·†hardcopš¸ãy“do�Gcumen˜tation“for“y˜our“program,‘×y˜ou“canŽ¡�‘íî¹run–nthe“ÈWEAVE‘]«pro�Gcessor;‘*»this“is“a“system“program“thatŽ¡�‘íî¹tak�¸ães–;athe“ le“ÈCOB.WEB‘;«as“input“and“pro�Gduces“another“ leŽ¡�‘íî¹ÈCOB.TEX‘Ái«as–Á…output.‘¶XThen“y�¸ãou“run“the“T�‘þU>Ÿ'EŽ‘ãxX“pro�Gcessor,Ž¡�‘íî¹whic•¸ãh›½{tak“es˜ÈCOB.TEX–½U«as˜input˜and˜pro�Gduces˜ÈCOB.DVI“«asŽ¡�‘íî¹output.‘÷The–8ãlatter“ le,‘qÇÈCOB.DVI«,“is“a“\device-indep�Genden�¸ãt"Ž¡�‘íî¹binary–˜{description“of“hoš¸ãw“to“t˜ypšGeset“the“do˜cumen�¸ãta-ŽŽ� ýE†Á�’ö‹ tion,‘ý5so–¨oyš¸ãou“can“get“prin˜ted“output“b˜y“applying“oneޤ �’ö‹ more–UUsystem“routine“to“this“ le.Ž© ƒ�’‹ Y‘ÿ*ªou–X-can“also“folloš¸ãw“the“other“branc˜h“of“Figure“1,‘Xãb˜yŽ¡�’ö‹ running–ºŽthe“ÈTANGLE‘ºg«pro�Gcessor;‘î&this“is“a“system“programŽ¡�’ö‹ that–‘*tak�¸ães“the“ le“ÈCOB.WEB‘�ù«as“input“and“pro�Gduces“a“newŽ¡�’ö‹ le–Z·ÈCOB.PAS‘Zx«as“output.‘>Then“y�¸ãou“run“the“¬P‘ÿ:«ASCAL“«com-Ž¡�’ö‹ piler,‘nAwhic•¸ãh›iEcon“v“erts˜ÈCOB.PAS‘i@«to˜a˜binary˜ le˜ÈCOB.RELŽ¡�’ö‹ «(sa•¸ãy).‘e|Finally‘ÿ*ª,‘�6y“ou–Qit's“time“for“me“to“stop“presen˜ting“general“plat-Ž¡�itudes–Fand“to“mo•¸ãv“e–Fon“to“something“tangible.‘½šLet“usŽ¡�lošGok–9¬at“a“real“program“that“has“b˜een“written“in“ÈWEB«.Ž¡�The›¢£n•¸ãum“b�Gered˜paragraphs˜that˜follo“w˜are˜the˜actualŽ¡�output–lof“a“ÈWEB“« le“that“has“b�Geen“\w•¸ão“v“en"›lin“to˜a˜do�Gc-Ž¡�umen�¸ãt;‘-Ña–computer“has“also“generated“the“indexes“thatŽ¡�app�Gear–š!at“the“program's“end.‘@,If“m�¸ãy“claims“for“the“ad-Ž¡�v‘ÿqÇanš¸ãtages–ÜÈof“literate“programming“ha˜v˜e“an˜y“merit,‘þ¥y˜ouŽ¡�should–oØb�Ge“able“to“understand“the“follo�¸ãwing“descriptionŽ¡�more–¼ˆeasily“than“yš¸ãou“could“ha˜v˜e“understo•Go“d–¼ˆthe“sameŽ¡�program–= when“presenš¸ãted“in“a“more“con˜v˜en˜tional“w˜a˜y‘ÿ*ª.Ž¡�Ho•¸ãw“ev“er,‘II‘²am–Ætrying“here“to“explain“the“format“of“ÈWEBŽ¡�«do�Gcumen�¸ãtation–ùÄat“the“same“time“as“I‘ù­am“discussing“theŽ¡�details–>¡of“a“non�¸ãtrivial“algorithm,‘C+so“the“description“b�Ge-Ž¡�loš¸ãw–ò}is“sligh˜tly“longer“than“it“w˜ould“b�Ge“if“it“w˜ere“writtenŽ¡�for–UUpšGeople“who“already“ha•¸ãv“e–UUb˜een“in�¸ãtro˜duced“to“ÈWEB«.ަ�‘ Here,–UUthen,“is“the“computer-generated“output:ŽŸ÷Ó‰ïΩ ôÍ�Prin�¸ãting–UUprimes:‘qÇAn“example“of“ÈWEB‘Ž­�‘ÕTó  b> cmmi10±:Ž–qÅ�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž‘ i·x«1Ž¡�Plan–UUof“the“program‘µÙ�‘ÕT±:Ž–qÅ�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž‘'”·x«3Ž¡�The–UUoutput“phase‘À‡�‘ÕT±:Ž–qÅ�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž‘ 2C·x«5Ž¡�Generating–UUthe“primes‘…Õ�‘ÕT±:Ž–qÅ�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž‘ ÷‘·x«11Ž¡�The–UUinner“lo�Gop‘Ym�‘ÕT±:Ž–qÅ�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž‘Ë)·x«22Ž¡�Index‘€•�‘ÕT±:Ž–qÅ�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž“�‘ÕT:Ž‘òQ·x«27ŽŸô͉ïΦ�Â1.› üPrin�®9ting–ÜEprimes:‘*QAn“example“of“ÈWEBÂ.˜«TheŽ¡�folloš¸ãwing–iÀprogram“is“essen˜tially“the“same“as“EdsgerŽ¡�Dijkstra's–›_\ rst“example“of“step-wise“program“comp�Gosi-Ž¡�tion,"‘ found– son“pages“26{39“of“his“ó!p®0J cmsl10ÌNotes“on“StructuredŽ¡�Programming«,�Ÿü^ÿ®2Ž‘Ÿ¦«but–#3it“has“b�Geen“translated“in�¸ãto“the“ÈWEBŽ¡�«language.Ž¡�‘ [‘þUX[Double›v˜brac•¸ãk“ets˜will˜b�Ge˜used˜in˜what˜follo“ws˜to˜en-Ž¡�close–/#commenš¸ãts“relating“to“ÈWEB“«itself,‘6Çb�Gecause“the“c˜hiefŽ¡�purpšGose–…of“this“program“is“to“in�¸ãtro˜duce“the“reader“toŽ¡�the–ÐoÈWEB“«stš¸ãyle“of“do�Gcumen˜tation.‘ãÈWEB“«programs“are“al-Ž¡�w•¸ãa“ys›lybrok“en˜in“to˜small˜sections,‘²Beac“h˜of˜whic“h˜has˜aŽ¡�serial›UUn•¸ãum“b�Ger;˜the˜presen“t˜section˜is˜n“um“b�Ger˜1.]‘þUX]Ž¡�‘ Dijkstra's–nOprogram“prin�¸ãts“a“table“of“the“ rst“thou-Ž¡�sand–®5prime“n•¸ãum“bšGers.‘|gW‘ÿ*ªe–®5shall“b˜egin“as“he“did,‘Ämb�¸ãy“re-Ž¡�ducing–éÀthe“enš¸ãtire“program“to“its“top-lev˜el“description.Ž¡�[‘þUX[Ev�¸ãery–èsection“in“a“ÈWEB“«program“b�Gegins“with“optionalŽ¡�Ïc‘ÿ}'ommentary‘f¼«ab�Gout–„?that“section,‘®and“ends“with“optionalŽ¡�Ïpr–ÿ}'o“gr“am‘Iôtext‘÷Ë«for–óthe“section.‘VüF‘ÿ*ªor“example,‘yš¸ãou“are“no˜wŽ¡�reading–Ë:part“of“the“commen�¸ãtary“in“·x«1,‘æÙand“the“programŽ¡�text–zfor“·x«1“immediately“folloš¸ãws“the“presen˜t“paragraph.Ž¡�Program–Zbtexts“are“sp�Geci cations“of“¬P‘ÿ:«ASCAL“«programs;Ž¡�they–�–either“use“¬P‘ÿ:«ASCAL“«language“directly‘ÿ*ª,‘›¦or“they“useŽ¡�angle›CPbrac•¸ãk“ets˜to˜represen“t˜¬P‘ÿ:«ASCAL˜«co•Gde˜that˜app“earsŽŽŽŽŸê»�‘íî¹á2‘ ÷¾submitted–UUto“THE“COMPUTER“JOURNALŽŒ‹„Ÿî>»�Ÿîd}�’¯•?­LITERA‘ÿJªTE‘ÕXPR�ÃŽOGRAMMINGŽŽ Äy?��� ýE†Á�‘íin–Ëother“sections.‘_DF‘ÿ*ªor“example,‘(çthe“angle-brac•¸ãk“et‘Ënota-ޤ �‘íî¹tion–ÓÖ`·h›ª¨«Program“to“prin�¸ãt�“±:˜:˜:Ž‘RS«n•¸ãum“b�Gers‘@­2˜·i«'–ÓÖis“ÈWEB«'s“w•¸ãa“y‘ÓÖofŽ¡�‘íî¹saš¸ãying–]the“follo˜wing:‘OK\The“¬P‘ÿ:«ASCAL“«text“to“b�Ge“insertedŽ¡�‘íî¹here–‹9is“called“`Program“to“prinš¸ãt�“±:–ª¨:“:Ž‘Á«n˜um˜b�Gers',‘˜²and“y˜ouŽ¡�‘íî¹can–fã nd“out“all“abšGout“it“b�¸ãy“lo˜oking“at“section“2."‘¦rOneŽ¡�‘íî¹of–âÙthe“main“cš¸ãharacteristics“of“ÈWEB“«is“that“di eren˜t“partsŽ¡�‘íî¹of–Óõthe“program“are“usually“abbreviated,‘íÖb�¸ãy“giving“themŽ¡�‘íî¹sucš¸ãh–UUan“informal“top-lev˜el“description.]‘þUX]Ž© +*�‘÷h‘ª¨«Program–ì/to“prin�¸ãt“the“ rst“thousand“primeŽ¡�‘ î¼n•¸ãum“b�Gers‘@­2‘ª¨·iŽŸVT�‘íî¹Â2.‘ ü«This–z}program“has“no“input,‘ÃÆb�Gecause“wš¸ãe“w˜an˜t“toŽ¡�‘íî¹k�¸ãeep–Ètit“rather“simple.‘BÒThe“result“of“the“program“will“b�GeŽ¡�‘íî¹to–¦prošGduce“a“list“of“the“ rst“thousand“prime“n•¸ãum“b˜ers,Ž¡�‘íî¹and–UUthis“list“will“app�Gear“on“the�“ÏoutputŽ‘#¹ê« le.Ž¡�‘÷îºSince–ƒ˜there“is“no“input,‘Ï)w�¸ãe“declare“the“v‘ÿqÇalue�“±mŽ‘ *«=Ž¡�‘íî¹1000–Oœas“a“compile-time“constan�¸ãt.‘oßThe“program“itself“isŽ¡�‘íî¹capable–�of“generating“the“ rst�“±mŽ‘ åÁ«prime“n•¸ãum“b�Gers–�for“an�¸ãyŽ¡�‘íî¹p�Gositiv�¸ãe�‘[`±mŽ‘ #«,‘\ãas–[`long“as“the“computer's“ nite“limitationsŽ¡�‘íî¹are–UUnot“exceeded.Ž¡�‘÷îº[‘þUX[The–8ãprogram“text“bšGelo�¸ãw“sp˜eci es“the“\expanded“mean-Ž¡�‘íî¹ing"–ãVof“`·h›ª¨«Program“to“prin�¸ãt�“±:˜:˜:Ž‘qS«n•¸ãum“b�Gers‘@­2˜·i«';‘ Vnotice‘ãVthatŽ¡�‘íî¹it›=lin•¸ãv“olv“es˜the˜top-lev“el˜descriptions˜of˜three˜other˜sec-Ž¡�‘íî¹tions.‘ú When–-lthose“top-lev�¸ãel“descriptions“are“replacedŽ¡�‘íî¹bš¸ãy–8ãtheir“expanded“meanings,‘qÇa“syn˜tactically“correct“¬P‘ÿ:«AS-Ž¡�‘íî¹CAL–UU«program“will“b�Ge“obtained.]‘þUX]ަ�‘íî¹·h‘ª¨«Program–ùto“prin�¸ãt“the“ rst“thousand“primeŽ¡�‘ î¼n•¸ãum“b�Gers‘@­2‘ª¨·i‘ÇŽ¡��‘íî¹ÂprogramŽ�‘ÌãÏprint�‘�‰ffŽ‘®primesŽ‘Siu«(�ÏoutputŽ‘@«);Ž¡��‘÷îºÂconstŽ�‘†'±mŽ‘!ö«=‘Ç1000;Ž¡�‘î»·h›ª¨«Other–UUconstan�¸ãts“of“the“program‘@­5˜·iŽ¡��‘÷îºÂv‘ÿ\rarŽ‘ зh›ª¨«V‘ÿ*ªariables–UUof“the“program‘@­4˜·iŽ¡��‘î»Âb�QÇeginŽ‘ ”·h‘ª¨«Prinš¸ãt–UUthe“ rst�“±mŽ‘ra«prime“n˜um˜b�Gers‘@­3‘ª¨·i«;Ž¡��‘î»ÂendŽ‘û'«.ŽŸ +*�‘íî¹­This–ÕXco�b�Gegins“with“commen�¸ãts“and“ends“with“programŽ¡�text.‘/^The–”‡commenš¸ãts“motiv‘ÿqÇate“and“explain“notew˜orth˜yŽ¡�features–UUof“the“program“text.]‘þUX]ަ�·h‘ª¨«Prinš¸ãt–UUthe“ rst�“±mŽ‘ra«prime“n˜um˜b�Gers‘@­3‘ª¨·i‘ÇŽ¡�‘ h›ª¨«Fill–UUtable�“±pŽ‘ ²ª«with“the“ rst�“±mŽ‘ra«prime“n•¸ãum“b�Gers‘@­11˜·i«;Ž¡�‘ ·h›ª¨«Prin�¸ãt–UUtable�“±pŽ‘ �Y­8˜·iŽŸ +*�­This–ÕXco�If–�¸the“program“is“correct,�‘¸ ±pŽ‘À «[�±kŽ‘…V«]Ž¡�’ö‹ will–ñ°either“b�Ge“equal“to“±p�Ÿÿ´kŽ‘Ý@«or“it“will“not“yš¸ãet“ha˜v˜e“b�GeenŽ¡�’ö‹ assigned–UUan�¸ãy“v‘ÿqÇalue.Ž¡�’‹ [‘þUX[Incidenš¸ãtally‘ÿ*ª,‘r±our–:program“will“ev˜en˜tually“mak˜e“use“ofŽ¡�’ö‹ sevš¸ãeral–8úmore“v‘ÿqÇariables“as“w˜e“re ne“the“data“structures.Ž¡�’ö‹ All–'3of“the“sections“where“v‘ÿqÇariables“are“declared“willŽ¡�’ö‹ b�Ge–:àcalled“`·h›ª¨«V‘ÿ*ªariables“of“the“program‘@­4˜·i«';‘­¦the“n•¸ãum“b�GerŽ¡�’ö‹ `­4«'–×Ôin“this“name“refers“to“the“presenš¸ãt“section,‘øtwhic˜h“isŽ¡�’ö‹ the–âÁ rst“section“to“sp�Gecify“the“expanded“meaning“ofŽ¡�’ö‹ `·h›ª¨«V‘ÿ*ªariables–Ì[‘þUX[and“in“orderŽ¡�to–(%illustrate“more“of“the“facilities“of“ÈWEB«,]‘þUX]‘PJa“few“macroŽ¡�de nitions–^îfor“lo•¸ãw-lev“el–^îoutput“instructions“are“in�¸ãtro-Ž¡�duced–yÁhere.‘ß All“of“the“output-orien�¸ãted“commands“inŽ¡�the–ç.remainder“of“the“program“will“b�Ge“stated“in“terms“ofŽ¡� vš¸ãe–îÅsimple“primitiv˜es“called�“Ïprint�‘�‰ffŽ‘®stringŽ‘6C†«,�‘IÏprint�‘�‰ffŽ‘®inte‘ÿ}'gerŽ‘;"¯«,Ž¡��Ïprint�‘�‰ffŽ‘®entryŽ‘1ô«,�‘UUÏnew�‘�‰ffŽ‘®lineŽ‘(ü›«,–UUand�“Ïnew�‘�‰ffŽ‘®p‘ÿ}'ageŽ‘, ©«.Ž¡�‘ [‘þUX[Sections–±Þof“a“ÈWEB“«program“are“allo•¸ãw“ed–±Þto“con�¸ãtainŽ¡�Ïmacr‘ÿ}'o‘Íde nitions‘¤Z«bšGet•¸ãw“een–Ò9the“op˜ening“commen�¸ãts“andŽ¡�the–Œ(closing“program“text.‘AThe“general“format“for“eac�¸ãhŽ¡�section–y¸is“actually“tripartite:‘º�commen�¸ãtary‘ÿ*ª,‘‚Ñthen“de ni-Ž¡�tions,‘¦then–b«program.‘™ÉAnš¸ãy“of“the“three“parts“ma˜y“b�GeŽ¡�absenš¸ãt;‘¸‘for–ìÒexample,‘R±the“presen˜t“section“con˜tains“noŽ¡�program‘UUtext.]‘þUX]ŽŽŽŽŸê»�’ ’è¾submitted–UUto“THE“COMPUTER“JOURNAL‘ ÷á3ŽŒ‹B¥Ÿî>»�Ÿîd}�’Î}/­D.–ÕXE.“KNUTHŽŽ Äy?��� ýE†Á�‘÷[‘þUX[Simple–`Åmacros“simply“substitute“a“bit“of“¬P‘ÿ:«ASCALޤ �‘íco�Gde– �for“an“iden•¸ãti er.‘ŽuP“arametric– �macros“are“similar,Ž¡�‘íî¹but–¼ˆthey“also“substitute“an“argumenš¸ãt“wherev˜er“`�È#Ž‘?ý«'“o�Gc-Ž¡�‘íî¹curs–Zin“the“macro“de nition.‘VÉThe“ rst“three“macro“def-Ž¡�‘íî¹initions–¼Ìhere“are“parametric;‘ï¥the“other“t•¸ãw“o–¼Ìare“simple.]‘þUX]Ž©J��‘÷îºÂde neŽ�‘yZÏprint�‘�‰ffŽ‘®stringŽ‘LΫ(�È#Ž›?ý«)–Ç·�“ÏwriteŽ‘ãÜ«(�È#Ž˜«)Ž¡�‘)î¿·f‘ª¨«put–UUa“givš¸ãen“string“in˜to“the�“ÏoutputŽ‘#¹ê« le‘ª¨·gŽ¡��‘÷îºÂde neŽ�‘yZÏprint�‘�‰ffŽ‘®inte‘ÿ}'gerŽ‘Q˜À«(�È#Ž‘?ý«)–Ç·�“ÏwriteŽ‘ãÜ«(�È#Ž‘«:“1)Ž¡�‘)î¿·f‘ª¨«put–YAa“givš¸ãen“in˜teger“in˜to“the�“ÏoutputŽ‘#Á« le,Ž¡�‘)î¿in–cLdecimal“notation,‘fÉusing“only“as“man�¸ãyŽ¡�‘)î¿digit–UUp�Gositions“as“necessary‘ª¨·gŽ¡��‘÷îºÂde neŽ�‘yZÏprint�‘�‰ffŽ‘®entryŽ‘J�N«(�È#Ž‘?ý«)–�·�“ÏwriteŽ‘�Ì«(�È#Ž‘Á«:�“ÏwwŽ‘a_«)‘ ·f‘ª¨«lik�¸ãeŽ¡��‘)î¿Ïprint�‘�‰ffŽ‘®inte‘ÿ}'gerŽ‘b%«,‘2ºbut�‘*ÏwwŽ‘4«c�¸ãharacter‘*p�GositionsŽ¡�‘)î¿are–UU lled,“inserting“blanks“at“the“left‘ª¨·gŽ¡��‘÷îºÂde neŽ�‘yZÏnew�‘�‰ffŽ‘®lineŽ‘A縷�‘ÇÏwrite�‘�‰ffŽ‘®lnŽ‘/Ãx·f‘ª¨«adv‘ÿqÇance–/ëto“a“new“lineŽ¡�‘)î¿in–UUthe�“ÏoutputŽ‘#¹ê« le‘ª¨·gŽ¡��‘÷îºÂde neŽ�‘yZÏnew�‘�‰ffŽ‘®p‘ÿ}'ageŽ‘E·�‘éRÏp‘ÿ}'ageŽ‘!½·f‘ª¨«adv‘ÿqÇance–iÞto“a“new“pageŽ¡�‘)î¿in–UUthe�“ÏoutputŽ‘#¹ê« le‘ª¨·gŽŸ”5�‘íî¹Â7.‘ ü«Sevš¸ãeral–”lv‘ÿqÇariables“are“needed“to“go˜v˜ern“the“outputŽ¡�‘íî¹prošGcess.‘ ºWhen–mkw�¸ãe“b˜egin“to“prin�¸ãt“a“new“page,‘óotheŽ¡�‘íî¹v‘ÿqÇariable�‘XöÏp–ÿ}'age�‘�‰ffŽ‘®numb“erŽ‘<ò «will–XöbšGe“the“ordinal“n•¸ãum“b˜er–Xöof“thatŽ¡�‘íî¹page,‘$mand�‘2Ïp‘ÿ}'age�‘�‰ffŽ‘®o setŽ‘5~¿«will–2b�Ge“suc�¸ãh“that�“±pŽ‘ 2«[�Ïp‘ÿ}'age�‘�‰ffŽ‘®o setŽ‘/N[«]“isŽ¡�‘íî¹the–YL rst“prime“to“b�Ge“prin�¸ãted.‘}«Similarly‘ÿ*ª,�‘šI±pŽ‘ ¢I«[�Ïr‘ÿ}'ow�‘�‰ffŽ‘®o setŽ‘+Û*«]Ž¡�‘íî¹will–UUb�Ge“the“ rst“prime“in“a“givš¸ãen“ro˜w.Ž¡�‘÷îº[‘þUX[Notice– the“notation“`+‘Ç·«'“b�Gelo�¸ãw;‘1Ùthis“indicates“thatŽ¡�‘íî¹the–iõpresen�¸ãt“section“has“the“same“name“as“a“previousŽ¡�‘íî¹section,‘niso–iethe“program“text“will“bšGe“app˜ended“to“someŽ¡�‘íî¹text–UUthat“w�¸ãas“previously“sp�Geci ed.]‘þUX]ަ�‘íî¹·h›ª¨«V‘ÿ*ªariables–UUof“the“program‘@­4˜·i�‘Ç«+Ž‘ Ž6·Ž¡��‘íî¹Ïp–ÿ}'age�‘�‰ffŽ‘®numb“erŽ‘&.Ö«:�‘¯²Ïinte‘ÿ}'gerŽ‘#ÊM«;‘ ·f‘ª¨«one–tKmore“than“the“n•¸ãum“b�GerŽ¡�‘ î¼of–UUpages“prin�¸ãted“so“far‘ª¨·gŽ¡��‘íî¹Ïp‘ÿ}'age�‘�‰ffŽ‘®o setŽ‘=«:�‘ƒšÏinte‘ÿ}'gerŽ‘#ž5«;‘ ·f‘ª¨«index–^>inš¸ãto�“±pŽ‘ Ä|«for“the“ rst“en˜tryŽ¡�‘ î¼on–UUthe“curren�¸ãt“page‘ª¨·gŽ¡��‘íî¹Ïr‘ÿ}'ow�‘�‰ffŽ‘®o setŽ‘Éã«:�‘�”Ïinte‘ÿ}'gerŽ‘#¸/«;‘ ·f‘ª¨«index–k;inš¸ãto�“±pŽ‘ Þv«for“the“ rst“en˜tryŽ¡�‘ î¼in–UUthe“currenš¸ãt“ro˜w‘ª¨·gŽ¡��‘íî¹±cŽ‘òB”«:‘qÇ0�‘DZ:‘ª¨:Ž�‘ ÇÏc‘ÿ}'cŽ‘Š÷«;‘ ·f›ª¨«runs–UUthrough“the“columns“in“a“ro�¸ãw˜·gŽŸ”5�‘íî¹Â8.‘ ü«Noš¸ãw–G:that“appropriate“auxiliary“v‘ÿqÇariables“ha˜v˜e“b�GeenŽ¡�‘íî¹in�¸ãtro•Gduced,‘!the›Åpro“cess˜of˜outputting˜table�˜±pŽ‘’>«almostŽ¡�‘íî¹writes‘UUitself.ަ�‘íî¹·h›ª¨«Prin�¸ãt–UUtable�“±pŽ‘ �Y­8˜·i‘ÇŽ¡��‘÷îºÂb�QÇeginŽ�‘”Ïp–ÿ}'age�‘�‰ffŽ‘®numb“erŽ‘Q›;· –Ç«1;�‘Ïp‘ÿ}'age�‘�‰ffŽ‘®o setŽ‘7s· “«1;Ž¡��‘÷îºÂwhileŽ�‘ž±Ïp‘ÿ}'age�‘�‰ffŽ‘®o setŽ‘G´$·�‘DZmŽ�‘ä$ÂdoŽŽ¡��‘î»b�QÇeginŽ‘ ”·h›ª¨«Output–UUa“page“of“answ�¸ãers‘@­9˜·i«;Ž¡��‘î»Ïp–ÿ}'age�‘�‰ffŽ‘®numb“erŽ‘<õð· �‘ÇÏp–ÿ}'age�‘�‰ffŽ‘®numb“erŽ‘=@«+‘8à1;Ž¡��‘î»Ïp‘ÿ}'age�‘�‰ffŽ‘®o setŽ‘4.· �‘ÇÏp‘ÿ}'age�‘�‰ffŽ‘®o setŽ‘4NS«+�‘8àÏrrŽ‘w·�‘8àÏc‘ÿ}'cŽ‘ üÅ«;Ž¡��‘î»ÂendŽ‘û'«;Ž¡��‘÷îºÂendŽŽŸJ�‘íî¹­This–ÕXco�ÿÜ«);Ž¡��‘÷îºÏprint�‘�‰ffŽ‘®inte‘ÿ}'gerŽ‘0 «(�±mŽ‘Ç·«);Ž¡��‘÷îºÏprint�‘�‰ffŽ‘®stringŽ‘+C{«(�È ÝPrimeÈ ÝNumbersÈ Ý---È ÝPageÈ Ž’ˆ²«);Ž¡��‘÷îºÏprint�‘�‰ffŽ‘®inte‘ÿ}'gerŽ‘0 «(�Ïp–ÿ}'age�‘�‰ffŽ‘®numb“erŽ‘8@«);�‘Ïnew�‘�‰ffŽ‘®lineŽ–*§F«;�‘Ïnew�‘�‰ffŽ‘®lineŽ“«;Ž¡�‘ î¼·f›ª¨«there's–UUa“blank“line“after“the“heading˜·gŽ¡��‘÷îºÂforŽ�‘ LËÏr‘ÿ}'ow�‘�‰ffŽ‘®o setŽ‘7ý¢· �‘Õ­Ïp‘ÿ}'age�‘�‰ffŽ‘®o setŽ�‘4ùµÂtoŽ�‘BBÏp‘ÿ}'age�‘�‰ffŽ‘®o setŽ‘s•R«+�‘>µÏrrŽ‘‚»·‘>µ«1Ž¡��‘î½ÂdoŽ‘'G·h›ª¨«Output–UUa“line“of“answ�¸ãers‘@­10˜·i«;Ž¡��‘÷îºÏnew�‘�‰ffŽ‘®p‘ÿ}'ageŽ‘ §«;Ž¡��‘÷îºÂendŽŽŸJ�‘íî¹­This–ÕXco�1«],�‘UU±pŽ˜«[1“+“2“·�“ÏrrŽ‘ >1«],�‘UU±:–ª¨:“:Ž‘ª¤«;ŽŽ¡�’ö‹ a–ösimilar“pattern“holds“for“eac�¸ãh“v‘ÿqÇalue“of“the�“Ïr‘ÿ}'ow�‘�‰ffŽ‘®o setŽ‘.à «.Ž© ß�’ö‹ ·h›ª¨«Output–UUa“line“of“answ�¸ãers‘@­10˜·i‘Çޤ ��’‹ Âb�QÇeginŽ�’0XforŽ�’0…©±cŽ’7 œ· –Ç«0�“ÂtoŽ�‘ÇÏc‘ÿ}'cŽ‘ÃÕ·‘8à«1�‘UUÂdoŽŽ¡��’ ‹ ifŽ�’¬ÐÏr‘ÿ}'ow�‘�‰ffŽ‘®o setŽ’CÀÚ«+�‘8à±cޑś·�‘8àÏrrŽ‘I·�‘DZmŽ�‘ä$ÂthenŽŽ¡��’‹Ïprint�‘�‰ffŽ‘®entryŽ’E“«(�±pŽ‘«[�Ïr‘ÿ}'ow�‘�‰ffŽ‘®o setŽ‘. «+�‘8à±cޑś·�‘8àÏrrŽ‘ >1«]);Ž¡��’‹ Ïnew�‘�‰ffŽ‘®lineŽ’&2R«;Ž¡��’‹ ÂendŽŽŸ ß�’ö‹ ­This–ÕXco�‘Ç«1“is“not“prime“if“and“only“if“there“existsŽ¡�a–Lmprime“n•¸ãum“b�Ger›Lm±p�Ÿÿ´nŽ‘8–±<‘Çj‘Þø«suc“h˜that�˜±jŽ‘ Iž«is˜a˜m“ultiple˜of˜±p�Ÿÿ´nŽ‘q~«.Ž¡�‘ Therefore–JÁthe“section“of“the“program“that“is“calledŽ¡�`·h‘ª¨«Increase�‘bN±jŽ‘ u`«unš¸ãtil–bNit“is“the“next“prime“n˜um˜bšGer‘ª¨·i«'“could“b˜eŽ¡�co�Gded–‹ðvš¸ãery“simply:‘ `�Ârep�QÇeatŽ�‘"˜W±jŽ‘*3· �‘DZjŽ‘ô«+‘¦1;“·h‘ª¨«Giv˜e“to�“Ïj�‘�‰ffŽ‘®primeŽŽ¡�«the–³meaning:�‘-A±jŽ‘‘«is“a“prime“n•¸ãum“b�Ger‘ª¨·i«;�‘aðÂun�®9tilŽ�‘!fÁÏj�‘�‰ffŽ‘®primeŽ‘B•%«'.Ž¡�And–'\to“compute“the“b•Go“olean–'\v‘ÿqÇalue�“Ïj�‘�‰ffŽ‘®primeŽ‘$UÀ«,‘0Žthe“follo�¸ãw-Ž¡�ing–uw�¸ãould“suce:‘±E`�Ïj�‘�‰ffŽ‘®primeŽ‘$*e· �‘üÏtrueŽ‘À™«;�‘„óÂforŽ�‘ú±nŽ‘öž· –ü«1�“ÂtoŽ�‘0â±kŽ�‘+LÂdoŽŽ¡�·h‘ª¨«If�‘UU±pŽ‘]U«[�±nŽ‘š«]–UUdivides�“±jŽ‘«,“set�“Ïj�‘�‰ffŽ‘®primeŽ‘'JÑ· �‘ÇÏfalseŽ‘!·i«'.ަ�Â14.‘ ü«Ho•¸ãw“ev“er,‘# it–2is“p�Gossible“to“obtain“a“m•¸ãuc“h–2more“ef-Ž¡� cienš¸ãt–øùalgorithm“b˜y“using“more“facts“of“n˜um˜b�Ger“theory‘ÿ*ª.Ž¡�In–pthe“ rst“place,‘vÉwš¸ãe“can“sp�Geed“things“up“a“bit“b˜y“rec-Ž¡�ognizing–r‘that“±p�Ÿÿ®1Ž‘ ì«=‘¢y2“and“that“all“subsequen�¸ãt“primesŽ¡�are–T ošGdd;‘Txtherefore“w�¸ãe“can“let�“±jŽ‘ XØ«run“through“o˜dd“v‘ÿqÇaluesŽ¡�only‘ÿ*ª.‘qÇOur–UUprogram“noš¸ãw“tak˜es“the“follo˜wing“form:ŽŸ ß�·h‘ª¨«Increase�‘UU±jŽ‘ [n«unš¸ãtil–UUit“is“the“next“prime“n˜um˜b�Ger‘@­14‘ª¨·i‘ÇŽ¡��‘ Ârep�QÇeatŽ�‘-a½±jŽ‘4Ù™· �‘DZjŽ‘ °¼«+‘8à2;Ž¡�‘·h‘ª¨«UpšGdate–UUv‘ÿqÇariables“that“dep˜end“on�“±jŽ‘ F­20‘ª¨·i«;Ž¡�‘·h‘ª¨«Giv�¸ãe–Àto�“Ïj�‘�‰ffŽ‘®primeŽ‘(®n«the“meaning:�‘G(±jŽ‘ ·ñ«is“a“primeŽ¡�‘(n•¸ãum“b�Ger‘@­22‘ª¨·i«;Ž¡��‘ Âun�®9tilŽ�‘&QÀÏj�‘�‰ffŽ‘®primeŽŽŸ ß�­This–ÕXco�»�Ÿîd}�’¯•?­LITERA‘ÿJªTE‘ÕXPR�ÃŽOGRAMMINGŽŽ Äy?��� ýE†Á�‘íî¹Â15.‘ ü«The�‘‘£Ârep�QÇeatŽ‘)/­«lo�Gop–‘£in“the“previous“section“in�¸ãtro-ޤ �‘íî¹duces–£la“b•Go“olean–£lv‘ÿqÇariable�“Ïj�‘�‰ffŽ‘®primeŽ‘%ÑЫ,‘öñso“that“it“will“notŽ¡�‘íî¹b�Ge–>!necessary“to“resort“to“a�“ÂgotoŽ‘5«statemen�¸ãt.‘,+(W‘ÿ*ªe“areŽ¡�‘íî¹folloš¸ãwing–UUDijkstra,�Ÿü^ÿ®2Ž‘ÑÈ«not“Kn˜uth.�Ÿü^ÿ®3Ž‘|s«)Ž© ÁF�‘íî¹·h›ª¨«V‘ÿ*ªariables–UUof“the“program‘@­4˜·i�‘Ç«+Ž‘ Ž6·Ž¡��‘íî¹Ïj�‘�‰ffŽ‘®primeŽ‘«:�‘qÇÏb–ÿ}'o“ole“anŽ‘$æw«;‘ ·f›ª¨«is�‘UU±jŽ‘ [n«a–UUprime“n•¸ãum“b�Ger?˜·gŽŸ‚Œ�‘íî¹Â16.‘ ü«In– oorder“to“makš¸ãe“the“o�Gdd-ev˜en“tric˜k“w˜ork,‘wµw˜eŽ¡�‘íî¹m�¸ãust–£wof“course“initialize“the“v‘ÿqÇariables�“±jŽ‘T;«,�‘¶ÿ±kŽ‘ ‘Çj�R;Ž¡�‘íand–chif�“±jŽ‘ w”«is“o�Gdd,‘¦ìw�¸ãe“need“only“test“for“divisors“in“theޤ �‘íî¹set–Al·f±p«[2]±;�–ª¨:“:“:Ž‘ÿ÷;‘ª¨p«[�Ïor‘ÿ}'dŽ‘ùÍ·‘€î«1]·g«.‘ 6 This“is“m•¸ãuc“h–Alfaster“thanŽ¡�‘íî¹testing–XÞdivisibilitš¸ãy“b˜y“·f±p«[2]±;�–ª¨:“:“:Ž‘ÿ÷;‘ª¨p«[±k�P—«]·g«,‘™Ásince�“Ïor‘ÿ}'dŽ‘*›«tendsŽ¡�‘íî¹to–«†b�Ge“m•¸ãuc“h–«†smaller“than�“±kŽ‘ 0Ü«.‘ á(Indeed,‘Áwhen�“±kŽ‘ Üb«is“large,Ž¡�‘íî¹the–ªÈcelebrated“\prime“n•¸ãum“b�Ger–ªÈtheorem"“implies“thatŽŸ Ka�‘íî¹the–UUv‘ÿqÇalue“of�“Ïor‘ÿ}'dŽ‘#‰«will“b�Ge“appro�¸ãximately“2��Ÿ÷s0óú±u cmex10½pŽ�‘ Ÿ÷s0‰fe ¬ŸŒÐ�±k�P—=�«lnŽ‘ ÿÿ±kŽŽŽ‘$ ­«.)Ž¡�‘÷îºLet–Hûus“therefore“inš¸ãtro�Gduce�“Ïor‘ÿ}'dŽ‘ Õ«in˜to“the“data“struc-Ž¡�‘íî¹ture.‘ 4GA‘@Vmomen•¸ãt's›@Õthough“t˜mak“es˜it˜clear˜that�˜Ïor‘ÿ}'dŽŽ¡�‘ícš¸ãhanges–Êin“a“simple“w˜a˜y“when�“±jŽ‘ ¶X«increases,‘Land“that“an-Ž¡�‘íî¹other–UUv‘ÿqÇariable�“Ïsquar‘ÿ}'eŽ‘#fµ«facilitates“the“upšGdating“pro˜cess.ަ�‘íî¹·h›ª¨«V‘ÿ*ªariables–UUof“the“program‘@­4˜·i�‘Ç«+Ž‘ Ž6·Ž¡��‘íî¹Ïor‘ÿ}'dŽ‘ýg˜«:‘qÇ2�‘DZ:‘ª¨:Ž�‘ ÇÏor‘ÿ}'d�‘�‰ffŽ‘®maxŽ‘2<«;Ž¡�‘ î¼·f‘ª¨«the–UUsmallest“index“·›Ç«2“suc�¸ãh“that“±p�Ÿü^ÿ�®2ŽŸv�´or�7dŽŽ‘Pé±>˜j‘=3·gŽ¡��‘íî¹Ïsquar‘ÿ}'eŽ‘ ªÄ«:�‘qÇÏinte‘ÿ}'gerŽ‘#Œb«;‘ ·f�‘ª¨Ïsquar‘ÿ}'eŽ‘!-Ë«=‘DZp�Ÿü^ÿ�®2ŽŸv�´or�7dŽŽ‘4y·gŽ©‚Œ�‘íî¹Â18.‘ ü·h›ª¨«Initialize–UUthe“data“structures‘@­16˜·i�‘Ç«+Ž‘ Ž6·Ž¡��‘÷îºÏor‘ÿ}'dŽ‘ .±· –Ç«2;�‘Ïsquar‘ÿ}'eŽ‘$ƒ#· “«9;ަ�‘íî¹Â19.‘ ü«The–†v‘ÿqÇalue“of�“Ïor‘ÿ}'dŽ‘±ë«will“nev�¸ãer“get“larger“than“a“cer-Ž¡�‘íî¹tain–Ñúv‘ÿqÇalue�“Ïor‘ÿ}'d�‘�‰ffŽ‘®maxŽ‘)$«,‘ñ#whicš¸ãh“m˜ust“b�Ge“c˜hosen“sucien˜tlyŽ¡�‘íî¹large.‘ýžIt–ÙGturns“out“that�“Ïor‘ÿ}'dŽ‘+m«nev�¸ãer“exceeds“30“whenŽ¡��‘íî¹±mŽ‘ù}ˆ«=‘Ç1000.ŽŸ ÁF�‘íî¹·h›ª¨«Other–UUconstan�¸ãts“of“the“program‘@­5˜·i�‘Ç«+Ž‘ Ž6·Ž¡��‘÷îºÏor‘ÿ}'d�‘�‰ffŽ‘®maxŽ‘õü«=‘Ç30;‘ ·f‘ª¨±p�Ÿü^ÿ�®2ŽŸv�´or�7d�‘™˜‰ffŽ‘™šmaxŽŽ‘#p¯«m�¸ãust–UUexceed“±p�Ÿÿ´mŽ‘ CC·gަ�‘íî¹Â20.‘ ü«When�‘dº±jŽ‘ z8«has–dºb�Geen“increased“bš¸ãy“2,‘”Ùw˜e“m˜ust“increaseŽ¡��‘íî¹Ïor‘ÿ}'dŽ‘¼í«b•¸ãy›UUunit“y˜when˜±j‘Y£«=–DZp�Ÿü^ÿ�®2ŽŸv�´or�7dŽŽ‘ ‰Ñ«,˜i.e.,˜when�˜±jŽ‘ Í1«=�“Ïsquar‘ÿ}'eŽ‘ƒ#«.ŽŸ ÁF�‘íî¹·h‘ª¨«UpšGdate–UUv‘ÿqÇariables“that“dep˜end“on�“±jŽ‘ F­20‘ª¨·i‘ÇŽ¡��‘÷îºÂifŽ�‘}±jŽ‘ ˆY«=�‘ÇÏsquar‘ÿ}'eŽ�‘"ØxÂthenŽŽ¡��‘î»b�QÇeginŽ�‘ ”Ïor‘ÿ}'dŽ‘2Óþ· �‘ÇÏor‘ÿ}'dŽ‘x׫+‘8à1;Ž¡�‘î»·h‘ª¨«UpšGdate–UUv‘ÿqÇariables“that“dep˜end“on�“Ïor‘ÿ}'dŽ‘8­21‘ª¨·i«;Ž¡��‘î»ÂendŽŽŸ ÁF�‘íî¹­This–ÕXco�Úsurprisingly–?Xsubtle“p�Goinš¸ãt“arises“here:‘EÍHo˜w“do“w˜eŽ¡�‘íî¹kno�¸ãw–6 that“±p�Ÿÿ´or�7dŽ‘¿Û«has“already“b�Geen“computed,–n6i.e.,“thatŽ¡��‘íî¹Ïor‘ÿ}'dŽ�~”·�‘ü±kŽ‘œR«?‘•If–…Dthere“w�¸ãere“a“gap“in“the“sequence“of“primeŽ¡�‘íî¹n•¸ãum“b�Gers,›Ð1suc“h–„kthat“±p�Ÿÿ´k�+B®+1Ž‘Ëα>‘À;p�Ÿü^ÿ�®2ŽŸv�´kŽŽ‘ oû«for“some“±k�P—«,˜then“thisŽ¡�‘íî¹part–àùof“the“program“wš¸ãould“refer“to“the“y˜et-uncomputedŽ¡�‘íî¹v‘ÿqÇalue�‘UU±pŽ‘]U«[�±kŽ‘¾6«+‘8à1]–UUunless“some“sp�Gecial“test“w�¸ãere“made.Ž¡�‘÷îºF–ÿ*ªortunately“,‘. there–Ï�are“no“suc�¸ãh“gaps.‘àKBut“no“sim-Ž¡�‘íî¹ple–Ýípro�Gof“of“this“fact“is“kno�¸ãwn.‘ �F‘ÿ*ªor“example,‘Euclid'sŽŽ� ýE†Á�’ö‹ famous–Í&demonstration“that“there“are“in nitely“man�¸ãyޤ �’ö‹ prime›JÁn•¸ãum“b�Gers˜is˜strong˜enough˜to˜pro“v“e˜only˜thatŽ¡�’ö‹ ±p�Ÿÿ´k�+B®+1Ž‘€Á±<«=‘u.±p�Ÿÿ®1Ž�‘'±:–ª¨:“:Ž‘|jp�Ÿÿ´kŽ‘6ß«+‘KO1.‘ DÂAdv‘ÿqÇanced›ðþb•Go“oks˜on˜n•¸ãum“b�GerŽ¡�’ö‹ theory–R@come“to“our“rescue“bš¸ãy“sho˜wing“that“m˜uc˜h“moreŽ¡�’ö‹ is–÷true;‘lfor“example,‘p\Bertrand's“p�Gostulate"“states“thatŽ¡�’ö‹ ±p�Ÿÿ´k�+B®+1Ž‘Ò«±<‘Ç«2±p�Ÿÿ´kŽ‘@å«for–UUall“±k�P—«.Ž©+�’ö‹ ·h‘ª¨«UpšGdate–UUv‘ÿqÇariables“that“dep˜end“on�“Ïor‘ÿ}'dŽ‘8­21‘ª¨·i‘ÇŽ¡��’‹ Ïsquar‘ÿ}'eŽ’ /· �‘DZpŽ‘Ï«[�Ïor‘ÿ}'dŽ›xß«]–8à·�“±pŽ‘@à«[�Ïor‘ÿ}'dŽ˜«];‘ ·f‘ª¨«at–UUthis“p�Goin�¸ãt�“Ïor‘ÿ}'dŽ‘•L·�‘DZkŽ‘ ÷·gޤ +�’ö‹ ­See–ÕXalso“section“25.Ž¡�’ö‹ This–ÕXco�»�Ÿîd}�’Î}/­D.–ÕXE.“KNUTHŽŽ Äy?��� ýE†Á�‘íis–ÊÏan“o�Gdd“mš¸ãultiple“of“±p�Ÿÿ´nŽ‘ «[�±nŽ‘š«]–Ç=�“±jŽ�‘ Í1ÂthenŽ�‘&RÏj�‘�‰ffŽ‘®primeŽ‘JGû· �“ÏfalseŽŽŸ '&�‘íî¹­This–ÕXco�Ÿ'EŽ‘ãxX“will“b�Ge“ableŽ¡�to–î¸reconstruct“all“of“ÈPRIMES.WEB‘îž«b�¸ãy“lo�Goking“only“at“theŽ¡�formatted–UUoutput“and“Figure“2.ަ�‘ Figure–‰à2a“starts“with“T�‘þU>Ÿ'EŽ‘ãxX“commands“(not“sho�¸ãwn“inŽ¡�full)–ÒÁthat“makš¸ãe“it“con˜v˜enien˜t“to“t˜yp�Geset“double“brac˜k-Ž¡�ets›Øú[–þã�[�±:–ª¨:“:Ž‘ ª§«]“]˜and˜to˜giv•¸ãe˜sp�Gecial˜t“yp�Gographic˜treatmen“t˜toŽ¡�names–5¢lik�¸ãe“`ÈWEB«'›5hand“`¬P‘ÿ:«ASCAL«'.“A˜ÈWEB“«user“generallyŽ¡�b�Gegins–k¥bš¸ãy“declaring“suc˜h“spšGecial“asp˜ects“of“the“do˜cu-Ž¡�menš¸ãt–5þformat;‘@pfor“example,‘Ÿ'EŽ‘ãxX“language“or“in“¬P‘ÿ:«ASCAL“«language,‘cde-Ž¡�p�Gending–UUon“the“con�¸ãtext.ŽŽŽŽŸê»�‘íî¹á6‘ ÷¾submitted–UUto“THE“COMPUTER“JOURNALŽŒ‹­çŸî>»�Ÿîd}�’¯•?­LITERA‘ÿJªTE‘ÕXPR�ÃŽOGRAMMINGŽŽ Äy?���‘íî¹ ý;í'‰ffïΟ ?Ã�È\font\ninerm=cmr9ޤ �\let\mc=\ninerm–?ý%“medium“capsŽ¡�\def\WEB{{\tt‘?ýWEB}}Ž¡�\def\PASCAL{{\mc‘?ýPASCAL}}Ž¡�\def\[{\ifhmode\‘?ý\fi$[\mkern-2mu[$}Ž¡�\def\]{$]\mkern-2mu]$\‘?ý}ŽŸ���Ÿø�‘ÿò.ޤ�‘ÿò.Ž¡�‘ÿò.ŽŽŽŽ¡�\hyphenation{Dijk-stra}Ž©Mü�@*–?ýPrinting“primes:“An“example“of“\WEB.Ž¡�The–?ýfollowing“program“is“essentially“the“sameŽ¡�as–?ýEdsger“Dijkstra's“@^Dijkstra,“Edsger@>Ž¡�``first–?ýexample“of“step-wise“programŽ¡�composition,''–?ýfound“on“pages“26--39Ž¡�of–?ýhis“{\sl“Notes“on“StructuredŽ¡�Programming},$^\Dijk$‘ úbut–?ýit“has“beenŽ¡�translated–?ýinto“the“\WEB\“language.“@.WEB@>ަ�\[Double–?ýbrackets“will“be“used“in“whatŽ¡�follows–?ýto“enclose“comments“relating“to“\WEB\ŽŸ���Ÿø�‘ÿò.ޤ�‘ÿò.Ž¡�‘ÿò.ŽŽŽŽ¡�an–?ýinformal“top-level“description.\]ަ�@p–?ý@ަ�áFigure‘*¨2a.‘¿û¾The–UUb�Geginning“of“ÈPRIMES.WEB¾.ŽŸ¦)‰ffïΟ!ôû�‘ «Eac�¸ãh–Õlsection“of“the“program“b�Gegins“either“with“`È@‘?ý«'Ž¡�(i.e.,›œŠat-sign–ŽLand“space)“or“`È@*«'“(i.e.,˜at-sign“and“aster-Ž¡�isk);‘ ÈWEB–xt«supplies“the“section“n•¸ãum“b�Gers‘xtautomatically‘ÿ*ª.Ž¡�The–œ¼latter“case,–î–`È@*«',“denotes–œ¼a“Ïmajor‘Áse‘ÿ}'ction‘a«of“theŽ¡�program,‘ffor–/xwhicš¸ãh“a“sp�Gecial“title“is“giv˜en.‘0This“titleŽ¡�will–j6appšGear“in“b˜oldface“t�¸ãyp˜e,‘onand“it“will“also“app˜ear“inŽ¡�the–…Etable“of“con•¸ãten“ts,‘‘Aand–…Eas“a“running“headline“on“allŽ¡�pages–"£of“the“w•¸ão“v“en›"£do�Gcumen“tation˜un“til˜another˜ma‘Ž8jorŽ¡�section–Yìb�Gegins.‘‹Eac�¸ãh“ma‘Ž8jor“section“starts“at“the“top“ofŽ¡�a–�}page.‘ö@(Sucš¸ãh“page“b�Geginnings“ha˜v˜e“b�Geen“indicated“b˜yŽ¡�horizon�¸ãtal–ðhlines“in“our“example,‘-b�Gecause“ÈWEB«'s“normalŽ¡�output–Ò?format“has“b�Geen“adapted“to“the“format“of“thisŽ¡�journal.‘ BThe–3)output“of“ÈWEAVE‘2ï«usually“has“a“lot“moreŽ¡�white–áÛspace,‘øóand“the“individual“lines“of“text“are“usuallyŽ¡�quite–UUa“bit“wider.)Ž¡�‘ The–åÂlines“that“folloš¸ãw“in“Figure“2a“sho˜w“a“few“moreŽ¡�ÈWEB–^«instructions:‘ƒT`È@^«'“marks“the“b�Geginning“of“an“indexŽ¡�enš¸ãtry–ÿsto“b�Ge“set“in“roman“t˜yp�Ge;‘`È@>«'“marks“the“end“of“anŽ¡�argumen�¸ãt–ýPto“a“ÈWEB“«command;‘§`È@.«'“marks“the“b�GeginningŽ¡�of–¿an“index“enš¸ãtry“to“b�Ge“set“in“t˜yp�Gewriter“t˜yp�Ge;‘Öt`È@p«'Ž¡�marks–/Œthe“b�Geginning“of“the“¬P‘ÿ:«ASCAL“«program;‘<$and“`È@<«'Ž¡�marks–ðˆthe“b�Geginning“of“a“top-lev�¸ãel“description,–±i.e.,“of‘ðˆaŽ¡�section–UUname“in“the“ÈWEB“«program.Ž¡�‘ Figure–Ýl2b“immediately“follo�¸ãws“Figure“2a“in“the“ÈWEBŽ¡�« le.‘ÒñThis–Ëmaterial“is“what“generated“·x«2“of“the“do�Gc-Ž¡�umen�¸ãtation,‘óÛand– óit“illustrates“the“bilingual“nature“ofŽ¡�ÈWEB«:–XûThe“commenš¸ãtary“at“the“b�Geginning“of“eac˜h“sectionŽ¡�is–?¤t�¸ãyp�Ged“in“T�‘þU>Ÿ'EŽ‘ãxX“language,‘Cûand“the“program“text“at“theŽ¡�end–UUis“t�¸ãyp�Ged“in“¬P‘ÿ:«ASCAL“«language.Ž¡�‘ Language-switc•¸ãhing›³Jb�Get“w“een˜T�‘þU>Ÿ'EŽ‘ãxX˜and˜¬P‘ÿ:«ASCAL˜«is˜o�Gc-Ž¡�casionally–zOdesirable.‘àµF‘ÿ*ªor“example,‘Ã�when“y�¸ãou“refer“toŽ¡�tecš¸ãhnical–«¾details“ab�Gout“the“program,‘ÁXy˜ou“usually“w˜an˜tŽ¡�to–!hdescrib�Ge“them“in“¬P‘ÿ:«ASCAL«,“hence“yš¸ãou“w˜an˜t“ÈWEAVE‘![«toŽ¡�format–ß—them“with“the“tš¸ãyp�Gographic“con˜v˜en˜tions“it“usesŽ¡�for–µ¬P‘ÿ:«ASCAL“«programs.‘\=Con•¸ãv“ersely‘ÿ*ª,‘!¢when›µy“ou˜put˜com-Ž¡�menš¸ãts–jkin“a“¬P‘ÿ:«ASCAL“«program,‘™gy˜ou“w˜an˜t“the“text“of“thoseŽŽ�’ö‹  ý;í'‰ffïΟ HÙ�È@–?ýThis“program“has“no“input,“because“we“wantޤ Í�to–?ýkeep“it“rather“simple.‘ úThe“result“of“theŽ¡�program–?ýwill“be“to“produce“a“list“of“theŽ¡�first–?ýthousand“prime“numbers,“and“this“listŽ¡�will–?ýappear“on“the“|output|“file.Ž©,g�Since–?ýthere“is“no“input,“we“declare“the“valueŽ¡�|m=1000|–?ýas“a“compile-time“constant.“TheŽ¡�program–?ýitself“is“capable“of“generating“theŽ¡�first–?ý|m|“prime“numbers“for“any“positive“|m|,Ž¡�as–?ýlong“as“the“computer's“finite“limitationsŽ¡�are–?ýnot“exceeded.ަ�\[The–?ýprogram“text“below“specifies“theŽ¡�``expanded–?ýmeaning''“of“`\X2:Program“to“printŽ¡�$\ldots$–?ýnumbers\X';“notice“that“it“involvesŽ¡�the–?ýtop-level“descriptions“of“three“otherŽ¡�sections.–?ýWhen“those“top-level“descriptionsŽ¡�are–?ýreplaced“by“their“expanded“meanings,“aŽ¡�syntactically–?ýcorrect“\PASCAL\“program“willŽ¡�be‘?ýobtained.\]ަ�@=Ž¡�program‘?ýprint_primes(output);Ž¡�const‘?ý@!m=1000;Ž¡�@@;Ž¡�var–?ý@@;Ž¡�begin–?ý@;Ž¡�end.ŽŸš�áFigure‘*¨2b.‘¿û¾The–UUÈWEB“¾co�Gde“that“generated“·x¾2.ŽŸ“`‰ffïΟ HÙ�È@–?ýIn“order“to“keep“this“program“reasonablyŽ¡�free–?ýof“notations“that“are“uniquelyŽ¡�\PASCAL–?ýesque,“\[and“in“order“to“illustrateŽŸÍ���Ÿø�‘ÿò.ޤ�‘ÿò.Ž¡�‘ÿò.ŽŽŽŽ¡�The–?ýfirst“three“macro“definitions“here“areŽ¡�parametric;–?ýthe“other“two“are“simple.\]ަ�@d‘?ýprint_string(#)==write(#)Ž¡�–?ý{put“a“given“string“into“the“|output|“file}Ž¡�@d‘?ýprint_integer(#)==write(#:1)Ž¡�–?ý{put“a“given“integer“into“the“|output|Ž¡�‘ úfile,–?ýin“decimal“notation,“using“only“asŽ¡�‘ úmany–?ýdigit“positions“as“necessary}Ž¡�@d‘?ýprint_entry(#)==write(#:ww)Ž¡�–?ý{like“|print_integer|,“butŽ¡�‘ ú|ww|–?ýcharacter“positions“are“filled,Ž¡�‘ úinserting–?ýblanks“at“the“left}Ž¡�@d‘?ýnew_line==write_lnŽ¡�–?ý{advance“to“a“new“line“in“the“|output|“file}Ž¡�@d‘?ýnew_page==pageŽ¡�–?ý{advance“to“a“new“page“in“the“|output|“file}ŽŸš�áFigure‘*¨2c.‘¿û¾The–UUÈWEB“¾co�Gde“that“generated“·x¾6.ŽŸuljffïΟ#,f�«commenš¸ãts–”¡to“b�Ge“formatted“b˜y“T�‘þU>Ÿ'EŽ‘ãxX“in“the“normal“w˜a˜y‘ÿ*ª.ޤ �ÈWEB–ËË« les“use“vš¸ãertical“bars“to“in˜tro�Gduce“¬P‘ÿ:«ASCAL“«format-Ž¡�ting–nðin“the“midst“of“T�‘þU>Ÿ'EŽ‘ãxX“formatting;‘{½for“example,‘uWFig-Ž¡�ure–Ux2b“saš¸ãys“`Èthe–?ý|output|“file«'–Uxin“order“to“t˜yp�GesetŽ¡�`the�‘UUÏoutputŽ‘#¹ê« le'.ŽŸ Í�‘ The–ø.program“text“in“Figure“2b“b�Gegins“with“`È@<«'“in-Ž¡�stead–Kîof“with“the“`È@p«'“command“used“in“Figure“2a,Ž¡�b�Gecause–Kîthe“program“text“in“·x«2“is“the“expansion“ofŽŽŽŽŸê»�’ ’è¾submitted–UUto“THE“COMPUTER“JOURNAL‘ ÷á7ŽŒ‹Í Ÿî>»�Ÿîd}�’Î}/­D.–ÕXE.“KNUTHŽŽ Äy?��� ýE†Á�‘ía–°Fsp�Geci c“top-lev�¸ãel“description.‘‚›Notice“that“the“top-ޤ �‘íî¹lev�¸ãel–n\description“has“b�Geen“abbreviated“to“`È@«'.‘•¡Since– óthe“names“of“sections“tend“toŽ¡�‘íî¹b�Ge–É”rather“long,‘åˆit“is“a“nš¸ãuisance“to“t˜yp�Ge“them“in“full“eac˜hŽ¡�‘íî¹time;‘1–ÈWEB–¶«alloš¸ãws“y˜ou“to“t˜yp�Ge“`È...«'“after“y˜ou“ha˜v˜e“giv˜enŽ¡�‘íî¹enough–UUtext“to“iden�¸ãtify“the“remainder“uniquely‘ÿ*ª.Ž© 6Ê�‘÷îºThe–r¥`È@!«'“op�Geration“in“the“program“text“of“Figure“2bŽ¡�‘íî¹go•¸ãv“erns–çÛthe“underlining“of“index“en�¸ãtries.‘MIThe“`È@;«'“sp�Gec-Ž¡�‘íî¹i es–ô±an“inš¸ãvisible“sym˜b�Gol“that“has“the“e ect“of“a“semi-Ž¡�‘íî¹colon–/Åin“¬P‘ÿ:«ASCAL“«synš¸ãtax.‘eBCommands“suc˜h“as“these“areŽ¡�‘íî¹comparativ•¸ãely›»×unimp�Gortan“t,‘Õwbut˜they˜are˜a“v‘ÿqÇailable˜forŽ¡�‘íî¹pšGolishing–ÑÜup“the“ nal“do˜cumenš¸ãtation“when“y˜ou“w˜an˜t“toŽ¡�‘íî¹mainš¸ãtain–UU ne“con˜trol.ަ�‘÷îºFigure–¤m2c“shoš¸ãws“k˜ey“p�Gortions“of“the“ÈWEB“«text“thatŽ¡�‘íî¹generated–ź·x«6.‘AéNotice“that“the“command“`È@d«'“in�¸ãtro�GducesŽ¡�‘íî¹a–Ä—macro“de nition.‘¿�All“features“of“ÈWEB“«that“app�Gear“inŽ¡�‘íî¹our–niexample“program“are“illustrated“in“Figures“2a,‘t®2b,Ž¡�‘íî¹and–ñ2c;‘>ìthe“remainder“of“ÈPRIMES.WEB‘ðç«simply“uses“theŽ¡�‘íî¹same›'ôcon•¸ãv“en“tions˜again˜and˜again.‘b§In˜fact,‘1most˜of˜theŽ¡�‘íî¹ÈWEB–ü"« le“is“m•¸ãuc“h–ü"simpler“than“the“examples“sho�¸ãwn“here;Ž¡�‘íî¹Figure–UU2“has“illustrated“only“the“dicult“parts.ŽŸ' �‘íû‰ïÎŽŸ€�‘íî¹ÂE.–ÕTTHE“T‘ÿ «ANGLED“OUTPUTŽ‘í€‰ïΟ(‘�«Figure–"Õ3“sho�¸ãws“the“¬P‘ÿ:«ASCAL“«program“ÈPRIMES.PAS‘"È«thatŽ¡�results–â»when“ÈTANGLE‘âT«is“applied“to“ÈPRIMES.WEB«.“ThisŽ¡�program–Ñäis“not“inš¸ãtended“for“h˜uman“consumption|it'sŽ¡�only–­suppšGosed“to“b˜e“readable“b�¸ãy“a“¬P‘ÿ:«ASCAL“«compiler|Ž¡�so–ŽOÈTANGLE‘Ž«došGes“not“go“to“great“pains“to“pro˜duce“a“b˜eau-Ž¡�tiful–ä format.‘LNotice“that“underlines“ha•¸ãv“e–ä b�Geen“remo•¸ãv“edŽ¡�from–�¬the“iden�¸ãti er“names,‘ïÁand“that“all“of“the“lettersŽ¡�ha•¸ãv“e–%°bšGeen“con•¸ãv“erted–%°to“upp˜ercase“(except“in“strings);Ž¡�ÈTANGLE‘Tg«tries–T¨to“prošGduce“a“format“that“will“b˜e“acceptableŽ¡�to–UUa“standard“¬P‘ÿ:«ASCAL“«compiler.ަ�‘ ÈTANGLE‘É�«remo•¸ãv“es–Éîall“of“the“commen�¸ãtary“in“the“ÈWEBŽ¡�« le,‘÷but–ß‚it“inserts“new“commenš¸ãts“of“its“o˜wn.‘J�If“for“someŽ¡�reason–Ay�¸ãou“need“to“correlate“the“tangled“¬P‘ÿ:«ASCAL“«co�GdeŽ¡�with–ethe“w•¸ão“v“en›edo�Gcumen“tation,‘0(y“ou˜can˜ nd˜the˜pro-Ž¡�gram–¦text“for,–É)saš¸ãy‘ÿ*ª,“·x«8–¦b˜y“lošGoking“b˜et•¸ãw“een–¦the“commen�¸ãtsŽ¡�`È{8:}«'–UUand“`È{:8}«'.ަ�‘ A‘5comparison–Fof“Figure“3“to“Figure“2“should“mak�¸ãe“itŽ¡�clear–S¨wh�¸ãy“the“ÈTANGLE‘S§«pro�Gcessor“has“acquired“its“name.ŽŸ' �Ÿû‰ïÎŽŸ€�ÂF.–ÕTTHE“W•®9O“VEN‘ÕTOUTPUTŽŸ€‰ïΟ(‘�«I›®¢men�¸ãtioned–®¹earlier“that“ÈWEAVE˜«is“a“program“that“con-Ž¡�vš¸ãerts–ÿVa“ le“lik˜e“ÈPRIMES.WEB‘ÿA«in˜to“a“ le“ÈPRIMES.TEX‘ÿA«thatŽ¡�is–ùÄa“syn�¸ãtactically“correct“source“ le“for“T�‘þU>Ÿ'EŽ‘ãxX.“Figure“4Ž¡�givš¸ães–�†a“sampling“of“ÈPRIMES.TEX«,“whic˜h“is“ev˜en“more“un-Ž¡�readable–Î\than“ÈPRIMES.PAS«.“The“instructions“that“causeŽ¡�T�‘þU>Ÿ'EŽ‘ãxX–Óòto“pro�Gduce“formatted“¬P‘ÿ:«ASCAL“«programs,‘íÒwith“ap-Ž¡�propriate–yÆtš¸ãyp�Gefaces“and“inden˜tation,–¥¯etc.,“are‘yÆsomewhatŽ¡�complex–èúbšGecause“they“are“supp˜osed“to“givš¸ãe“decen˜t“re-Ž¡�sults–UUregardless“of“the“page“size.ަ�‘ There–!~is“no“need“to“discuss“Figure“4“further“in“theŽ¡�presen�¸ãt›€–pap•Ger,‘‹fb“ecause˜the˜details˜of˜\prett•¸ãy˜prin“ting"Ž¡�are–‰‹not“relev‘ÿqÇanš¸ãt“to“m˜y“main“theme.‘iI‘‰~ha˜v˜e“sho˜wn“thisŽ¡�m•¸ãuc“h–¥of“ÈPRIMES.TEX‘¤ý«only“to“makš¸ãe“the“p�Goin˜t“that“it“isŽ¡�nice–-to“ha•¸ãv“e–-a“program“lik�¸ãe“ÈWEAVE‘«to“do“all“the“format-Ž¡�ting;–UUcomputer“programs“are“not“easy“to“t�¸ãyp�Geset.ŽŽ�’ö‹  ý;í'‰ffïΟo�È{1:}{2:}PROGRAM‘?ýPRINTPRIMES(OUTPUT);ޤ �CONST‘?ýM=1000;{5:}RR=50;CC=4;WW=10;{:5}{19:}Ž¡�ORDMAX=30;{:19}VAR{4:}Ž¡�P:ARRAY[1..M]OF‘?ýINTEGER;{:4}{7:}Ž¡�PAGENUMBER:INTEGER;PAGEOFFSET:INTEGER;Ž¡�ROWOFFSET:INTEGER;C:0..CC;{:7}{12:}J:INTEGER;Ž¡�K:0..M;{:12}{15:}JPRIME:BOOLEAN;{:15}{17:}Ž¡�ORD:2..ORDMAX;SQUARE:INTEGER;{:17}{23:}Ž¡�N:2..ORDMAX;{:23}{24:}Ž¡�MULT:ARRAY[2..ORDMAX]OF‘?ýINTEGER;{:24}Ž¡�BEGIN{3:}{11:}{16:}J:=1;K:=1;P[1]:=2;{:16}Ž¡�{18:}ORD:=2;SQUARE:=9;{:18};Ž¡�WHILE–?ýK»�Ÿîd}�’¯•?­LITERA‘ÿJªTE‘ÕXPR�ÃŽOGRAMMINGŽŽ Äy?���‘íî¹ ý;í'‰ffïΟ \‹�È\input‘?ýwebmacޤ #—�\font\ninerm=cmr9Ž©#—���Ÿø�‘ÿò.ޤ�‘ÿò.Ž¡�‘ÿò.ŽŽŽŽ¡�syntactically–?ýcorrect“\PASCAL\“program“willŽ¡�be‘?ýobtained.\]ŽŸjÄ�\Y\P$\4\X2:Program–?ýto“print“the“firstŽ¡�thousand–?ýprime“numbers\X\S$\6Ž¡�\4\&{program}\1\‘ ú\37$\\{print\_primes}(%Ž¡�\\{output})$;\6Ž¡�\4\&{const}‘?ý\37$\|m=1000$;\5Ž¡�\X5:Other–?ýconstants“of“the“program\X\6Ž¡�\4\&{var}–?ý\37\X4:Variables“of“the“program\X\6Ž¡�\&{begin}–?ý\37\X3:Print“the“first“\|m“primeŽ¡�numbers\X;\6Ž¡�\&{end}.\parŽ¡�\U‘?ýsection~1.\fiަ���Ÿø�‘ÿò.ޤ�‘ÿò.Ž¡�‘ÿò.ŽŽŽŽ¡�The–?ýfirst“three“macro“definitions“here“areŽ¡�parametric;–?ýthe“other“two“are“simple.\]ŽŸjÄ�\Y\P\D‘?ý\37$\\{print\_string}(\#)\S\\{write}(%Ž¡�\#)$\C{put–?ýa“given“string“into“the“%Ž¡�\\{output}‘?ýfile}\parަ���Ÿø�‘ÿò.ޤ�‘ÿò.Ž¡�‘ÿò.ŽŽŽŽ¡�\inxŽ¡�\:{Bertrand,–?ýJoseph,“postulate},“21.Ž¡�\:\\{boolean},‘?ý15.ަ���Ÿø�‘ÿò.ޤ�‘ÿò.Ž¡�‘ÿò.ŽŽŽŽ¡�\:\.{WEB},‘?ý1.Ž¡�\:\\{write},‘?ý6.Ž¡�\:\\{write\_ln},‘?ý6.Ž¡�\:\\{ww},–?ý\[5],“6.Ž¡�\finަ���Ÿø�‘ÿò.ޤ�‘ÿò.Ž¡�‘ÿò.ŽŽŽŽ¡�\:\X4,–?ý7,“12,“15,“17,“23,“24:Variables“ofŽ¡�the‘?ýprogram\XŽ¡�\U‘?ýsection~2.Ž¡�\conŽŸG-�áFigure‘*¨4.‘¿û¾T�‘þŸ8ãEŽ‘øæX–UUp�¸ãrogram“generated“from“the“ÈWEB“¾ le.ŽŸæv‰ffïΟ#jÄ�«a–Ùñfew“features“that“do“not“sho�¸ãw“up“in“the“ÈPRIMES‘ÙÏ«ex-ޤ �ample–UUconsidered“ab�Go•¸ãv“e:Ž©G.��1)Ž‘ There–ž–are“facilities“to“o•¸ãv“erride–ž–ÈWEAVE«'s“automatic“for-Ž¡�matting–®Qof“¬P‘ÿ:«ASCAL“«programs.‘|ºF‘ÿ*ªor“example,‘Ä�it“is“p�Gos-Ž¡�sible–Z to“force“a“statemen�¸ãt“to“b�Gegin“on“a“new“line,‘[6or“toŽ¡�force–FÞsevš¸ãeral“statemen˜ts“to“app�Gear“on“the“same“line,‘IÃorŽ¡�to–}9suggest“a“desirable“breakp�Goin�¸ãt“in“the“middle“of“a“longŽ¡�expression.‘EIn–Šunš¸ãusual“cases,‘×ÉÈWEAVE‘Š/«m˜ust“parse“pro-Ž¡�gram–«fragmenš¸ãts“that“are“not“syn˜tactically“complete|Ž¡�for–ãFexample,‘úthere“maš¸ãy“b�Ge“a“Âb�QÇegin“«without“a“matc˜hingŽ¡�Âend«|so–�Äa“ÈWEB“«user“mš¸ãust“b�Ge“giv˜en“a“c˜hance“to“con˜trolŽ¡�the– )results.‘–BF‘ÿ*ªurthermore“there“is“a“facilitš¸ãy“for“c˜hang-Ž¡�ing–„ŠÈWEAVE«'s“formatting“rules“b�¸ãy“declaring“that“a“cer-Ž¡�tain– Êiden�¸ãti er“should“b�Ge“treated“as“a“certain“¬P‘ÿ:«ASCALŽ¡�«reserv•¸ãed›áw“ord,‘üor˜b“y˜declaring˜that˜a˜certain˜reserv“edŽ¡�wš¸ãord–UUshould“b�Ge“treated“as“an“ordinary“iden˜ti er.ަ��2)Ž‘ There–ßÃis“a“w•¸ãa“y–ßÃto“force“ÈTANGLE‘ߟ«to“omit“a“space“b�Ge-Ž¡�t•¸ãw“een›¶ˆt“w“o˜adjacen“t˜pieces˜of˜text,‘ÎÔso˜that˜a˜name˜lik“eŽ¡�`�Ïx3Ž‘ �Ý«'–ËWcan“b�Ge“man�¸ãufactured“from“`�±xŽ‘·«'“and“`�Ï3Ž‘úP«'.‘ÓÌSimilarly‘ÿ*ª,ŽŽ� ýE†Á�’ö‹ there–Gåis“a“w•¸ãa“y–Gåto“pass“an“arbitrary“sequence“of“c�¸ãhar-ޤ �’ö‹ acters–ÚÈthrough“ÈTANGLE‘Ú¦«so“that“the“same“sequence“willŽ¡�’ö‹ app�Gear–èý\v�¸ãerbatim"“in“the“¬P‘ÿ:«ASCAL“« le;‘2Òand“there“is“aŽ¡�’ö‹ w•¸ãa“y–,(to“force“b�Geginning-of-line“in“that“ le.‘öAThe“latterŽ¡�’ö‹ extensions›àha•¸ãv“e˜pro“v“ed˜to˜b�Ge˜necessary˜to˜deal˜withŽ¡�’ö‹ v‘ÿqÇarious–Yønonstandard“con•¸ãv“en“tions–Yøof“di eren�¸ãt“¬P‘ÿ:«ASCALŽ¡�’ö‹ «compilers.‘Z³When–M¤a“commenš¸ãt“in“braces“is“sen˜t“to“theŽ¡�’ö‹ ¬P‘ÿ:«ASCAL–]« le,‘\ÈTANGLE‘I«is“careful“not“to“in�¸ãtro�Gduce“furtherŽ¡�’ö‹ braces–UUinside“the“commen�¸ãt.Ž©p˜��’ö‹ 3)Ž’‹ There–­Ðare“facilities“for“o�Gctal“and“hexadecimal“con-Ž¡�’ö‹ stanš¸ãts–IÐin“ÈWEB“«thees.‘mðÈTANGLE‘IÍ«con˜v˜erts“suc˜h“constan˜ts“toŽ¡�’ö‹ decimal– fform;‘inÈWEAVE‘ 7«givš¸ães“them“an“appropriate“t˜yp�Go-Ž¡�’ö‹ graphic‘UUtreatmen�¸ãt.ަ��’ö‹ 4)Ž’‹ There–zÁis“a“facilit�¸ãy“for“dealing“with“alphab�Getic“con-Ž¡�’ö‹ stanš¸ãts.‘ÝWhen–M•a“program“con˜tains“a“double-quoted“c˜har-Ž¡�’ö‹ acter–!ðlikš¸ãe“È"A"«,‘UÈTANGLE‘!¼«con˜v˜erts“this“to“an“in˜teger“b�Ge-Ž¡�’ö‹ t•¸ãw“een–0“and“127“that“equals“the“corresp�Gonding“¬ASCI�AÇIŽ¡�’ö‹ «cošGde–ÔÈ(in“this“case“65).‘FîThe“use“of“¬ASCI�AÇI‘Ô§«co˜de“facilitatesŽ¡�’ö‹ the–"£construction“of“soft•¸ãw“are–"£that“is“readily“p�GortableŽ¡�’ö‹ from–Qone“macš¸ãhine“to“another,‘� indep�Genden˜t“of“the“ac-Ž¡�’ö‹ tual–UUc�¸ãharacter“set“in“use.ަ��’ö‹ 5)Ž’‹ F‘ÿ*ªurthermore,‘�Êif–�La“double-quoted“constan�¸ãt“is“a“stringŽ¡�’ö‹ of–]†sevš¸ãeral“c˜haracters,‘�lik˜e“È"cat"«,‘�ÈTANGLE‘]H«con˜v˜erts“it“in˜toŽ¡�’ö‹ a–Ëíunique“in�¸ãteger“that“is“128“or“more.‘ÕŽA‘ËÎsp�Gecial“ÏstringŽ¡�’ö‹ p–ÿ}'o“ol‘ÈÝ le‘e„«is–¥)written,‘ùcon�¸ãtaining“all“of“the“strings“thatŽ¡�’ö‹ ha•¸ãv“e–)ubšGeen“sp˜ecially“enco˜ded“in“this“w•¸ãa“y‘ÿ*ª.‘î'I‘)>ha“v“e‘)uusedŽ¡�’ö‹ this–9÷general“mec�¸ãhanism“only“in“large“programs,‘³butŽ¡�’ö‹ exp�Gerience–.²has“shoš¸ãwn“that“it“mak˜es“quite“a“nice“sub-Ž¡�’ö‹ stitute–ëSfor“the“string-pro�Gcessing“capabilities“that“¬P‘ÿ:«AS-Ž¡�’ö‹ CAL›ÓF«lac•¸ãks.‘Fm(Inciden“tally‘ÿ*ª,‘íII‘Ó%noticed˜after˜sev“eral˜mon“thsŽ¡�’ö‹ that–< a“program“needs“to“ha•¸ãv“e–< some“indication“that“theŽ¡�’ö‹ string-p•Go“ol– le“it“is“reading“con�¸ãtains“the“same“stringsŽ¡�’ö‹ that–_=ÈTANGLE‘^ÿ«generated“when“the“program“itself“w�¸ãas“tan-Ž¡�’ö‹ gled.‘_QTherefore–óa“\c•¸ãhec“k–ósum"“is“included“in“the“stringŽ¡�’ö‹ p•Go“ol–*» le;‘8ïeacš¸ãh“program“is“able“to“refer“to“its“o˜wn“c˜hec˜kŽ¡�’ö‹ sum–{!and“to“compare“it“with“the“v‘ÿqÇalue“in“the“ le.‘ã+ThisŽ¡�’ö‹ c•¸ãhec“k-sum–Jextension“w�¸ãas“one“of“the“last“features“to“b�GeŽ¡�’ö‹ added–UUto“ÈWEB«.)ަ��’ö‹ 6)Ž’‹ The–b�ÈPRIMES‘b}«example“illustrates“macros“with“param-Ž¡�’ö‹ eters–®³and“macros“without“parameters.‘}áÈWEB“«also“allo�¸ãwsŽ¡�’ö‹ \n•¸ãumeric"›F¨macros,‘‚üwhic“h˜are˜small˜in“teger˜constan“ts;Ž¡�’ö‹ ÈTANGLE‘-=«is–-ucapable“of“doing“simple“arithmetic“on“suc�¸ãhŽ¡�’ö‹ constanš¸ãts.‘ápThis–Ïãfeature“of“ÈWEB“«w˜as“in˜trošGduced“sp˜eci -Ž¡�’ö‹ cally–±to“o•¸ãv“ercome–±¬P‘ÿ:«ASCAL«'s“unfortunate“inabilit�¸ãy“to“doŽ¡�’ö‹ compile-time–’�arithmetic.‘) F‘ÿ*ªor“example,‘¡ïit“is“imp�GossibleŽ¡�’ö‹ to›79ha•¸ãv“e˜a˜¬P‘ÿ:«ASCAL˜«arra“y˜whose˜b�Gounds˜are˜`0�‘DZ:‘ª¨:Ž‘ Çn–ü§·“«1',Ž¡�’ö‹ or–t¬to“write“`20–MÄ+“3‘ûS:'–t¬as“the“lab�Gel“of“one“of“the“cases“inŽ¡�’ö‹ `Âcase› αx–©Ò«+“±y�[Ù«';‘%¥ÈWEB«'s˜n•¸ãumeric˜macros˜mak“e˜it˜p�Gossible˜forŽ¡�’ö‹ ÈTANGLE–UU«to“prepro�Gcess“sucš¸ãh“constan˜ts.ŽŸ'8�’ö‹ Ÿû‰ïÎŽŸ€�’ö‹ ÂH.–ÕTOCCAM'S“RAZORŽ’ö‹ Ÿ€‰ïΟ*�«I‘^¨wš¸ãould–^ìalso“lik˜e“to“men˜tion“sev˜eral“things“that“w˜ereŽ¡�in•¸ãten“tionally–‘%left“out“of“ÈWEB«,“since“I‘‘ha•¸ãv“e–‘%tried“to“k�¸ãeepŽ¡�the–UUlanguage“as“simple“as“I“could.Ž© 8L�‘ There–8+are“no“\conditional“macros,"‘>nor“do�Ges“ÈTANGLEŽ¡�«ev‘ÿqÇaluate–æ Bo�Golean“expressions“that“migh�¸ãt“in uence“theŽ¡�output.‘BOI–Æìfound“that“ev�¸ãerything“I‘ÆÈneeded“could“b�Ge“doneŽ¡�satisfactorily–UUbš¸ãy“commen˜ting“out“the“optional“co�Gde.ަ�‘ F‘ÿ*ªor–eexample,‘éa“system“program“is“often“designedŽ¡�to–úégather“statistics“abšGout“its“o�¸ãwn“op˜eration,‘$Nbut“suc�¸ãhŽŽŽŽŸê»�’ ’è¾submitted–UUto“THE“COMPUTER“JOURNAL‘ ÷á9ŽŒ‹ ÇŸî>»�Ÿîd}�’Î}/­D.–ÕXE.“KNUTHŽŽ Äy?��� ýE†Á�‘ístatistics-gathering–AMis“p�Goin�¸ãtless“unless“someone“is“actu-ޤ �‘íî¹ally–µgoing“to“use“the“results.‘‘In“order“to“mak�¸ãe“the“in-Ž¡�‘íî¹strumenš¸ãtation–‰Þco�Gde“optional,‘—I‘‰Ðinclude“the“w˜ord“`Âstat«'Ž¡�‘íî¹just–¡ªbšGefore“an�¸ãy“sp˜ecial“co˜de“for“statistics,‘ô¾and“`Âtats«'Ž¡�‘íî¹just–nÔafter“suc�¸ãh“co�Gde;‘û“and“I›n‹tell“ÈWEAVE˜«to“regard“ÂstatŽ¡�‘íand–ûãÂtats“«as“if“they“w�¸ãere“Âb�QÇegin“«and“Âend«.‘SöBut“Âstat“«andŽ¡�‘íî¹Âtats–2(«are“actually“simple“macros.‘@When“I‘1ïdo“w•¸ãan“t‘2(toŽ¡�‘íî¹gather–lîthe“statistics,‘rÕI‘lède ne“Âstat“«and“Âtats“«to“b�Ge“n�¸ãull;Ž¡�‘íî¹but– Yin“a“pro�Gduction“vš¸ãersion“of“the“soft˜w˜are,‘Ä‹I‘ +mak˜e“ÂstatŽ¡�‘íexpand–P÷to“`È@{«'“and“Âtats“«expand“to“`È@}«',‘… where“È@{“«and“È@}Ž¡�‘íare–�˜spšGecial“braces“that“ÈTANGLE‘�Š«do˜es“not“remo•¸ãv“e.‘‘Th“usŽ¡�‘íî¹the–‡3optional“cošGde“app˜ears“as“a“harmless“commen�¸ãt“inŽ¡�‘íî¹the–UU¬P‘ÿ:«ASCAL“«program.Ž¡�‘÷îºÈWEB«'s–Àmacros“are“allo•¸ãw“ed–Àto“ha•¸ãv“e–Àat“most“one“pa-Ž¡�‘íî¹rameter.‘[^Again,‘�I‘ did–this“in“the“inš¸ãterests“of“simplicit˜y‘ÿ*ª,Ž¡�‘íî¹b�Gecause–�I‘�ênoticed“that“most“applications“of“m�¸ãultiple“pa-Ž¡�‘íî¹rameters–ècould“in“fact“b�Ge“reduced“to“the“one-parameterŽ¡�‘íî¹case.‘qüF‘ÿ*ªor–ª¼example,‘supp�Gose“that“yš¸ãou“w˜an˜t“to“de neŽ¡�‘íî¹something‘UUlik�¸ãeޤ8��‘&oDÈmac(�#Ž–?ý1,�#Ž“2)“==“m[�#Ž“1*r+�#Ž“2]ŽŽ¡�‘íwhic�¸ãh–œ…ÈWEB“«došGesn't“p˜ermit.‘GVY‘ÿ*ªou“can“get“essen�¸ãtially“theޤ �‘íî¹same–UUresult“with“t•¸ãw“o–UUone-parameter“macrosŽŸëÆ��Ÿõ��‘&oDÈmac_tail(�#Ž–?ý)“==�“#Ž‘ ú]ŽŽ¡��‘&oDmac(�#Ž–?ý)“==“m[�#Ž“*r+mac_tailŽŽŽŽ©8�‘ísince,–UUe.g.,“`Èmac(a)(b)«'“will“expand“in�¸ãto“`Èm[a*r+b]«'.Ž¡�‘÷îºHere– ˆis“another“example“that“indicates“some“of“theŽ¡�‘íî¹surprising–|generalit�¸ãy“of“one-parameter“macros:‘ÌCon-Ž¡�‘íî¹sider–UUthe“t•¸ãw“o‘UUde nitionsŽŸ%ùÿ��Ÿê��‘ �UÈdefine–?ýtwo_cases(�#Ž“)==case“j“ofŽŽ¡��‘MÏ.1:�#Ž–?ý(1);“2:�#Ž“(2);“endŽŽ¡��‘ �Udefine–?ýreset_file(�#Ž“)==reset(file@��#ŽŽ“)ŽŽŽŽ¦�‘íwhere–ýl`È@&«'“in“the“second“de nition“is“the“concatenationŽ¡�‘íî¹op�Geration–4uthat“pastes“t•¸ãw“o–4utexts“together.‘fÒY‘ÿ*ªou“can“no�¸ãwŽ¡�‘íî¹sa�¸ãyŽ¡��‘.O@Ètwo_cases(reset_file)ŽŽŸã�‘íand–UUthe“resulting“¬P‘ÿ:«ASCAL“«output“will“b�GeŽŸ2q��Ÿß��‘>7Ècase–?ýj“ofŽŽ¡��‘>71:reset(file1);ŽŽ¡��‘>72:reset(file2);ŽŽ¡��‘>7endŽŽŽŽ¦�‘íIn–S:other“w�¸ãords,‘S¦the“name“of“one“macro“can“usefully“b�GeŽ¡�‘íî¹a–�‚parameter“to“another“macro.‘NThis“particular“tric�¸ãkŽ¡�‘íî¹makš¸ães–ïXit“p�Gossible“to“liv˜e“with“¬P‘ÿ:«ASCAL“«compilers“thatŽ¡�‘íî¹do–UUnot“alloš¸ãw“arra˜ys“of“ les.ŽŸ"�‘íû‰ïÎŽŸ€�‘íî¹ÂI.‘ÕTPOR–ÿ «T“ABILITYŽ‘í€‰ïΟñÇ�«One–³$of“the“goals“of“mš¸ãy“T�‘þU>Ÿ'EŽ‘ãxX“researc˜h“has“b�Geen“to“pro-Ž¡�duce–*ZpšGortable“soft•¸ãw“are,‘_›and–*Zthe“ÈWEB‘*#«system“has“b˜eenŽ¡�extremely–¯|helpful“in“this“resp�Gect.‘€;Although“mš¸ãy“o˜wnŽ¡�w�¸ãork–fOis“done“on“a“DEC-10“computer“with“Stanford'sŽ¡�one-of-a-kind–ö©opšGerating“system,‘ ˜the“soft•¸ãw“are‘ö©dev“elop˜edŽ¡�with–ÁÞÈWEB“«has“already“bšGeen“transp˜orted“successfully“to“aŽ¡�wide–¸üv‘ÿqÇarietš¸ãy“of“computers“made“b˜y“other“man˜ufactur-Ž¡�ers–OÂ(including“IBM,“Conš¸ãtrol“Data,‘Ž\XER˜O˜X,“Hewlett-Ž¡�P•¸ãac“k›ÿqÇard),‘¯Kand–jto“a“v˜arietš¸ãy“of“di eren˜t“op�Gerating“sys-Ž¡�tems– ñfor“those“macš¸ãhines.‘›œT‘ÿ*ªo“m˜y“kno˜wledge,‘<no“otherŽŽ� ýE†Á�’ö‹ soft•¸ãw“are–ŠBof“sucš¸ãh“complexit˜y“has“ev˜er“bšGeen“transp˜ortedޤ �’ö‹ to–·�so“manš¸ãy“di eren˜t“mac˜hines.‘=0It“seems“lik˜ely“that“T�‘þU>Ÿ'EŽ‘ãxXŽ¡�’ö‹ will–}ïsošGon“b˜e“op˜erating“on“all“but“the“smallest“of“theŽ¡�’ö‹ w�¸ãorld's–UUcomputer“systems.Ž¡�’‹ T‘ÿ*ªo–åHmš¸ãy“surprise,‘û±the“main“b�Gottlenec˜k“to“p�Gortabilit˜y“ofŽ¡�’ö‹ the–>£T�‘þU>Ÿ'EŽ‘ãxXwš¸ãare“has“b�Geen“the“lac˜k“of“suitable“¬P‘ÿ:«ASCAL“«com-Ž¡�’ö‹ pilers,‘@_bšGecause–Þ*¬P‘ÿ:«ASCAL“«has“often“b˜een“implemen�¸ãtedŽ¡�’ö‹ without–êÀsystem“programming“in“mind.‘2An�¸ãyb•Go“dy‘êÀwhoŽ¡�’ö‹ has–=×a“decen�¸ãt“¬P‘ÿ:«ASCAL“«compiler“can“install“ÈWEB“«(and“allŽ¡�’ö‹ programs–S‚written“in“ÈWEB«)‘SAwithout“great“dicult�¸ãy‘ÿ*ª,‘“ es-Ž¡�’ö‹ senš¸ãtially–UUas“follo˜ws:Ž© ¼Ÿ��’ò§|1)Ž’‹ Start–Ûlwith“the“three“ les“ÈWEAVE.WEB«,“ÈTANGLE.WEB«,Ž¡�’‹ and–”pÈTANGLE.PAS«.“(The“programs“ha•¸ãv“e–”pnot“b�Geen“cop�¸ãy-Ž¡�’‹ righ�¸ãted,–UUso“these“ les“are“not“dicult“to“obtain.)Ž¡��’ò§|2)Ž’‹ Run–}øÈTANGLE.PAS‘}í«through“y�¸ãour“¬P‘ÿ:«ASCAL“«compiler“toŽ¡�’‹ get–UUa“w�¸ãorking“ÈTANGLE“«program.Ž¡��’ò§|3)Ž’‹ Chec•¸ãk›£¼y“our˜ÈTANGLE‘£f«b“y˜applying˜it˜to˜ÈTANGLE.WEB«;Ž¡�’‹ yš¸ãour–UUoutput“ le“should“matc˜h“ÈTANGLE.PAS«.Ž¡��’ò§|4)Ž’‹ Apply–†;y�¸ãour“ÈTANGLE‘†.«to“the“ le“ÈWEAVE.WEB«,“obtainingŽ¡�’‹ ÈWEAVE.PAS«;–Zxthen“apply“¬P‘ÿ:«ASCAL“«to“ÈWEAVE.PAS‘Z5«andŽ¡�’‹ y•¸ãou'll›UUha“v“e˜a˜w“orking˜ÈWEAVE˜«system.Ž¡��’ò§|5)Ž’‹ The–3ésame“pro�Gcess“applies“to“anš¸ãy“soft˜w˜are“writtenŽ¡�’‹ in–fÂÈWEB«,“notably“to“T�‘þU>Ÿ'EŽ‘ãxX“itself.‘¦(Ho•¸ãw“ev“er,‘«y“ou‘fÂneedŽ¡�’‹ fonš¸ãts–~Nand“suitable“output“equipmen˜t“in“order“to“mak˜eŽ¡�’‹ propšGer–Quse“of“T�‘þU>Ÿ'EŽ‘ãxX;“that“ma�¸ãy“b˜e“another“b˜ottlenec�¸ãk.)Ž¡�’‹ Once–M®yš¸ãou“ha˜v˜e“T�‘þU>Ÿ'EŽ‘ãxX“w˜orking,‘‹Äy˜ou“can“apply“ÈWEAVEŽ¡�’‹ «and–ÎøT�‘þU>Ÿ'EŽ‘ãxX“to“yš¸ãour“ÈWEB“« les,‘í`thereb˜y“getting“programŽ¡�’‹ došGcumen�¸ãts–UUas“illustrated“ab˜o•¸ãv“e.ަ�’ö‹ Notice–8úthat“a“ÈTANGLE.PAS‘8ó« le“is“needed“in“order“to“getŽ¡�’ö‹ this›Ã<\b•Go“otstrapping"˜pro“cess˜started.‘»}If˜y•¸ãou˜ha“v“e˜justŽ¡�’ö‹ ÈWEAVE.WEB‘˜Ø«and–™ÈTANGLE.WEB«,“y�¸ãou“can't“do“the“ rst“step.Ž¡�’‹ Ho•¸ãw“ev“er,‘I³an“yb•Go“dy–FËwho“has“lo�Gokš¸ãed“seriously“in˜to“theŽ¡�’ö‹ question–NRof“soft•¸ãw“are›NRp�Gortabilit“y˜will˜realize˜that˜m“yŽ¡�’ö‹ commenš¸ãts–kin“the“preceding“paragraphs“ha˜v˜e“b�Geen“o˜v˜er-Ž¡�’ö‹ simpli ed.‘ÓEI‘ Kha•¸ãv“e– glossed“o•¸ãv“er– some“serious“problemsŽ¡�’ö‹ that–›áarise:‘ Character“sets“are“di eren�¸ãt;‘Ù³ le“naming“con-Ž¡�’ö‹ v•¸ãen“tions–¥pare“di erenš¸ãt;‘àsp�Gecial“con˜v˜en˜tions“are“needed“toŽ¡�’ö‹ inš¸ãteract–S¾with“a“user's“terminal;‘Òódata“is“pac˜k˜ed“di er-Ž¡�’ö‹ enš¸ãtly–âon“di eren˜t“mac˜hines;‘r oating-p�Goin˜t“arithmetic“isŽ¡�’ö‹ alw•¸ãa“ys–înonstandard“and“sometimes“nonexisten�¸ãt;‘:_usersŽ¡�’ö‹ w•¸ãan“t–¢|\friendly"“in�¸ãteraction“with“existing“programs“forŽ¡�’ö‹ editing–ô°and“sp•Go“oling;‘D^etc.,–‡etc.‘OÙF‘ÿ*ªurthermore,“man�¸ãy‘ô°ofŽ¡�’ö‹ the–tvw�¸ãorld's“¬P‘ÿ:«ASCAL“«compilers“are“incredibly“bizarre.Ž¡�’ö‹ Therefore–vÓit“is“quite“na‘þ㎑üqvš¸ãe“to“b�Geliev˜e“that“a“single“pro-Ž¡�’ö‹ gram–‘oÈTANGLE.PAS‘‘«could“actually“wš¸ãork“on“v˜ery“man˜yŽ¡�’ö‹ di eren•¸ãt›9Ömac“hines,‘röor˜ev“en˜that˜one˜single˜source˜ leŽ¡�’ö‹ ÈTANGLE.WEB‘<ê«could–=1bšGe“adequate;‘š’some“system-dep˜enden�¸ãtŽ¡�’ö‹ c�¸ãhanges–UUare“inevitable.Ž¡�’‹ The–NYÈWEB“«system“caters“to“system-dep�Gendenš¸ãt“c˜hangesŽ¡�’ö‹ in–í)a“simple“but“surprisingly“e ectivš¸ãe“w˜a˜y“that“I‘ìÀne-Ž¡�’ö‹ glected–MÄto“men�¸ãtion“when“I‘M‚listed“its“other“features.‘íBothŽ¡�’ö‹ ÈTANGLE–.ì«and›/$ÈWEAVE“«are˜designed˜to˜w�¸ãork˜with˜Ïtwo‘м«in-Ž¡�’ö‹ put– Œ les,‘v™not“just“one:‘Ú5In“addition“to“a“ÈWEB“«sourceŽ¡�’ö‹ le–‹likš¸ãe“ÈTEX.WEB«,“there“is“also“a“\c˜hange“ le"“ÈTEX.CHŽ¡�’ö‹ «that–]�conš¸ãtains“whatev˜er“c˜hanges“are“needed“to“customizeŽ¡�’ö‹ T�‘þU>Ÿ'EŽ‘ãxX–4\for“a“particular“system.‘ Ý(Similarly‘ÿ*ª,‘¬the“sourceŽ¡�’ö‹ les–f.ÈWEAVE.WEB›eç«and“ÈTANGLE.WEB˜«are“accompanied“b�¸ãyŽ¡�’ö‹ ÈWEAVE.CH–UU«and“ÈTANGLE.CH«.)Ž¡�’‹ Here's–Õhoš¸ãw“c˜hange“ les“w˜ork:‘îÇEac˜h“c˜hange“has“theŽ¡�’ö‹ form–#\replace“±x�Ÿÿ®1Ž�‘'±:–ª¨:“:Ž›|jx�Ÿÿ´mŽ‘  ¾«b�¸ãy“±y�Ÿÿ®1Ž�‘'±:–ª¨:“:Ž˜y�Ÿÿ´nŽ‘q~«,"‘4Öfor“some“±m–ñ·“«1Ž¡�’ö‹ and›.ƒ±n–Ç·“«0;‘;there˜±x�Ÿÿ´iŽ‘‚Ï«and˜±y�Ÿÿ´jŽ‘e/«represen•¸ãt˜lines˜in˜the˜c“hangeŽ¡�’ö‹ le.‘PThe–ÛØÈWEAVE›Ûµ«and“ÈTANGLE˜«programs“read“data“fromŽ¡�’ö‹ the–“ÎÈWEB“«input“ le“unš¸ãtil“ nding“a“line“that“matc˜hes“±x�Ÿÿ®1Ž‘|s«;Ž¡�’ö‹ this–xline,›À½and“the“±m–ú°·“«1–xfollo�¸ãwing“lines,˜are“replacedŽŽŽŽŸê»�‘íî¹á10‘ ÷¾submitted–UUto“THE“COMPUTER“JOURNALŽŒ‹ UŸî>»�Ÿîd}�’¯•?­LITERA‘ÿJªTE‘ÕXPR�ÃŽOGRAMMINGŽŽ Äy?��� ýE†Á�‘íbš¸ãy–"´±y�Ÿÿ®1Ž�‘'±:–ª¨:“:Ž‘|jy�Ÿÿ´nŽ‘q~«.‘ÙãAn“error“message“is“giv˜en“if“the“±m“«linesޤ �‘íî¹replaced–UUdid“not“matc�¸ãh“±x�Ÿÿ®1Ž�‘'±:–ª¨:“:Ž‘|jx�Ÿÿ´mŽ‘ íð«p�Gerfectly‘ÿ*ª.Ž¡�‘÷îºF‘ÿ*ªor–C@example,‘zthe“program“ÈPRIMES.WEB‘Bû«in•¸ãv“ok“es–C@a�“Ïp‘ÿ}'ageŽŽ¡�‘íprošGcedure–)Óto“b˜egin“a“new“page;‘8Tbut�“Ïp‘ÿ}'ageŽ‘€«w�¸ãas“not“pres-Ž¡�‘íî¹en�¸ãt–ùâin“Wirth's“original“¬P‘ÿ:«ASCAL“«and“it“is“de ned“ratherŽ¡�‘íî¹v‘ÿqÇaguely–w„in“the“¬P‘ÿ:«ASCAL“«standard.‘ØSTherefore“a“system-Ž¡�‘íî¹dep�Genden•¸ãt›9c“hange˜ma“y˜b�Ge˜needed˜here.‘xrA‘ c“hange˜ leŽ¡�‘íî¹ÈPRIMES.CH–UU«could“b�Ge“made“bš¸ãy“cop˜ying“the“lineޤ ƒ��‘8Ï:È@d‘?ýnew_page==pageŽŽ¡�‘ífrom–2ÀFigure“2c“and“sp�Gecifying“one“or“more“appropriateޤ �‘íî¹replacemen�¸ãt‘UUlines.Ž¡�‘÷îºThe–U{program“ÈTANGLE‘U9«itself“con�¸ãtains“ab�Gout“190“sec-Ž¡�‘íî¹tions,‘›Aand–&ßa“tš¸ãypical“installation“will“ha˜v˜e“to“c˜hangeŽ¡�‘íî¹ab�Gout–®�15“of“these.‘} If“yš¸ãou“w˜an˜t“to“transp�Gort“ÈTANGLEŽ¡�‘íto– êa“new“en•¸ãvironmen“t,‘<y“ou– êtherefore“need“to“create“aŽ¡�‘íî¹suitable–žê le“ÈTANGLE.CH‘ž×«that“mo�Gdi es“15“or“so“parts“ofŽ¡�‘íî¹ÈTANGLE.WEB«.–¹(Examples“of“ÈTANGLE.CH‘¸÷«are“pro�¸ãvided“toŽ¡�‘íî¹all–Tp�Geople“who“receivš¸ãe“ÈTANGLE.WEB«,“so“that“eac˜h“imple-Ž¡�‘íî¹men�¸ãtor–#Úhas“a“mo�Gdel“of“what“to“do.)‘aIY‘ÿ*ªou“need“to“insertŽ¡�‘íî¹y•¸ãour›Qyc“hanges˜b“y˜hand˜in“to˜ÈTANGLE.PAS«,˜un“til˜y“ou˜ha“v“e˜aŽ¡�‘íî¹ÈTANGLE‘«program–/that“wš¸ãorks“sucien˜tly“w˜ell“to“supp�GortŽ¡�‘íî¹further›Ë£b•Go“otstrapping.‘Ô²But˜y•¸ãou˜nev“er˜actually˜c“hangeŽ¡�‘íî¹the–UUmaster“ le“ÈTANGLE.WEB«.Ž¡�‘÷îºThis–\‡approacš¸ãh“has“t˜w˜o“imp�Gortan˜t“adv‘ÿqÇan˜tages.‘‡^First,Ž¡�‘íî¹the–Çsame“master“ le“ÈTANGLE.WEB‘¸«is“used“bš¸ãy“ev˜eryb•Go“dy‘ÿ*ª,Ž¡�‘íî¹and–¼÷it“con�¸ãtains“the“basic“logic“of“ÈTANGLE‘¼š«that“reallyŽ¡�‘íî¹de nes–…lthe“essence“of“tangling.‘ The“system-dep�Genden�¸ãtŽ¡�‘íî¹cš¸ãhanges–r‘do“not“a ect“an˜y“of“the“subtle“parts“of“ÈTANGLE«'sŽ¡�‘íî¹con�¸ãtrol–³!structures“or“data“structures.‘;¶Second,‘Ó’when“theŽ¡�‘íî¹ocial–æWÈTANGLE‘æ1«has“b�Geen“upgraded“to“a“newš¸ãer“v˜ersion,Ž¡�‘íî¹a–Ubrand“new“ÈTANGLE.WEB‘G«will“almost“alw•¸ãa“ys›Uw“ork˜withŽ¡�‘íî¹the–€old“ÈTANGLE.CH«,“since“c�¸ãhanges“are“rarely“made“toŽ¡�‘íî¹the–(;system-dep�Gendenš¸ãt“parts.‘b¾In“other“w˜ords,‘1@this“dual-Ž¡�‘íî¹input- le–Unscš¸ãheme“w˜orks“when“the“ÈWEB“« le“is“constan˜tŽ¡�‘íî¹and–g»the“ÈCH‘g¶« le“is“mo�Gdi ed,‘lTand“it“also“w�¸ãorks“when“theŽ¡�‘íî¹ÈCH–UU« le“is“constan�¸ãt“but“the“ÈWEB“« le“is“mo�Gdi ed.Ž¡�‘÷îºChange–¯4 les“wš¸ãere“added“to“ÈWEB“«ab�Gout“three“mon˜thsŽ¡�‘íî¹after–s–the“system“w�¸ãas“initially“designed,‘»&based“on“ourŽ¡�‘íî¹initial–^îexpšGeriences“with“p˜eople“who“had“v•¸ãolun“teeredŽ¡�‘íî¹to–áÝparticipate“in“pšGortabilit�¸ãy“exp˜erimen�¸ãts.‘_W‘ÿ*ªe“realizedŽ¡�‘íî¹abšGout–¼‰a“y�¸ãear“later“that“ÈWEAVE‘¼b«could“b˜e“mo˜di ed“so“thatŽ¡�‘íî¹only–½jthe“cš¸ãhanged“parts“of“a“program“w˜ould“(optionally)Ž¡�‘íî¹b�Ge› –prin•¸ãted;‘7th“us,‘“fit's˜no“w˜p•Gossible˜to˜do“cumen�¸ãt˜theŽ¡�‘íî¹c•¸ãhanges›dˆb“y˜listing˜only˜the˜sections˜that˜are˜actuallyŽ¡�‘íî¹a ected–-]b�¸ãy“the“ÈCH›-&« le“that“ÈWEAVE˜«has“pro�Gcessed.‘ùàW‘ÿ*ªeŽ¡�‘íî¹also–NŽgeneralized“the“original“format“of“ÈCH‘NN« les,‘ŒÜwhic�¸ãhŽ¡�‘íî¹p�Germitted–Ü…only“c�¸ãhanges“that“extended“to“the“end“of“aŽ¡�‘íî¹section.‘“4These›µÏt•¸ãw“o˜imp�Gortan“t˜ideas˜w“ere˜among˜theŽ¡�‘íî¹ nal–UUenhancemenš¸ãts“incorp�Gorated“in˜to“ÈWEB83«.ŽŸ#Fr�‘íû‰ïÎŽŸ€�‘íî¹ÂJ.–ÕTPR�®9OGRAMS“AS“WEBSŽ‘í€‰ïΟñÇ�«When–ÇI‘™ rst“b�Gegan“to“wš¸ãork“with“the“ideas“that“ev˜en-Ž¡�tually–³þb�Gecame“the“ÈWEB“«system,‘˨I›³åthough�¸ãt“that“I˜w�¸ãouldŽ¡�b�Ge–wÐdesigning“a“language“for“\top-do�¸ãwn"“programming,Ž¡�where–ÉÞa“top-levš¸ãel“description“is“giv˜en“ rst“and“succes-Ž¡�siv�¸ãely–¾ïre ned.‘®•On“the“other“hand“I›¾’knew“that“I˜of-Ž¡�ten–YÝcreated“ma‘Ž8jor“parts“of“programs“in“a“\b�Gottom-up"Ž¡�fashion,‘ŽWstarting–Šwith“the“de nitions“of“basic“pro�Gce-Ž¡�dures–/×and“data“structures“and“gradually“building“moreŽ¡�and–¨œmore“p�Go•¸ãw“erful–¨œsubroutines.‘kœI‘¨‡had“the“feeling“thatŽŽ� ýE†Á�’ö‹ top-doš¸ãwn–~¶and“b�Gottom-up“w˜ere“oppšGosing“metho˜dologies:ޤ �’ö‹ one–ˤmore“suitable“for“program“exp�Gosition“and“the“otherŽ¡�’ö‹ more–UUsuitable“for“program“creation.Ž© é‹�’‹ But–€after“gaining“exp�Gerience“with“ÈWEB«,“I‘åha•¸ãv“e–€come“toŽ¡�’ö‹ realize–sÈthat“there“is“no“need“to“c�¸ãho�Gose“once“and“for“allŽ¡�’ö‹ b�Get•¸ãw“een›°wtop-do“wn˜and˜b•Gottom-up,‘Ç?b“ecause˜a˜programŽ¡�’ö‹ is–�Éb�Gest“thoughš¸ãt“of“as“a“w˜eb“instead“of“a“tree.‘$A‘�yhi-Ž¡�’ö‹ erarcš¸ãhical–6structure“is“presen˜t,‘»�Ÿîd}�’Î}/­D.–ÕXE.“KNUTHŽŽ Äy?��� ýE†Á�‘÷W‘ÿ*ªell,‘²Âimagine–Šthat“y�¸ãou“are“writing“a“small“subroutineޤ �‘íî¹that–¶8upšGdates“part“of“a“data“structure,‘Ö and“supp˜ose“thatŽ¡�‘íî¹the–S�up�Gdating“takš¸ães“only“one“or“t˜w˜o“lines“of“co�Gde.‘lŸInŽ¡�‘íî¹practical–²Lprograms,‘Òçthere's“often“something“that“can“goŽ¡�‘íî¹wrong,›Ý«if–¿Àthe“user's“input“is“incorrect,˜so“the“subroutineŽ¡�‘íî¹has–… to“c•¸ãhec“k–… that“the“input“is“correct“b�Gefore“doing“theŽ¡�‘íî¹up�Gdate.‘qÇTh�¸ãus,–UUthe“subroutine“has“the“general“formŽŸAì‘��ŸÔ���‘ÿ'ýÂpro�QÇcedureŽ�‘4ÙµÏup‘ÿ}'dateŽ‘R9O«;ŽŽ¡���‘ÿ'ýÂb�QÇegin‘ÕTifŽ‘)o ·h›ª¨«input–UUdata“is“in�¸ãv‘ÿqÇalid˜·i�“ÂthenŽŽŽ¡��‘ 'þ·h›ª¨«Issue–UUan“error“message“and“try“to“reco•¸ãv“er˜·i«;ŽŽ¡��‘ÿ'ý·h›ª¨«Up�Gdate–UUthe“data“structure˜·i«;ŽŽ¡���‘ÿ'ýÂendŽ‘4i«.ŽŽŽŽŸ �‘íî¹A‘³÷subtle–´Rphenomenon“o�Gccurs“in“traditional“program-Ž¡�‘íî¹ming–-languages:‘S3While“writing“the“program“for“`·h‘ª¨«IssueŽ¡�‘íî¹an–-Åerror“message“and“try“to“reco•¸ãv“er‘ª¨·i«',‘cáa‘-ÅprogrammerŽ¡�‘íî¹sub�Gconsciously–›¥tries“to“get“bš¸ãy“with“the“few˜est“p�GossibleŽ¡�‘íî¹lines–yŠof“cošGde,‘‚˜since“the“program“for“`·h‘ª¨«Up˜date“the“dataŽ¡�‘íî¹structure‘ª¨·i«'–®¥is“quite“short.‘:7If“an“extensivš¸ãe“error“reco˜v˜eryŽ¡�‘íî¹is–Ÿøactually“programmed,‘²¡the“subroutine“will“app�Gear“toŽ¡�‘íî¹ha•¸ãv“e–ö˜error-message“prin�¸ãting“as“its“main“purp�Gose.‘U‘ButŽ¡�‘íî¹the–‚rprogrammer“kno�¸ãws“that“the“error“is“really“an“excep-Ž¡�‘íî¹tional–ÝÈcase“that“arises“only“rarely;‘"therefore“a“length�¸ãyŽ¡�‘íî¹error›`8reco•¸ãv“ery˜do•Gesn't˜lo“ok˜righ�¸ãt,‘¢ðand˜most˜program-Ž¡�‘íî¹mers–ë¤will“minimize“it“(without“realizing“that“they“areŽ¡�‘íî¹doing–îOso)“in“order“to“mak�¸ãe“the“subroutine's“app�GearanceŽ¡�‘íî¹matcš¸ãh–xõits“in˜tended“b�Geha˜vior.‘ܧOn“the“other“hand“whenŽ¡�‘íî¹the–¬‰same“task“is“programmed“with“ÈWEB«,“the“purp�GoseŽ¡�‘íî¹of�‘l"Ïup‘ÿ}'dateŽ‘$7Þ«can–l"bšGe“sho�¸ãwn“quite“clearly‘ÿ*ª,‘qÕand“the“p˜ossibil-Ž¡�‘íî¹itš¸ãy–=ðof“error“reco˜v˜ery“can“b�Ge“reduced“to“a“mere“men˜tionŽ¡�‘íî¹when�‘@½Ïup‘ÿ}'dateŽ‘#á«is–@½de ned.‘jêWhen“another“section“en�¸ãtitledŽ¡�‘íî¹`·h›ª¨«Issue–€an“error“message“and“try“to“reco•¸ãv“er˜·i«'–€is“subse-Ž¡�‘íî¹quenš¸ãtly–Ã�written,‘à¶the“whole“p�Goin˜t“of“that“section“is“to“doŽ¡�‘íî¹the–ßobšGest“error“reco•¸ãv“ery‘ÿ*ª,‘÷and–ßoit“b˜ecomes“quite“natural“toŽ¡�‘íî¹write–UUa“b�Getter“program“as“a“result.Ž© XV�‘÷îºThis–šòfact|that“ÈWEB“«alloš¸ãws“y˜ou“to“let“eac˜h“part“ofŽ¡�‘íî¹the–C¨program“ha•¸ãv“e–C¨its“appropriate“size,‘G1without“distort-Ž¡�‘íî¹ing–5the“readabilit�¸ãy“of“other“parts|means“that“go•Go“dŽ¡�‘íî¹programmers–ÿ nd“their“ÈWEB“«programs“b�Getter“than“theirŽ¡�‘íP›ÿ:«ASCAL–8ã«programs,‘qÇev�¸ãen“though“their“¬P˜ASCAL“«programsŽ¡�‘íî¹once–UUlo�Gokš¸ãed“lik˜e“the“w˜ork“of“an“exp�Gert.ŽŸ(ˆâ�‘íû‰ïÎŽŸ€�‘íî¹ÂK.–ÕTSTYLISTIC“ISSUESŽ‘í€‰ïΟJ�«I‘¸8found–¸Qthat“mš¸ãy“st˜yle“of“using“ÈWEB“«ev˜olv˜ed“quite“a“bitŽ¡�during–›0the“ rst“yš¸ãear.‘3»The“general“format,‘Àkin“whic˜h“eac˜hŽ¡�section–|‡b�Geings“with“commen�¸ãtary“and“ends“with“a“formalŽ¡�program–Dòfragmenš¸ãt,‘H9is“extremely“v˜ersatile;‘Jhy˜ou“ha˜v˜e“theŽ¡�freedom–‰€to“saš¸ãy“an˜ything“y˜ou“w˜an˜t,‘²Ey˜et“y˜ou“m˜ust“mak˜e“aŽ¡�decision–´'ab�Gout“hoš¸ãw“y˜ou'll“do“it.‘< I‘³þimagine“that“di eren˜tŽ¡�programmers–Рwill“con•¸ãv“erge–Рto“quite“di erenš¸ãt“st˜yles,‘ë+butŽ¡�I‘5 w•¸ãould›5lik“e˜to˜note˜do“wn˜some˜of˜the˜things˜that˜ha“v“eŽ¡�seemed–UUto“w�¸ãork“b�Gest“for“me.ަ�‘ Consider–éÀ rst“the“question“of“macros“v�¸ãersus“sectionŽ¡�names.‘ìçA‘ÓRnamed–Óµsection,‘3Mlik�¸ãe“`·h‘ª¨«Issue“an“error“mes-Ž¡�sage–ôGand“try“to“reco•¸ãv“er‘ª¨·i«',‘is›ôGessen“tially˜the˜same˜as˜aŽ¡�parameterless–ªmacro;‘TbÈWEB“«pro�¸ãvides“b�Goth.‘oàI‘©°prefer“toŽ¡�use–G6parameterless“macros“for“\small"“things“that“canŽ¡�b•Ge›|òem�¸ãb“o“died˜in˜a˜w•¸ãord˜or˜t“w“o,‘†Ùbut˜named˜sections˜forŽ¡�longer–è_p�Gortions“of“the“program“that“merit“a“fuller“de-Ž¡�scription.ŽŽ� ýE†Á�’‹ I‘è=usually–è¥start“the“name“of“a“section“with“an“im-ޤ �’ö‹ p�Gerativ•¸ãe›ßXv“erb,‘Ùbut˜I‘ß5giv“e˜a˜declarativ“e˜commen“tary˜atŽ¡�’ö‹ the–/ b�Geginning“of“a“section.‘ þåTh•¸ãus,‘¥vÈPRIMES.WEB‘.�«sa“ysŽ¡�’ö‹ `Â8.–nÉ«Noš¸ãw“that“appropriate�“±:–ª¨:“:Ž‘ˆ9·h‘ª¨«Prin˜t“table“±p‘@­8›ª¨·i–ñƒ�“±:˜:˜:Ž‘ñ€«';Ž¡�’ö‹ I‘]îwš¸ãouldn't–]ðdo“the“opp�Gosite“and“sa˜y“`Â8.“«Prin˜t“the“table.Ž¡�’ö‹ ·h›ª¨«Co�Gde–UUfor“prin�¸ãting‘@­8˜·i–Ç�“±:˜:˜:Ž‘g«'.Ž¡�’‹ The–K¥name“of“a“section“(enclosed“in“angle“brac•¸ãk“ets)Ž¡�’ö‹ should–`úb�Ge“long“enough“to“encapsulate“the“essenš¸ãtial“c˜har-Ž¡�’ö‹ acteristics–ú³of“the“co�Gde“in“that“section,‘ Ôbut“it“should“notŽ¡�’ö‹ b•Ge›Ýšto“o˜v�¸ãerb“ose.‘ –I‘Ýwfound˜v•¸ãery˜early˜that˜it˜w“ould˜b�Ge˜aŽ¡�’ö‹ mistak�¸ãe–AÝto“include“all“of“the“assumptions“abšGout“lo˜calŽ¡�’ö‹ and–¸”global“v‘ÿqÇariables“in“the“name“of“eacš¸ãh“section,‘Ñdev˜enŽ¡�’ö‹ though–^sucš¸ãh“information“w˜ould“strictly“b�Ge“necessary“toŽ¡�’ö‹ isolate–Öýthat“section“as“an“indepšGenden�¸ãt“mo˜dule.‘öÀTheŽ¡�’ö‹ tricš¸ãk–«ˆis“to“ nd“a“balance“b�Get˜w˜een“formal“and“informalŽ¡�’ö‹ expšGosition–ŠYso“that“a“reader“can“grasp“what“is“happ˜eningŽ¡�’ö‹ without–UUb�Geing“o•¸ãv“erwhelmed–UUwith“detail.�Ÿü^ÿ®5ŽŽ¡�’‹ «Another–€ßlesson“I‘€Ôlearned“early“in“the“game“w�¸ãas“thatŽ¡�’ö‹ the–îOname“of“a“section“should“explicitly“menš¸ãtion“an˜yŽ¡�’ö‹ nonstandard––Lconš¸ãtrol“structures,‘æ‰ev˜en“though“its“dataŽ¡�’ö‹ structures–�šcan“often“b�Ge“left“implied.‘#—F‘ÿ*ªurthermore,‘ßkifŽ¡�’ö‹ the–yžconš¸ãtrol“ o˜w“is“prop�Gerly“explained,‘°y˜ou“can“a˜v˜oidŽ¡�’ö‹ the–:Çusual“errors“asso�Gciated“with�“ÂgotoŽ‘.j«statemen•¸ãts;‘C¡suc“hŽ¡�’ö‹ statemenš¸ãts–öOcan“safely“b�Ge“in˜tro�Gduced“in“a“restrained“butŽ¡�’ö‹ natural‘UUmanner.Ž¡�’‹ F‘ÿ*ªor–k/example,‘š·x«14“of“the“prime-prin�¸ãting“example“couldŽ¡�’ö‹ b�Ge–.4reprogrammed“as“follo�¸ãws,‘dkusing“`�Âlo�QÇopŽ‘g«'“as“a“macroŽ¡�’ö‹ abbreviation–UUfor“`�ÂwhileŽ�‘¯÷ÏtrueŽ�‘3ÉäÂdoŽ‘?ín«':ŽŸIáÞ��ŸÉ���’ö‹ ·h‘ª¨«Increase–UU±j‘çà«unš¸ãtil“it“is“the“next“prime“n˜um˜b�Ger‘@­14‘ª¨·i‘ÇŽŽŽ¡����’‹ Âlo•QÇop‘ÕTb“eginŽ’8lÁ±j‘Y£· ‘DZj‘Ëk«+‘8à2;ŽŽŽ¡���’ ‹ ·h‘ª¨«UpšGdate–UUv‘ÿqÇariables“that“dep˜end“on“±j‘Ò�­20‘ª¨·i«;ŽŽŽ¡���’ ‹ ·h›ª¨«If–UU±j‘çà«is“prime,�“ÂgotoŽ�‘c†ÏfoundŽ‘:v­22˜·i«;ŽŽŽ¡����’ ‹ ÂendŽ’—y«;ŽŽŽ¡����’ö‹ ÏfoundŽ’]‚«:ŽŽŽŽŽ©aÞ�’ö‹ With–UUthis“c�¸ãhange,“·x«22“could“b�GecomeŽŸaÓ¥��Ÿ³���’ö‹ ·h›ª¨«If–UU±j‘çà«is“prime,�“ÂgotoŽ�‘c†ÏfoundŽ‘:v­22˜·i‘ÇŽŽŽ¡���’‹ ±n–Ç· “«2;ŽŽŽ¡����’‹ ÂwhileŽ’;±n–Ç<�“Ïor‘ÿ}'dŽ�‘•LÂdoŽŽŽŽ¡����’ ‹ b�QÇeginŽ’(€Å·h›ª¨«If–¥Á±p«[±n«]“is“a“factor“of“±j‘’‹«,�‘ÈßÂgotoŽ�‘'|Ïnot�‘�‰ffŽ‘®foundŽ‘Jö=­26˜·i«;ŽŽŽ¡���’ ‹ ±n–Ç· “±n–8à«+“1;ŽŽŽ¡����’ ‹ ÂendŽ’—y«;ŽŽŽ¡����’‹ ÂgotoŽ�’™=ÏfoundŽ’3k´«;ŽŽŽ¡����’ö‹ Ïnot�‘�‰ffŽ‘®foundŽ’"È«:ŽŽŽŽŽ¦�’ö‹ if–úä·x«26“cš¸ãhanges“in“the“ob˜vious“w˜a˜y‘ÿ*ª.‘btThe“resulting“pro-Ž¡�’ö‹ gram–ŽLwill“b�Ge“more“ecienš¸ãt“on“most“mac˜hines;‘*Çand“IŽ¡�’ö‹ b�Geliev�¸ãe– )that“it“is“actually“easier“to“read“and“to“write,Ž¡�’ö‹ in–spite“of“the“fact“that“t•¸ãw“o�‘ÂgotoŽ‘× «statemen“ts‘app�Gear,Ž¡�’ö‹ bšGecause–.Othe“lab˜els“ha•¸ãv“e–.Ob˜een“used“with“appropriate“in-Ž¡�’ö‹ terpretations–UUof“their“abstract“signi cance.Ž¡�’‹ Of–íEcourse,‘S@¬P‘ÿ:«ASCAL“«mak�¸ães“it“dicult“to“use�“ÂgotoŽŽ¡�’ö‹ «statemen�¸ãts,‘K„bšGecause–HWirth“decided“that“lab˜els“shouldŽ¡�’ö‹ bšGe–yŠn�¸ãumeric,‘—and“that“they“should“b˜e“declared“in“ad-Ž¡�’ö‹ v‘ÿqÇance.‘ùÍIf–-WI‘-wš¸ãere“to“in˜tro�Gduce“the�“ÂgotoޑЫstatemen˜ts“asŽ¡�’ö‹ suggested,‘œyI‘nw•¸ãould›nAha“v“e˜to˜de ne˜n“umeric˜macros�˜ÏfoundŽŽ¡�’ö‹ «and�‘{ïÏnot�‘�‰ffŽ‘®foundŽ‘. ¬«,‘§jand–{ïI‘{¸wš¸ãould“ha˜v˜e“to“insert“`�Âlab�QÇelŽ�‘q;ÏfoundŽ‘4C²«,Ž¡��’ö‹ Ïnot�‘�‰ffŽ‘®foundŽ’"È«'–™inš¸ãto“the“program“at“the“righ˜t“place.‘Í’Suc˜hŽ¡�’ö‹ extra–I*wš¸ãork“is“a“bit“of“a“n˜uisance,‘K™but“it“can“b�Ge“done“inŽ¡�’ö‹ ÈWEB–UU«without“spšGoiling“the“exp˜osition.Ž¡�’‹ ¬P‘ÿ:«ASCAL–Z«has“a“few“other“misfeatures“that“pro•¸ãv“e‘ZtoŽ¡�’ö‹ b�Ge›{Wincon•¸ãv“enien“t˜with˜resp•Gect˜to˜ÈWEB˜«exp“osition.‘ãÎTheŽ¡�’ö‹ wš¸ãorst–_¯of“these“is“the“inabilit˜y“to“declare“lo�Gcal“v‘ÿqÇariablesŽŽŽŽŸê»�‘íî¹á12‘ ÷¾submitted–UUto“THE“COMPUTER“JOURNALŽŒ‹ _]Ÿî>»�Ÿîd}�’¯•?­LITERA‘ÿJªTE‘ÕXPR�ÃŽOGRAMMINGŽŽ Äy?��� ýE†Á�‘íin–£žthe“midst“of“a“program“or“pro�Gcedure.‘\¢F‘ÿ*ªor“example,ޤ �‘íî¹a–¸÷programmer“often“ nds“it“most“natural“to“de ne“anŽ¡�‘íî¹inš¸ãteger–IKv‘ÿqÇariable“when“a�“ÂforŽ‘’’«lo�Gop“is“in˜tro�Gduced,‘K³but“theŽ¡�‘íî¹rules–Qof“¬P‘ÿ:«ASCAL“«insist“that“suc�¸ãh“a“v‘ÿqÇariable“b�Ge“declaredŽ¡�‘íî¹rather–’Ðfar“a•¸ãw“a“y–’Ðfrom“that�“ÂforŽ‘%œ«lo�Gop.‘*9My“ÈWEB“«programsŽ¡�‘íî¹o•¸ãv“ercome–Æ2this“problem“bš¸ãy“ha˜ving“sections“lik˜e“`·h‘ª¨«Lo�GcalŽ¡�‘íî¹v‘ÿqÇariables–Nfor�“ÏxyzzyŽ‘å%·i«'“whenevš¸ãer“there's“a“rather“length˜yŽ¡�‘íî¹prošGcedure–C`�ÏxyzzyŽ‘ìj«'“whose“lo˜cal“v‘ÿqÇariables“should“not“b˜eŽ¡�‘íî¹declared–¡Žall“at“once.‘5ÚBut“when“a“pro�Gcedure“is“short,‘Ńsa�¸ãyŽ¡�‘íî¹only–×Yhalf“a“dozen“sections“long,‘ðŒthere's“usually“no“harmŽ¡�‘íî¹in–…µdeclaring“its“lošGcal“v‘ÿqÇariables“in“¬P‘ÿ:«ASCAL“«st�¸ãyle,‘¯Ÿ'EŽ›ãxX.“Ho•¸ãw“ev“er,‘ùXT�‘þU>Ÿ'EŽ˜X–Ø‹needs“aŽ¡�comparativš¸ãely–Øùlarge“amoun˜t“of“time“to“t˜yp�Geset“the“ nalŽ¡�do�Gcumenš¸ãt.‘YF‘ÿ*ªor–÷¾example,‘ Xif“w˜e“assume“that“eac˜h“pageŽ¡�requires–›^four“seconds,‘¬àit“will“takš¸ãe“four“min˜utes“to“pro-Ž¡�duce–­®a“60-page“do�Gcumen�¸ãt.‘9åThe“running“time“for“ÈWEAVE«-Ž¡�plus-T�‘þU>Ÿ'EŽ‘ãxX–¨¿is“quite“reasonable“when“y�¸ãou“consider“thatŽ¡�yš¸ãour–Íkprogram“is“e ectiv˜ely“b�Geing“con˜v˜erted“in˜to“a“fairlyŽ¡�substan�¸ãtial›†ºb•Go“oklet;‘Ÿmbut˜the˜costs˜are˜sucien�¸ãtly˜largeŽ¡�to–9discourage“remaking“and“reprinš¸ãting“suc˜h“a“b•Go“okletŽ¡�more–ÑEthan“once“or“tš¸ãwice“a“da˜y‘ÿ*ª.‘EÂWhen“a“new“program“isŽ¡�b•Geing›Ò#dev�¸ãelop“ed,‘ìait˜is˜therefore˜customary˜to˜w�¸ãork˜withŽ¡�hardcop•¸ãy›Ú�do�Gcumen“tation˜that˜is˜sligh“tly˜obsolete,‘ûÞandŽ¡�to–-éread“the“ÈWEB“«source“ le“itself“when“up-to-date“infor-Ž¡�mation–Ìis“required;‘/¥the“source“ le“is“sucien�¸ãtly“easy“toŽ¡�read–UUfor“suc�¸ãh“purp�Goses.ަ�‘ The–ß°costs“of“ÈWEB“«are“more“dicult“to“estimate“atŽ¡�higher–f¿levš¸ãels,‘kbut“I‘f»ha˜v˜e“found“to“m˜y“surprise“that“theŽ¡�total–å7time“of“writing“and“debugging“a“ÈWEB“«program“isŽ¡�no–Zñgreater“than“the“total“time“of“writing“and“debug-Ž¡�ging–‹¶an“¬ALGOL›‹¨«or“¬P‘ÿ:«ASCAL˜«program,‘™Nevš¸ãen“though“m˜yŽ¡�ÈWEB–º"«programs“are“m•¸ãuc“h–º"b�Getter,‘ÓUand“ev�¸ãen“though“I‘ºamŽ¡�putting–¡Lsubstanš¸ãtially“more“do�Gcumen˜tation“in˜to“the“pro-Ž¡�grams.‘STherefore›ù;I‘ù$ha•¸ãv“e˜lately˜b�Geen˜using˜ÈWEB˜«for˜all˜ofŽ¡�m•¸ãy›É programming,‘å’ev“en˜for˜one-o ˜jobs˜that˜I‘É}write˜\forŽ¡�m•¸ãy›ÇÚey“es˜only"˜just˜to˜explore˜o�Gccasional˜problems.‘BžTheŽ¡�extra–ã«time“I‘ãŽsp�Gend“in“preparing“additional“commen�¸ãtaryŽ¡�is–UUregained“b�Gecause“the“debugging“time“is“reduced.ަ�‘ In–lñretrosp�Gect,‘›lthe“fact“that“a“\literate"“program“tak�¸ãesŽ¡�m•¸ãuc“h–ƒ‰less“time“to“debug“is“not“surprising,‘�b�Gecause“theŽ¡�ÈWEB–›¨«language“encourages“a“discipline“that“I‘›–w�¸ãas“previ-Ž¡�ously–ÔÂunš¸ãwilling“to“imp�Gose“on“m˜yself.‘ðI‘Ô¡had“kno˜wn“forŽŽ� ýE†Á�’ö‹ a–ž#long“time“that“the“programs“I‘�Îconstruct“for“publi-ޤ �’ö‹ cation–in“a“b•Go“ok,‘3qor–the“programs“that“I‘Øconstruct“inŽ¡�’ö‹ fronš¸ãt–ëof“a“class,‘/�ha˜v˜e“tended“to“b�Ge“comparativ˜ely“freeŽ¡�’ö‹ of–ð�errors,‘µb�Gecause“I‘ðtam“forced“to“clarify“mš¸ãy“though˜ts“asŽ¡�’ö‹ I‘ájdo–áŽthe“programming.‘qBy“con�¸ãtrast,‘œwhen“writing“forŽ¡�’ö‹ m•¸ãyself›ŸŽalone,‘²I‘Ÿzha“v“e˜often˜tak“en˜shortcuts˜that˜pro“v“edŽ¡�’ö‹ later–âto“bšGe“dreadful“mistak�¸ães.‘V¡It's“harder“for“me“to“fo˜olŽ¡�’ö‹ mš¸ãyself–ÊZin“suc˜h“w˜a˜ys“when“I'm“writing“a“ÈWEB“«program,Ž¡�’ö‹ bšGecause–vôI'm“in“\exp˜ository“mo˜de"“(analogous“to“class-Ž¡�’ö‹ rošGom–]lecturing)“whenev�¸ãer“a“ÈWEB“«is“b˜eing“spun.‘ÏÞErgo,Ž¡�’ö‹ less–UUdebugging“time.Ž© W8�’‹ Noš¸ãw–öthat“I‘Âam“writing“all“m˜y“programs“in“ÈWEB«,“anŽ¡�’ö‹ unforeseen–¿«problem“has,›@ho•¸ãw“ev“er,˜arisen:‘FsI‘¿NsuddenlyŽ¡�’ö‹ ha•¸ãv“e–¤a“collection“of“programs“that“seem“quite“b�GeautifulŽ¡�’ö‹ in–�:mš¸ãy“o˜wn“ey˜es,‘¶Ùand“I‘�ha˜v˜e“a“comp�Gelling“urge“to“publishŽ¡�’ö‹ all–мof“them“so“that“evš¸ãeryb•Go“dy–мcan“admire“these“w˜orks“ofŽ¡�’ö‹ art.‘F“A‘Ó™nice–Ó¹little“10-page“program“can“easily“b�Ge“writtenŽ¡�’ö‹ and–t debugged“in“an“afterno�Gon“and“evš¸ãening;‘…if“I‘sÖk˜eepŽ¡�’ö‹ accum•¸ãulating›�+suc“h˜gems,‘Ý I'll˜so�Gon˜run˜out˜of˜storageŽ¡�’ö‹ space,‘6 and–.òmš¸ãy“oce“will“b�Ge“encrusted“with“w˜ebs“of“m˜yŽ¡�’ö‹ o�¸ãwn–K³making.‘TàThere“is“no“telling“what“will“happ�Gen“ifŽ¡�’ö‹ lots–©of“other“p�Geople“catcš¸ãh“ÈWEB“«fev˜er“and“start“foistingŽ¡�’ö‹ their–�Ãcreations“on“eacš¸ãh“other.‘/AI‘��can“already“en˜vision“theŽ¡�’ö‹ appšGearance–ê]of“a“new“journal,‘Ÿto“b˜e“en�¸ãtitled“ÌW‘ÿ*ªebs«,‘ŸforŽ¡�’ö‹ the–Úspublication“of“literate“programs;‘I‘ÚPimagine“that“itŽ¡�’ö‹ will›Çäha•¸ãv“e˜a˜large˜bac“klog˜and˜a˜large˜group˜of˜dedicatedŽ¡�’ö‹ editors–UUand“referees.ŽŸ(|(�’ö‹ Ÿû‰ïÎŽŸ€�’ö‹ ÂM.–ÕTRELA‘ÿ «TED“W�®9ORKŽ’ö‹ Ÿ€‰ïΟHÿ�«Nothing–>úab�Gout“ÈWEB“«is“really“new;‘³ÍI‘>¾ha•¸ãv“e–>úsimply“com-Ž¡�bined–º"a“buncš¸ãh“of“ideas“that“ha˜v˜e“b�Geen“in“the“air“for“aŽ¡�long–ûìtime.‘e�I‘ûÁwš¸ãould“lik˜e“to“summarize“in“the“next“fewŽ¡�paragraphs–‡the“things“that“had“the“greatest“in uenceŽ¡�on–UUm�¸ãy“thinking“as“I“put“those“pieces“together.ަ�‘ George–ÑoF‘ÿ*ªorsythe“wrote“in“1966“that“\A‘ÑOuseful“algo-Ž¡�rithm–Uiis“a“substanš¸ãtial“con˜tribution“to“kno˜wledge.‘rItsŽ¡�publication–& constitutes“an“imp�Gortanš¸ãt“piece“of“sc˜holar-Ž¡�ship."�Ÿü^ÿ®6Ž‘°\«His–›»commenš¸ãts“ha˜v˜e“alw˜a˜ys“inspired“me“to“striv˜eŽ¡�for–M7excellence“in“programming,‘N×and“they“ha•¸ãv“e›M7pla“y“ed˜aŽ¡�ma‘Ž8jor– r^‘úÿÿole“in“shaping“mš¸ãy“presen˜t“view“that“it“is“w˜orth-Ž¡�while–¾Nto“consider“Ïevery‘ Ë«program“as“a“w�¸ãork“of“literature.ަ�‘ The–¸.design“of“ÈWEB“«wš¸ãas“in uenced“primarily“b˜y“the“pi-Ž¡�oneering–µw�¸ãork“of“Pierre-Arnoul“de“Marne e,�Ÿü^ÿ®7Ž�‘|sŸü^ÿ´;Ž�‘\sŸü^ÿ®8Ž‘Ù›«whoseŽ¡�researc�¸ãh–Æ1on“what“he“called“\Holon“Programming"“hasŽ¡�not–�receivš¸ãed“the“atten˜tion“it“deserv˜es.‘UŠHis“w˜ork“w˜as,‘ŽinŽ¡�turn,‘¾Ôinspired–™3bš¸ãy“Arth˜ur“Ko�Gestler's“excellen˜t“treatise“onŽ¡�the–0£structure“of“complex“systems“and“organisms;�Ÿü^ÿ®9Ž‘¹Q«th�¸ãusŽ¡�w•¸ãe›«ha“v“e˜another˜connection˜b�Get“w“een˜programming˜andŽ¡�literature.‘„×A‘°«somewhat–±similar“system“w�¸ãas“indep�Gen-Ž¡�denš¸ãtly–UUcreated“b˜y“Edwin“T‘ÿ*ªo˜wster.�Ÿü^ÿ®10ŽŽ¦�‘ «I‘äFo•¸ãw“e–äja“great“debt“to“Edsger“Dijkstra,‘0T‘ÿ*ªon�¸ãy“Hoare,Ž¡�Ole-Johan–8ùDahl,‘qÙand“Niklaus“Wirth“for“op�Gening“mš¸ãy“ey˜esŽ¡�to–íkthe“imp�Gortance“of“abstraction“in“the“reading“andŽ¡�writing–†‹of“programs,‘¯çand“to“P�¸ãeter“Naur“for“stressing“theŽ¡�impšGortance–%of“a“balance“b˜et•¸ãw“een–%formal“and“informalŽ¡�metho�Gds.ަ�‘ T‘ÿ*ªonš¸ãy–ü‰Hoare“pro˜vided“a“spšGecial“imp˜etus“for“ÈWEB“«whenŽ¡�he–ùÃsuggested“in“1978“that“I‘ù¬should“publish“m�¸ãy“programŽ¡�for–õõT�‘þU>Ÿ'EŽ‘ãxX.“Since“vš¸ãery“few“large-scale“soft˜w˜are“systemsŽ¡�w•¸ãere›Qøa“v‘ÿqÇailable˜in˜the˜literature,‘Ñ!he˜had˜b�Geen˜tryingŽ¡�to–žîpromote“the“publication“of“w�¸ãell-written“programs.ŽŽŽŽŸê»�’Òí¾submitted–UUto“THE“COMPUTER“JOURNAL‘ ÷á13ŽŒ‹€Ÿî>»�Ÿîd}�’Î}/­D.–ÕXE.“KNUTHŽŽ Äy?��� ýE†Á�‘íHoare's–³èsuggestion“w�¸ãas“actually“rather“terrifying“to“me,ޤ �‘íî¹and–mQI'm“sure“he“knew“that“he“wš¸ãas“p�Gosing“quite“a“c˜hal-Ž¡�‘íî¹lenge.‘�VAs–´Úa“professor“of“computer“science,‘Ì»I‘´Âw�¸ãas“quiteŽ¡�‘íî¹comfortable–Í%publishing“papšGers“ab˜out“to�¸ãy“problems“thatŽ¡�‘íî¹could–ÞbšGe“p˜olished“up“nicely“and“presenš¸ãted“in“an“elegan˜tŽ¡�‘íî¹manner;‘è4but–·?I‘·&had“no“idea“hoš¸ãw“to“tak˜e“a“piece“of“realŽ¡�‘íî¹soft•¸ãw“are,‘Ë�with–©all“the“compromises“necessary“to“mak�¸ãe“itŽ¡�‘íî¹useful–¶“to“a“large“class“of“p�Geople“on“a“wide“v‘ÿqÇariet�¸ãy“of“sys-Ž¡�‘íî¹tems,‘Žºand–ƒ@to“op�Gen“it“up“to“public“scrutin•¸ãy‘ÿ*ª.‘û‡Ho“w‘ƒ@couldŽ¡�‘íî¹a–� suppšGosedly“resp˜ectable“academic,›‹ølik�¸ãe“me,˜rev�¸ãeal“theŽ¡�‘íî¹w•¸ãa“y–R�he“actually“writes“large“programs?‘itAnd“could“aŽ¡�‘íî¹large–pFprogram“b�Ge“made“in�¸ãtelligible?‘šMy“previous“at-Ž¡�‘íî¹tempts–£¥along“these“lines�Ÿü^ÿ®11Ž‘ ‹«wš¸ãere“b˜y“no˜w“hop�Gelessly“outŽ¡�‘íî¹of–kdate.‘Ä I‘8decided“that“this“w�¸ãould“bšGe“a“go˜o˜d“time“toŽ¡�‘íî¹try–~ßout“de“Marne e's“ideas;‘“¤furthermore,‘‰Athe“T�‘þU>Ÿ'EŽ‘ãxX“sys-Ž¡�‘íî¹tem–b×itself“proš¸ãvided“me“with“new“to�Gols“for“prin˜ting“andŽ¡�‘íî¹format–conš¸ãtrol,‘*Èso“I‘ÿìsusp�Gected“that“it“w˜ould“bšGe“p˜ossi-Ž¡�‘íî¹ble–°´to“obtain“state-of-the-art“do�Gcumenš¸ãtation“b˜y“makingŽ¡�‘íî¹propšGer–UUuse“of“t•¸ãyp˜ograph“y‘ÿ*ª.ŽŸ r†�‘÷îºIt–Þis“inš¸ãteresting“to“reread“some“of“the“commen˜ts“thatŽ¡�‘íî¹T‘ÿ*ªonš¸ãy–Q#made“ten“y˜ears“ago“in“his“k˜eynote“address“to“theŽ¡�‘íî¹ rst–£¹A�¸ãCM‘£csymp�Gosium“on“Principles“of“ProgrammingŽ¡�‘íî¹Languages:�Ÿü^ÿ®12ŽŽ©å �‘÷Do�Gcumen•¸ãtation›ö¢m“ust˜b�Ge˜regarded˜as˜an˜in“tegralŽ¡�‘÷îºpart–À¸of“the“prošGcess“of“design“and“co˜ding.‘³ïA‘Àœgo˜o˜dŽ¡�‘÷îºprogramming–À#language“will“encourage“and“assistŽ¡�‘÷îºthe–¤programmer“to“write“clear,‘÷³self-do�Gcumen�¸ãtingŽ¡�‘÷îºcošGde,‘Vòand–#lev�¸ãen“p˜erhaps“to“devš¸ãelop“and“displa˜y“aŽ¡�‘÷îºpleasan•¸ãt›UUst“yle˜of˜writing.ަ�‘íî¹He–%foresaš¸ãw“man˜y“future“trends,‘.¿but“not“the“imp�GendingŽ¡�‘íî¹impro•¸ãv“emen“ts–UUin“tš¸ãyp�Gesetting“qualit˜y:ަ�‘÷îºIt–Àis“of“course“p�Gossible“for“a“compiler“or“serviceŽ¡�‘÷îºprogram–µ�to“expand“the“abbreviations,‘ š ll“in“theŽ¡�‘÷îºdefaults,‘×Îand–½¶mak�¸ãe“explicit“the“assumptions.‘ªêButŽ¡�‘÷îºin–©äpractice,‘ÿexp�Gerience“shoš¸ãws“that“it“is“v˜ery“un-Ž¡�‘÷îºlikš¸ãely– ¸that“the“output“of“a“computer“will“ev˜er“b�GeŽ¡�‘÷îºmore–·³readable“than“its“input,‘×:except“in“suc�¸ãh“trivialŽ¡�‘÷îºbut–UUimpšGortan�¸ãt“asp˜ects“as“impro•¸ãv“ed‘UUinden“tation.ަ�‘÷îºT�¸ãyp�Gographic–•wformatting“of“computer“programs“hasŽ¡�‘íî¹a–07long“tradition,‘fïoriginating“with“¬ALGOL‘/ÿ«and“its“im-Ž¡�‘íî¹mediate–Vprecursors.‘t I'm“not“sure“who“made“the“ rstŽ¡�‘íî¹exp•Gerimenš¸ãts,‘Ìbut‘ìI‘ëôb“eliev˜e–ìthat“the“lion's“share“of“theŽ¡�‘íî¹credit–ƒºfor“devš¸ãeloping“excellen˜t“programming-languageŽ¡�‘íî¹t•¸ãypšGograph“y–±¥b˜elongs“to“t•¸ãw“o‘±¥p˜eople:‘*gP“eter‘±¥Naur,‘¹whoŽ¡�‘íî¹edited–Ú¯the“¬ALGOL‘}{60“«repšGort�Ÿü^ÿ®13Ž‘ S•«and“ga•¸ãv“e–Ú¯sp˜ecial“careŽ¡�‘íî¹to–l\its“presenš¸ãtation;‘wàand“Myrtle“Kellington,‘rwho“serv˜edŽ¡�‘íî¹for–ë²manš¸ãy“y˜ears“as“executiv˜e“editor“of“A˜CM‘ëIpublica-Ž¡�‘íî¹tions–A¨and“set“the“standards“that“ha•¸ãv“e–A¨b�Geen“adopted“b�¸ãyŽ¡�‘íî¹other–™ïjournals.‘3PThe“computing“profession“o•¸ãw“es›™ïm“uc“h˜toŽ¡�‘íî¹these–DÁp�Geople,‘€œwho“made“published“programs“so“m•¸ãuc“hŽ¡�‘íî¹more–….readable“than“they“wš¸ãould“otherwise“ha˜v˜e“b�Geen;Ž¡�‘íî¹the–ÞOmagnitude“of“their“con�¸ãtribution“can“only“b�Ge“ap-Ž¡�‘íî¹preciated–“b�¸ãy“p�Geople“who“submit“computer“programs“toŽ¡�‘íî¹journals–wùlik�¸ãe“ÌActa“Arithmetica“«whose“editors“are“unfa-Ž¡�‘íî¹miliar–3with“computer“science.‘ï`Bill“McKeeman“calledŽ¡�‘íî¹atten�¸ãtion– =to“formatting“issues“when“he“published“Algo-Ž¡�‘íî¹rithm–aj268,›¤n\¬ALGOL‘ M60“«reference“language“editor,"˜inŽ¡�‘íî¹1965.�Ÿü^ÿ®14Ž‘ •�«There–ŽJhas“b�Geen“a“ o•¸ãw“ering–ŽJof“suc�¸ãh“algorithmsŽ¡�‘íî¹in–}recenš¸ãt“y˜ears;‘ôthe“pap�Gers“b˜y“Opp�Gen�Ÿü^ÿ®15Ž‘ õú«and“b˜y“RoseŽ¡�‘íî¹and–UUW›ÿ*ªelsh�Ÿü^ÿ®16Ž‘ Î;«are“particularly“notew•¸ãorth“y˜.ŽŸ r†�‘÷îºI‘yéb�Gegan–z4to“design“ÈWEB“«in“the“spring“of“1979,‘ÃkwhenŽ¡�‘íî¹I‘´tconstructed–´Œa“prototš¸ãyp�Ge“system“that“w˜as“called“ÈDOC«.Ž¡�‘íî¹Luis–ã¢T‘ÿ*ªrabb“Pš¸ãardo“help�Ged“me“to“dev˜elop“a“suitable“st˜yleŽŽ� ýE†Á�’ö‹ of–Åexp�Gosition“at“that“time;‘0Jthen“Ignacio“Zabala“Salellesޤ �’ö‹ ga•¸ãv“e–—a“ÈDOC‘…«a“thorough“test“when“he“prepared“a“full“im-Ž¡�’ö‹ plemen�¸ãtation–B±of“T�‘þU>Ÿ'EŽ‘ãxX“in“¬P‘ÿ:«ASCAL«.“Zabala's“implemen-Ž¡�’ö‹ tation–~îwš¸ãas“successfully“transp�Gorted“to“man˜y“di eren˜tŽ¡�’ö‹ computers,�Ÿü^ÿ®17Ž�‘xæŸü^ÿóO!â…cmsy7ºŽ�‘8çŸü^ÿ®20Ž‘TI«and–¢|this“exp�Gerience“w�¸ãas“of“immenseŽ¡�’ö‹ v‘ÿqÇalue–W]to“me“when“I‘Wcast“ÈWEB“«inš¸ãto“its“presen˜t“form“inŽ¡�’ö‹ 1981.‘ Since–âÀthen“manš¸ãy“signi can˜t“impro˜v˜emen˜ts“ha˜v˜eŽ¡�’ö‹ b�Geen–/~suggested“bš¸ãy“m˜y“colleague“Da˜vid“R.“F‘ÿ*ªuc˜hs,‘fandŽ¡�’ö‹ I‘–´ha•¸ãv“e–—also“bšGene ted“from“the“exp˜eriences“of“a“largeŽ¡�’ö‹ n•¸ãum“bšGer–g·of“outstanding“p˜eople“who“v•¸ãolun“teered–g·to“b˜eŽ¡�’ö‹ guinea–žRpigs“for“pre-released“v�¸ãersions“of“T�‘þU>Ÿ'EŽ‘ãxX.“It's“im-Ž¡�’ö‹ pšGossible–xÅfor“me“to“name“ev•¸ãery“one–xÅwho“has“help˜ed,‘�¡butŽ¡�’ö‹ I‘/w•¸ãould›blik“e˜to˜giv“e˜sp�Gecial˜thanks˜to˜Arth“ur˜Sam“uel,Ž¡�’ö‹ Ho•¸ãw“ard‘©ÐT›ÿ*ªric“k“ey˜,–¾îJo�Ge‘©ÐW˜eening,“and–©ÐPierre“MacKa�¸ãy“forŽ¡�’ö‹ imp�Gortan•¸ãt› ucon“tributions.‘YÒI'm˜fortunate˜indeed˜to˜shareŽ¡�’ö‹ a–UUwš¸ãorking“en˜vironmen˜t“with“suc˜h“stim˜ulating“p�Geople.Ž© ij�’‹ When–"I›ÿõoriginally“designed“the“ÈWEB“«system,‘*ÔI˜sp�Gen�¸ãtŽ¡�’ö‹ ab�Gout–™six“w�¸ãeeks“preparing“the“ les“ÈTANGLE.WEB‘$«andŽ¡�’ö‹ ÈWEAVE.WEB«,–Ñhduring“whicš¸ãh“time“I‘ÑFw˜as“con˜tin˜ually“c˜hang-Ž¡�’ö‹ ing–ÚÀthe“language“and“trying“di erenš¸ãt“st˜yles“of“exp�Go-Ž¡�’ö‹ sition.‘›(The–…œprograms“w�¸ãere“neither“long“nor“compli-Ž¡�’ö‹ cated,‘p÷but–8=this“wš¸ãas“rather“in˜tensiv˜e“w˜ork,‘p÷so“I‘8didn'tŽ¡�’ö‹ get›2}m•¸ãuc“h˜else˜done˜during˜those˜six˜w“eeks.‘ @The˜ rstŽ¡�’ö‹ t•¸ãw“o›ñÛw“eeks˜w“ere˜actually˜sp�Gen“t˜drafting˜the˜ rst˜ten˜p�GerŽ¡�’ö‹ cenš¸ãt–§3of“what“is“no˜w“ÈTEX.WEB«.)“Then“I‘§sp�Gen˜t“ab�Gout“sixŽ¡�’ö‹ tedious–)Jhours“with“a“text“editor,‘^Ghand-sim�¸ãulating“theŽ¡�’ö‹ b�Geha�¸ãvior–æof“ÈTANGLE›å·«on“ÈTANGLE.WEB«,“so“that“I˜had“aŽ¡�’ö‹ program–ÂyÈTANGLE.PAS‘Â]«that“wš¸ãas“rip�Ge“for“debugging.‘¹4A˜tŽ¡�’ö‹ rst–„çI›„™had“to“correct“errors“b�Goth“in“ÈTANGLE.WEB˜«andŽ¡�’ö‹ ÈTANGLE.PAS«,–¸but“so�Gon“ÈTANGLE‘·ß«wš¸ãas“w˜orking“w˜ell“enoughŽ¡�’ö‹ that–Ï�I›Ï~needed“only“ÈTANGLE.WEB˜«as“a“source“ le.‘à ThenŽ¡�’ö‹ ÈWEAVE.WEB‘sû«could–tEbšGe“tangled“and“debugged“to˜o.‘ΗTheŽ¡�’ö‹ total–wftime“to“create“\V‘ÿ*ªersion“0"“of“the“ÈWEB“«system,‘ëin-Ž¡�’ö‹ cluding–G0the“language“design“and“the“time“to“debug“theŽ¡�’ö‹ programs–Ôand“write“a“brief“manš¸ãual“for“users,‘íöw˜as“ab�GoutŽ¡�’ö‹ eigh•¸ãt›í‹w“eeks;‘$then˜enhancemen“ts˜w“ere˜added˜at˜the˜rateŽ¡�’ö‹ of–«ÐabšGout“one“p˜er“monš¸ãth“for“the“next“18“mon˜ths.‘u8As“aŽ¡�’ö‹ result–6™of“this“exp�Gerience“I‘6’think“it's“reasonable“to“stateŽ¡�’ö‹ that–Ãa“ÈWEB«-likš¸ãe“system“can“b�Ge“created“from“scratc˜h“in“aŽ¡�’ö‹ fairly–ÃWshort“time,‘ÞØfor“some“other“pair“of“languages“b�Ge-Ž¡�’ö‹ sides–!"T�‘þU>Ÿ'EŽ‘ãxX“and“¬P‘ÿ:«ASCAL«,“b�¸ãy“an“exp�Gert“system“program-Ž¡�’ö‹ mer–¬Ñwho“is“con•¸ãv“ersan“t–¬Ñwith“b�Goth“languages.‘x:Indeed,‘°IŽ¡�’ö‹ sp•Gok�¸ãe› ab“out˜ÈWEB˜«on˜a˜recen�¸ãt˜visit˜to˜London˜and˜oneŽ¡�’ö‹ of–„the“p�Geople“in“the“audience“decided“to“test“this“h�¸ãy-Ž¡�’ö‹ p�Gothesis;‘Ç4shortly–€#afterwš¸ãards“I‘íreceiv˜ed“an“elegan˜t“rep�GortŽ¡�’ö‹ from– ØHarold“Thim•¸ãbleb“y‘ÿ*ª,‘:¹who– Øhad“just“constructed“anŽ¡�’ö‹ excellen�¸ãt–Jüsystem“called“ÈCweb«,‘Mbased“on“T‘ÿ*ªro /Nro “andŽ¡�’ö‹ ¬C–UU«instead“of“T�‘þU>Ÿ'EŽ‘ãxX“and“¬P‘ÿ:«ASCAL«.�Ÿü^ÿ®21ŽŽŸ)K;�’ö‹ Ÿû‰ïÎŽŸ€�’ö‹ ÂN.–ÕTRETRš®9OSPECT“AND“PR˜OSPECTSŽ’ö‹ Ÿ€‰ïΟ[1�«En•¸ãth“usiastic–'örepšGorts“ab˜out“new“computer“languages,Ž¡�b�¸ãy–ZUthe“authors“of“those“languages,‘›•are“commonplace.Ž¡�Hence–ÖÔI'm“wš¸ãell“a˜w˜are“of“the“fact“that“m˜y“o˜wn“exp�Geri-Ž¡�ences–cócannot“bšGe“extrap˜olated“to˜o“far.‘!RI‘c¶also“realize“that,Ž¡�whenev•¸ãer›…oI‘…bha“v“e˜encoun“tered˜a˜problem˜with˜ÈWEB«,˜I'v“eŽ¡�simply–κc�¸ãhanged“the“system;‘ mother“users“of“ÈWEB“«cannotŽ¡�op�Gerate–UUunder“the“same“ground“rules.ަ�‘ Ho•¸ãw“ev“er,‘g¢I›cõb�Geliev“e–cùthat“I˜ha•¸ãv“e›cùstum“bled˜on˜a˜w“a“y˜ofŽ¡�programming–"|that“prošGduces“b˜etter“programs“that“areŽ¡�more–ŠpšGortable“and“more“easily“understo˜o˜d“and“main-Ž¡�tained;‘Ôfurthermore,‘[Þthe–ô)system“seems“to“w�¸ãork“withŽŽŽŽŸê»�‘íî¹á14‘ ÷¾submitted–UUto“THE“COMPUTER“JOURNALŽŒ‹¢1Ÿî>»�Ÿîd}�’¯•?­LITERA‘ÿJªTE‘ÕXPR�ÃŽOGRAMMINGŽŽ Äy?� þ܆Á�� þi�‘ílarge–h%programs“as“w�¸ãell“as“with“small“ones.‘ª7I'm“pleasedޤ �‘íî¹that–$ímš¸ãy“w˜ork“on“t˜yp�Gograph˜y‘ÿ*ª,‘.›whic˜h“b�Gegan“as“an“appli-Ž¡�‘íî¹cation–p¹of“computers“to“another“ eld,‘žrhas“come“full“circleŽ¡�‘íî¹and–ƒ£bšGecome“an“application“of“t•¸ãyp˜ograph“y–ƒ£to“the“heartŽ¡�‘íî¹of–yJcomputer“science;‘ DI‘xþlik�¸ãe“to“think“of“ÈWEB“«as“a“neatŽ¡�‘íî¹\spino ‘Ç"–RXof“mš¸ãy“researc˜h“on“T�‘þU>Ÿ'EŽ‘ãxX.“Ho˜w˜ev˜er,‘‘˜all“of“m˜yŽ¡�‘íî¹expšGeriences–´íwith“this“system“ha•¸ãv“e–´íb˜een“highly“coloredŽ¡�‘íî¹b•¸ãy›Ÿÿm“y˜o“wn˜tastes,‘ÄDand˜only˜time˜will˜tell˜if˜a˜large˜n“um-Ž¡�‘íî¹bšGer–Šof“other“p˜eople“will“ nd“ÈWEB“«to“b˜e“equally“attractiv�¸ãeŽ¡�‘íî¹and‘UUuseful.Ž¡�‘÷îºI‘ämade–òa“conscious“decision“not“to“design“a“languageŽ¡�‘íî¹that–¨$wš¸ãould“b�Ge“suitable“for“ev˜eryb•Go“dy‘ÿ*ª.‘j5My–¨$goal“w˜as“toŽ¡�‘íî¹pro�¸ãvide–§Ma“to�Gol“for“system“programmers,‘ûËnot“for“highŽ¡�‘íî¹sc•¸ãho�Gol›&ãstuden“ts˜or˜for˜hobb“yists.‘bLI‘&×don't˜ha“v“e˜an“ythingŽ¡�‘íî¹against–4high“scš¸ãho�Gol“studen˜ts“and“hobb˜yists,‘:but“I‘don'tŽ¡�‘íî¹b�Geliev•¸ãe›KEev“ery˜computer˜language˜should˜attempt˜to˜of-Ž¡�‘íî¹fer–ä1all“things“to“all“p�Geople.‘ ZA‘ãÊuser“of“ÈWEB“«needs“toŽ¡�‘íî¹b•Ge›Ù«go“o“d˜enough˜at˜computer˜science˜that˜he˜or˜she˜isŽ¡�‘íî¹comfortable–úsdealing“with“sevš¸ãeral“languages“sim˜ultane-Ž¡�‘íî¹ously‘ÿ*ª.‘6iSince–£:ÈWEB“«com�¸ãbines“T�‘þU>Ÿ'EŽ‘ãxX“and“¬P‘ÿ:«ASCAL“«with“a“fewŽ¡�‘íî¹rules–‚Æof“its“oš¸ãwn,‘Ž"ÈWEB“«programs“can“con˜tain“ÈWEB“«syn˜taxŽ¡�‘íî¹errors,›ËÉT�‘þU>Ÿ'EŽ‘ãxX–´syn�¸ãtax“errors,˜¬P‘ÿ:«ASCAL“«syn�¸ãtax“errors,˜andŽ¡�‘íî¹algorithmic–æãerrors;‘/©in“practice,‘ Fall“four“t�¸ãyp�Ges“of“errorsŽ¡�‘íî¹o�Gccur,‘rçand–lýa“bit“of“sophistication“is“needed“to“sort“outŽ¡�‘íî¹whicš¸ãh–Ÿ\is“whic˜h.‘OÜComputer“scien˜tists“tend“to“bšGe“b˜etterŽ¡�‘íî¹at–„�sucš¸ãh“things“than“other“p�Geople.‘ÿ I‘„Oha˜v˜e“found“thatŽ¡�‘íî¹ÈWEB–ÓÕ«programs“can“b�Ge“debugged“rapidly“in“spite“of“theŽ¡�‘íî¹profusion–[of“languages,‘GÜbut“I'm“sure“that“man�¸ãy“otherŽ¡�‘íî¹in•¸ãtelligen“t–UUp�Geople“will“ nd“suc�¸ãh“a“task“dicult.Ž¡�‘÷îºIn–óÈother“w�¸ãords,‘dÈWEB“«seems“to“bšGe“sp˜eci cally“for“theŽ¡�‘íî¹pšGeculiar–Obreed“of“p˜eople“who“are“called“computer“sci-Ž¡�‘íî¹enš¸ãtists.‘YAnd– I'm“prett˜y“sure“that“there“are“also“a“lot“ofŽ¡�‘íî¹computer–¦scienš¸ãtists“who“will“not“enjo˜y“using“ÈWEB«;“someŽ¡�‘íî¹of–„(us“are“glad“that“traditional“programming“languagesŽ¡�‘íî¹ha•¸ãv“e›–äcomparativ“ely˜primitiv“e˜capabilities˜for˜insertedŽ¡�‘íî¹commen•¸ãts,‘gØb�Gecause›d$suc“h˜diculties˜pro“vide˜a˜go•Go“d˜ex-Ž¡�‘íî¹cuse–µ‚for“not“do�Gcumenš¸ãting“programs“w˜ell.‘’OTh˜us,‘ �ÈWEBŽ¡�‘ímaš¸ãy––3b�Ge“only“for“the“subset“of“computer“scien˜tists“whoŽŽ� þi�’ö‹ lik�¸ãe–äÌto“write“and“to“explain“what“they“are“doing.‘ ,Myޤ �’ö‹ hop�Ge–Ö3is“that“the“abilitš¸ãy“to“mak˜e“explanations“more“nat-Ž¡�’ö‹ ural–¥lwill“cause“more“programmers“to“disco•¸ãv“er–¥lthe“jo�¸ãysŽ¡�’ö‹ of–åaliterate“programming,‘ dbšGecause“I‘åŸ'EŽ‘ãxX“onlyŽ¡�’ö‹ on–Ù£the“sections“that“are“of“currenš¸ãt“in˜terest,‘ú·instead“ofŽ¡�’ö‹ pro�Gducing–€hardcopš¸ãy“for“an“en˜tire“do�Gcumen˜t.‘òAnd“soŽ¡�’ö‹ on;‘Ñ4a–R”considerable“amounš¸ãt“of“additional“researc˜h“andŽ¡�’ö‹ dev•¸ãelopmen“t–äˆwill“b�Ge“appropriate“if“the“idea“of“literateŽ¡�’ö‹ programming–UUcatc�¸ãhes“on.ŽŸI%�’ö‹ ÂAc•®9kno“wledgemen“tsŽŸ $’�’ö‹ ­The–î2preparation“of“this“papšto“âstatements.Ž¡�‘ ãComputing–ÕXSurveys‘r�¿6â,“261{301“(1974).Ž¡��‘ÿ#…4.Ž‘ D.––*E.“Knuth,‘_ãThe“óßCÊscmtt8ÊWEB‘–*ãSystem“of“Structured“Do� cmmi10óÙ“ Rcmr7ó|{Ycmr8óo´‹Ç cmr9óKñ`y cmr10ùé;ßßßßß