TheMesaProgrammingEnvironmentRichardE.Sweet1.IntroductionPeopleeverywherearedevelopingmulti-window,integratedprogrammingenvironmentsfortheirfavoritecomputersandlanguages.ThispaperdescribestheMesaProgrammingEnvironment,sometimesalsocalledtheXeroxDevelopmentEnvironment(XDE).Itisinterestingforseveralreasons.Ithasexistedinsomethingsimilartoitscurrentformforabout4years.Ithasmorethan500users,manyinteractingwithit8ormorehoursaday.Severalmillionlinesofcodehavebeenwrittenbytheseusers,includinglarge,multi-authorsystems.PreviouspapershavedealtwiththeMesalanguage[Geschke77][Mitchell78],theoperatingsystem[Redell79][Lampson80]andtheprocessorarchitectureonwhichitruns[Johnsson82][Sweet82].Thispaperdescribestheprogrammingenvironment:theuserillusion,thesetofprogrammingtools,andthefacilitiesavailableforaugmentingtheenvironment.Section2givesashorthistoryoftheenvironment,includingsomeofouroriginaldesigngoals.Section3describesthecurrentstateoftheuserinterfaceanddiscussesafewoftheschemesthatweretriedanddiscarded.Section4describessomeoftheprogramdevelopmenttoolsavailableanddiscusseshowfeaturesofthelanguagehaveinfluencedtheirdesign,andindeedinfluencedwhattoolsareintheset.Section5describesothertoolsthat,althoughvaluabletotheprogrammingtaskarelargelylanguageindependent.Section6talksabouthoweasyitistomakeadditionstothesystem,andgivesexamplesofuseradditionssomethatmodifytheenvironmentandsomethatsimplyprovidenewtools.Section7discusseswhatwefeelaremajorsuccessesandwhatwefeelneedstobedoneinthefuture.2.HistoryMuchoftheearlyhistoryanddesignmotivationbehindtheMesaprojectisdiscussedinEarlyExperiencewithMesa[Geschke77].Fromthebeginning,ourgoalwastoallowdevelopmentoflargecomplexsoftwareprojectswithsufficientperformancetobeusableinaproductionenvironment.Twooftheconceptsaimedatachievingthisgoalweremodularityandstrongtypechecking.Amajoradditionwasmadein1977withtheintroductionofinterfaces,andintermoduletypechecking.ThisisdescribedinsomedetailinTheImpactofMesaonSystemDesign[Lauer79].Belowisashortlistoflanguageorsystemfeaturesthathavebeenaroundsincethebeginningoftheprojectthathavesignificantlyinfluencedthedirectionofourdesign:Modularprogrammingwithstrongcompile-timetypechecking.p^{ c +[ qX UrQ Ql sN~ d e ! * 1 :b C(ELJ  "&9*j03P7I @5 J Q )a 179T: ADMG f<!&r((* .2H48u9>#?BEE E !8"p$8'+,0Z519=0>B7ECx ^Z# +@) X+"G&+ 3 ;>1Dc= % B3%4 ,.236 > E; } x )+h.f368%9 ByF'9 L l $-& 0<5]6:;?DF7W &M"]'z+0\5N6<?CG%5# ;e;# !t$F&/(.S1R48K;2 BG2 t0 &A)s/17M:2??@C0  7 %V ,./35i7*9<AB. )Y_ R!$ ,/F1x5;v C,Q J;!%,?.W1!6^9=[CE* " H (j+5.16B;`>bBG' r%(+.046@81;=R?r  lso e$8 +R0/26;s=CRE5: S !%' .1368; CEw V= % -/16%79J @x  lJ_#&)vt,-s3st66:*=sB'CjD H" )t+,s1?2 t45@ fBD$E`4  O!$'+t0S36h<>AQF   b%'B)   "3%N)| 14TVm$2Proceduresasfirstclassvalues,sothattheycanbepassedasparameters,storedinsideotherdatastructures,etc.Acommittmenttosourceleveldebugging.Sufficientruntimeefficiencyandaccesstounderlyingarchitecturethatalllevelsofthesystemmaybewritteninahighlevellanguage.MesawasfirstimplementedontheAlto[Thacker79]in1976.ThedevelopmentenvironmentwastheAltooperatingsystem[Lampson79]whoseuserinterfacewastheExecutive,aBCPLprogramthatoperatedmuchlikethetime-sharingexecutivesoftheday.Whenoneinvokedatool,suchasthecompiler,itranintheentiremachine(alongwithpiecesoftheoperatingsystem).Whenitwasfinished,theExecutivewasreloadedtoprocessthenextcommand.Therewereprovisionsforchainingtogethercommandsbymeansofdiskfileswithdistinguishednames.Around1978,a"Tools"projectwasstartedtodesignasoftwaredevelopmentenvironment.ThisprojectwaslatermergedintotheMesaproject,andtheuserinterfaceportionwasnamedTajo(pronouncedTAH-hoe).ItsdesignwasinfluencedsignificantlybypreviousworkofKayandofSwinehart[Kay69][Kay76][Swinehart74].Belowisalistofbasicpreceptsfromthe1980TajoFunctionalSpecification[Wallace80]:Clientprogramsshallnotpreempttheuser(Swinehart'sLaw).Theusershouldneverbeforcedintoasituationwheretheonlythinghecandoisinteractwithonlyonetool.Don'tcallus,we'llcallyou(Hollywood'sLaw).AtoolshouldarrangeforTajotonotifyitwhentheuserwishestocommunicatesomeeventtothetool,ratherthanadoptan"asktheuserforacommandandexecuteit"model.Theuserownsthewindowlayout.Individualtoolsshouldmakeminimalassumptionsaboutthesizeandpositionofanywindowsthattheyown.Theproceduralintefacetowritingonwindowsshouldmakesuchconcernslargelyinvisibletotheclientcode.Thereisanotherimportantpoint.Bythistime,theMesaprojecthadmovedfromcorporateresearchintoadevelopmentorganization.Whilesomeofthesamedesignersworkedonitinbothplaces,therewasnowadefiniteengineeringflavortotheeffort.Severaltimesa90%solutionwasimplementedsinceitcouldbedonetoday,ratherthanwaituntilweunderstoodhowtocompletelysolvetheproblem.3.UserIllusionFortheuseofmultipletoolsinmultiplewindowstobemosteffective(forchangingactivitiesquicklyandeasily),theuserinterfacemustbeconsistentacrossalltools.Theperceptions,model,andconjecturesthatauseraccumulatesaboutasystemarereferredtoasthe"userillusion."Theintentug/Gs_/_/ "'7(+.1^3M79] @D\ !.ZZ} #'4 XX +] %(>,E- 4  F3PL    #'*0Z25M ;=v=PLPL>sPL@FN kQ y "v )*-I05 7=>NADFK ZCR#(T+/14):j@DF3I #q%\*m- 0U8 @E? "P% , 35;?NA+DJG%= Y &+P,.Q026\<?B3E;Z   8 t8  !T#(+W.J 6s98 8 :=@E5 #{'),0h2J468=@CE2t2,5E!$I ,Ms/Q220249=@(CCD0SPwz"$ -04m6%8;?CF. ic&+(-/*t*@$s'**) 0037;A ('$&p) .148`;3 BG0&g X$(+1k5;^= ?lC,# ; "%)(*.w35:=nC{  # !%2(*-"06;=?UADn eta s$X(*-]27;=W@F3z ~t"zz"sz&)*>-k0k35 ="@-A F (r lfs C7$6)+m-I068>m C m4"$ +e/16l9{ A_F' c  !c%?&c*-(2d4 58; BDTVm$3underlyingTajoistocreateaconsistentuserillusionthatenablestheusertopredictinstinctivelyhowtouseanytool,regardlessofpreviousexposuretoit.TheprincipleissometimescalledtheLawofLeastAstonishment.Firstafewwordsaboutthehardware.TheDandelionhasa17inchCRTorientedwiththelargerdimensionhorizontal.Thedisplayimageisdividedintoanarrayofpixels1024acrossby808down.Theimageisrefreshedfromaregionofmemory,whereeachpixelofthescreencorrespondstoabitinmemory.Suchadisplayisoftenreferredtoasabitmapdisplay.Azerobitinmemorycausesthebackgroundcolortobedisplayed,aonebitdoestheopposite.MostusersrunTajowithawhitebackground,althoughchangingaparameterintheuserprofilewillallowwhiteonblackoperation.Thereisakeyboardandamousewithtwoorthreebuttons.Thesoftwaremakeslimiteduseofthemiddlemousebutton,soitis"pushed"onatwobuttonmousebychordingtheothertwobuttons.Thecoordinationofmovementofthemouseonthedeskandthemovementofthecursoronthescreenisdonebysoftware.Thereisaprocedurethatrunsathighprioritythat"tracks"themousewiththecursor,subjecttokeepingthecursoronthescreen.Itispossibleforaprogramtoreplacethisproceduresothat,forexample,adrawingprogramcanmakethecursorstayonagrid.Thissectiongivesabriefdescriptionofthecurrent(Mesa11.0)versionofTajo.3.1Windowsug/Gs_/ Ro %&(:-305!7:F EGP  b (#(*,0t-OPP.1sP78;=?BDN  {p "#&(+.4^7;I=@DELe V9 h&(+.2}5-8<>B] F 59 f#|&$'+h1049x=BZDFD XO$J&U'*5.3 5 :=<@CBl  {R!#'*,/25 ;=@#DeF@8 V%!*"#*K-0:149<B"D> )\ !9#'),31L2429u;<BpD ; M!"(?-0Y4 6m:=h?n@8s bO "b$&z+D/f279Mw2 2lTVm$O4`QL* DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD?0DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDpDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDp@ DDDDD~H @ DDDDDDDDDDDDDDDDDDDDDDDODDDDDDDDDDDDDDp@H8ãDDDDDDDDDDDDDDDDDDDDDDDDDDDDD|DDDDDDDDDDDDDDp|IDĈ$d$DDDDDD@I8U$$$"@IU$$$"DDDDDDDDDDDDDDDDDDDDDDGDDDDDDDDDDDDDp@ID"$$d!DDDDDDDDDDDDDDDDDDDDDDDDDDDODDDEDDDDDDDDDDp@H8t"$#DDDDD=00DDDDDDDDDDDDDDDDDDDDDEDDDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDGDDDNDDDDDDDDDDDDDDDD=DDDDDDDDDDDDDDDDDDDD`DDDDDDDDDD<~nw쿻}@ DDDDDۮ?_ǽ}OLDDDDDDD `롻_{ODDo뿺;_?w_DDDDDr;w?,ǿw_>DDDDDDD^<DD^^DDDDD@p ^DDDDDDD` ^DD@< _x ODDDDD@ ODDDDDD`{@9 O?DA@0@GFE O~?0Uc9`~< FD@ _=I _DDDDD@ OFDDDDDD<G| OLFDA!xV @ y`X@T DDDDGA!YeD@} DDDDDDDDFDDDDD^!EAU DDDDDDDDFD=A!$EA9U %YE@BqBU DDDE@AAD0T DDDDDDDDFDDDDGĀA@ 0 DDDDDDDDFD@ 0  QÇtx DDD|D@R$H#"Č FDDDDD?!>U FDA!2 @! U `yXwT$H#"D" cWWדDDODDA!QeD9b}ÇDtx" dQFDDD\DD!LEyU! bQQFDyA!BEU  aQQ%QE@aBU dQDEDD@AAD1T cQQFDDGDDA@ `FD@# = `D|DDD@ `FDDDDD8 `FDA! D `yTǂX=cTD `NDDDDA!Y}"d9Q} `D|DDDD!QTD98U `DyA!PU"Dy0U `q%PU"HdQpBU@ wdDDDD@TXAAp0T| `~DdDDDD@AA c^Dq@@ dTq@ adDDDD@ `FDdDDDD` dFDqA!DA@ cq`dG?>?FDdGgFDq~=xWe]qw]_Y:=pdGw]_ݿw]w}DDDDDDDDFDdGw]ݿw_}DDDDDDDDFDqw]ݿw[]qxA?g>v=xdGDDDDDDDDFDdGDDDDDDDDFDqq8dDp@ FDdD`@ FDq@ q @ dD C FDdD@ B  FDq`p  ƀr B q" @"). %E." B dE"@"(,Q@ ̂$&$E1#!" B FDdG"@"(<Q@8 $"!!!@B FDq" H")8!@0< $$"!!!@BΉqp0j&r0> px $f!!#!B? d\p`å!B ?Dd|`C Dqt @zq Gy weD ~DgEUP} ^DwxD EUP |DD FD|D8 G FDq0@ qp@ dD8@ FDdD80@ FDq@ q@ dDFDdDDDDDDDDDFDqqdD8DDDDDDDDFDdD38p>DDDDDDDDFDq3p3` q3y`3{*qdD?63c> *$(LDDDDDDDDFDdD33?c< ȾFDq3f3<0c<$H q363|o<$(L dD3y>g9 q `FDdD `FDqH l q08 ~dD8`oFDdDp`gFDq` q dD`FDdDp `FDq3" q0{?x r ,q dDb>̀($"" (8`DdD</"> p`vDq<0 $" @A` ?q3|3"=$"" ( dGyxr q`NDdNp`FDq q< dt`FDd`FDq s  gD``FDnD> 8<``FD}3 8 ?y3y8py 0tD36pp=n`DDDDDDDDFDdD3̀lDDDDDDDDFDq3f l`q36=l0dD>ỳylDDDDDDDDFDdDDDDDDDDDFDqq?dG`FDdD `FDq8!qp8?dD`0aFDdDpaFDq`!6q> x !bdD30  `FDdD3{{70 { yaFDq3͎<<0 ͂> 3c33c2!ˆq> <3q< 3>?c#dD6<60 < 3c0cfψFDdD3ͼ8<0 Ͱ> 3c33o0FDq3xxLj00xy y9,qp , dD lmBDdD 8mBvDq??q-"dDblNDdDf"FDq#$q 0{<?dG3` `0 0 `FDdN0 80yǞx 7{cFDqc> p?c006̀ 63<͌#q<c< c6?? dtc<0 c0f 60< FDd3o<3?o006 6<ͼDDDDDDDDFDq9 9?xǞx xs gDDDDDDDDDFDnDDDDDDDDDFD}ytD8DDDDDDDDFDdDpq`qpdDddF" dq @pq"@pdD#pddF" $HLID$$dq$HID$$ppq"@$HID$$pdD8@$HHID$$ddF@  #H3pdqq,h,!,',ppq!2(@H"h(pdG""/@H"((dN"A""( @H"((q!"(HH("h(q>"q"h'0G" "pdt DDDDDDDDDDd" DDDDDDDDDDqԈps"gDcDDDDDDDDDDnF" ]wDDDDDDDDDD}CN,x t,x,x s,x,xys!'z*-7 527:C   mCI!}&([*/q68U:=zCXEQ #Y&7(-13m6;=B>DFu gk e#&*].36 9L; CFi BZ!E%*k-/{37<>ACDF  e B ! t(D e e),-s0 e e1X5b7 : ;u@BtD e eDiTVm$5handlethatpointstothisobject.Theobjectcontainsinformationaboutthetreestructure,thiswindow'slocationwithrespecttoitsparent,andseveralprocedurevariables,suchasarepaintprocedurethatgetscalledwheneveraportionofthewindowhasinvalidcontents.TheimplementationmakesuseofMesa'sopaquetypemechanism,sothatclientprogramsneednotknowanythingabouttheactualrepresentationofthewindowobject.3.2SystemdefinedsubwindowtypesTosimplifythetaskofthetoolwriter,thereareseveralsystem-providedsubwindowtypes,eachwithitsownruntimemanagementroutines.Sometoolshaveonlyonesubwindow,likethefilesubwindowforthelogoftheExecutiveinfigure1.Sometoolshavemultiplesubwindowsofthesametype,likethetwoformsubwindowsoftheFileTool.Thethreemostpopulartypesforincorporatingintoolsarethefollowing:Amessagesubwindowisoneforgivingsmallamountsoffeedbacktotheuser,suchaserrorconditions.Thesewindowstypicallyhaveonlyafewlines,andasinformationscrollsoffthetopitisthrownaway.Afilesubwindowisusedbytoolsthatwanttocreatealogoftheiroperations.Theclientprogramsimplywritestothelogbystandardstreamoperations.Ascharactersarewrittentothelog,theyappearonthescreenandalsogointothefile.Thebuilt-inmanagementroutinestakecareofthingslikelinebreaks,scrolling,windowsplitting,selection,etc.Aformsubwindowisthemajorworkhorsefortheinteractiveportionofatool'suserinterface.Thesewindowscancontainformfieldstobefilledin(witheithertextornumbers),choicestobemade(eitherbymenusorone-of-manyselectiononthescreen),andcommandbuttonstobeinvokedwiththemouse.3.3ToolstateWhenatoolhasitsfull-sizedwindowopenonthescreen,itissaidtobeinanactivestate.Thisislikehavingawoodworkingtooloutontheworkbench,readyforuse.Toolsthatwillnotbeneededforawhilecanbeshrunktoaniconicformonthescreen;thesetoolsareinthetinystate(seefigure1).Atinywindowtypicallyretainsallwindowstate,suchasparametersthattheuserhasgiventhetool,optionsselected,ormessagespostedbytheprogram.Inthephysicalmetaphor,thinkoftoolsthatareplacedinatoolbelt,convenientforuse,butnotclutteringthebench.Thethirdstatefortoolsisinactive.Whentoolsaredeactivated,theydisappearfromthescreenentirely.Byconvention,theyfreeupanysystemresourcesthattheyareusing,includingthepreviouslydescribedwindowstate.Theyare,however,addedtoamenuofinactivetoolssothattheycanbesubsequentlyre-activated.Thesetoolscorrespondtothoseputbackintothetoolbox.ug/Gt_, s_,=?xM!$). 6V:k<? F=\ k!#(+0h7+ =~@BtDH\\DZ sZ^ !&(D*/16GBEKW  dEZ R#'L*z-03 :=?YAI#  r|?#V%){,0<5 =?pAEvF ]t  h"%),0F38 G0D P B>B>t|B>B>sB>!z"%'+/56<>P@DG0@ x "#:(.15%6d9<?AT =P% {!&;Zt;Zs;Z [#%).,/1Q5l69:>K F9%\!%'*,x.4,8 @RBq 69!|$(*-O1~4+68;=A&C4 "!$')r-0g368 =C9 2 0 0 t0 0 s0 !S#'.0t3q0 0 3 s0 :? @B"E- $'0,)t/--0s-3L57:<@CDIG+tX++s+ {"Q%*B,$0o2 :?AC)ot)o)oBs)o)o!#g%W*-0w# #ls 1 #+&(+/02Y5268:t~~|||~~???||||||pTheoutertwo(orperhapsonlytwo)mousebuttonsareusedforselection.Theleftbutton,calledpoint,isusedtobegintheselection.Whenthebuttonisdepressed,theclosestcharacterisselected(videoinverted),andtheselectiontracksthemouseuntilthebuttonisreleased.Inthissense,oneshouldthinkofselectiontakingplaceonthebutton'suptransition.Ifonewishestoselectunitslargerthanasinglecharacter,thisisdonebymultipleclicking.Iftheleftbuttonispressedtwiceinrapidsuccession,theselectionmodebecomesword-selection.Threeclicksgetlines,andfourclicksselectstheentiredocument.Aftertryingseveraldefinitionsofmultipleclicking,wesettledonthefollowing:thereisaparametercalledtheclicktimeout,usersettable,butdefaultedto600milliseconds.Ifthepointbuttonundergoesadowntransitionwithinthetimeoutfromitsmostrecentuptransition,amultipleclickissaidtohavehappened.Multipleclickscyclethroughtheselectionmodes,soa5clickisequivalenttoasingleclick.Therightmousebutton,calledadjust,isusedtoextendorcontracttheselection.Pressingadjustcausestheclosestendofthecurrentselectiontomovetothecursorposition,subjecttoselectionmodeconstraints(e.g.,totheendofthecurrentwordifinwordmode).Aswithpoint,theselectiontracksthecursorand"commits"ontheuptransition.Thereisoneslightlysubtle,butquiteusefuladdition.Ifthedowntransitionofadjustoccurswhenthecursorisoverthelast(orfirst)characteroftheselection,theselectionmoderevertstocharacterforextensionpurposes.Discusspreviouslyusedschemes:Drawthroughselection,char/wordbuttons.Discusspreviousindicationsofselection:underline,boxaround.3.5KeyboardThekeyboardoftheDandelionisunencoded;thereisaregionofmemoryfromwhichaprogramcanreadthecurrentup/downstateofeachkey.Veryfewapplicationsdealwiththekeyboardatthislevel,theyuseafacilitycalledTIP(forterminalinterfacepackage).AttheheartofthispackageisacollectionofTIPtables,usereditabledescriptionsofdesiredoperationsassociatedwithuseractions.Thesetablesareassociatedwithwindowsinatreestructure.Everytimeauseraction(keytransition,buttontransition,ormousemovement)occurs,theTIPsoftwaredetermineswhichwindowug/Gs_/ r d   ( )d-20F14}9M=S?CO\ vg !%)t\* 0s\69CNX  B"wS Sl x>d3sO f3 #b',/k25' M yuMM`sMM"-#') 0P4]6K^   !E&Y*z 0375~I* X l!'),j0`3 7F  `*t$aFF%sF&N -?.1d57cD  !#%(qt*^DD+t/s4DD46^8B L! (t+BB,61sB5@X \!q%\(l+/478>$ ( %'-+249;  /!V%Rt';;(R+s/e;;0F3E89 C ?u9!s9%)0|t1992@s95 7 a 8t$d77%!s7&_ ,.368K5R  b!h$*#,276893 S / Q&u(//s#//#%f(*g.06 8u ? uDz//E@s- }"(*.c0.26<AnC9+f s ?+| %!$!(,V-/H279u<+f+f=s@+f+f@C9)1 :!$H&] -^1c25:L>A9D& g u!R&&"s&%)-/4"58:=p?tB&&Cs$  d !!&'-/6 !y  '!<%>* 07>"COE U t !#w lsw m!$ (,H-.3I5:=BCOC Ht"#')*.*0 8;>A,GF CHh #t&6&+1 s56C79;?UAC  > ts03!S& .n0M5= < BE M !$*v,-D0 6:=>AE q  j z").n03e8 ?CeTVm$P7thatevent"isfor"andlooksuptheeventinthechainoftablesassociatedwiththatwindow.Ifitfindstheevent,itpassesthecorrespondingoperationstothatwindow'sassociatednotifyprocedure.TIPtablescancontaintemporalinformationaswell,sothatdecisionsaboutmulti-clickingandchordingaredeterminedbythecontentsoftheTIPtable.TIPtablesaretextfilesandcanbeeditedbytheuser,soindividualscancustomizetheirenvironmentstoaconsiderableextent.3.6Menus  8  p  `  `p     | @ @Ӟ y0Q AL AB A0Q |І     @ H  H  J*f Jhi J(h E( Eh E @ @ @   }  n  ;   ni     @ @   L H H H H      w8}=8xtx=88  @ @ @ , (@H &@H !@H (HH 0G"     p   $  D $      p  ,q< 2, "c " "( q p !<""(#" "(! ps$a$ $ p,)2'"R "R 2R   eAnothermeansforuserinteractionisviamenus.Ratherthanhaveasinglelargemenu,thereistypicallyanentirecollectionofmenusavailableatanytime,determinedbythesubwindowthatcontainsthecursor.Systemsuppliedsubwindowtypescomewiththeirownsetsofmenus,suchasatextoperationsmenufortypescriptsubwindow.Thesetofavailablemenusisobtainedbydepressingthemiddlemousebutton;theyarestackedinsuchawaythattheusercaneitherinvokeoneofthemenuitemsfromthetopmenu,orcauseanothermenutocomeontop.Todothis,movethecursorovertheproperlabeltheneitherreleasethemiddlebuttonorpresstheleftbuttonofthemouse.Fromtheprogrammer'sstandpoint,menusaretrivialtoconstruct.Thereisasystemprocedurethatisgivenawindowhandleandanarrayofpairs.Thestringsbecomethemenuitems,andthecorrespondingprocedureiscalledwhenevertheuserselectsthatitem.3.7Symbiotesb@ @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD DGcDDDGn{DD{Ư{~鿺DG{n DDDG{~DD{mq{ǛƯDGDDDGDDDFDDDFDD   DF8 |  p 8DDDFD @ @@DDD8ĀAcx4@ 9c4N89`88A8E%AR!L"x&S  HRLQD"EEHD"8YDDFQ|A!D"@$Q  ND0"E||Q"Q|DDDFPA%A!D"@$Q  RD"E@$@Q"P@DDPE$ER%L"@@$S  IRLD"BEEIDY"@DPD8@94!@$M 48!988!8c8DFDDDFDDDFDDDFDDAADGDDDFADDADFDDDFDDDFDDDFDDDFDDDFDDMenuscanprovidemanycommandswithoutrequiringtheusertoremembertheexactcommandnames.However,forfrequentlyusedoperations,itiscumbersometorememberwhichmenucontainsthedesiredcommand,bringittothefront,andselecttheitem.Onesolutiontothisproblemissymbiotesubwindows.Theyappearatthetopofotherwindowsandcontainalistofidentifiers.Whentheuserclicksthemousebuttonononeoftheseidentifiers,thesymbiotehandlersearchesthroughalltheitemnamesfromthecollectionofmenusontheothersubwindowsoftheirwindow.Ifitfindsamatch,itcallsthecorrespondingprocedure.ug/Gs_/ =`U"8%'*-/3 9=?EG\ ~c &Z -.17 t\=AsG{\\Y  (*s-/29=6 F'Wv c $~&'(w+*/O258#:=@RBDUA  X "%(V 023 ;wO Ol x=8sLs 'y !#/%z*/x2678J> -$H S$Y *,{068H  L5!$g),05E Y -#%'S+/014v C  Y #%'-c13a9(Am q|"%(+- .1358?8 `d!$(,<.1A57n= ]}!#&*,14A6: 7^"'f)Z-/2:688 5J z  !&(M,=- 489;?F3  <da>!S%v&33'ks+33v,33-s35E9<ADF0 F !()-369=T@"w+a +alx K Hsv Y& #(5.O035<]>B}A  G"d )L*+ 35P;?C{ )# #l'U**. 047=E?AGst e s"8#&~)*.47u<{=@0B  Se= &$&)+c/ 58c>XC{p -P"T (*>.036 >_@C[;  - a 'X *TVm$384.ProgrammingToolsThissectiondescribessomeoftheMesaprogramdevelopmenttoolsanddescribeshowtheneedtohavetheminteractinfluencedtheirindividualdesigns.4.1RuntimeloaderTheruntimeloaderistechnicallynotaprogrammingtool,butratherapartofthePilotoperatingsystemkernel.Nevertheless,inordertounderstandtheotherprogrammingtools,someknowledgeoftheruntimeloaderisneeded.AMesaobjectprogramhas,inadditiontocode,aheaderthatspecifiesalistofinterfacesthatareimportedorexported.Theseinterfacesarethe"glue"thatholdsmodulestogetherintolargerprogramsandaredescribedindetailin[Mitchell78]and[Lauer79].Theruntimeloadermaintainsadatabaseofallinterfacesimportedandexportedbyprogramsnowloaded(eitherpartoftheoriginalbootfile,orpreviouslyruntime-loaded).Loadinganewmoduleisathreestepprocess:1.Movethecodefromtheobjectfileintovirtualmemory.2.Forallinterfacesimportedbythisprogram,seeifthereissomethingalreadyloadedthatexportsthedesireditems.3.Forallinterfacesexportedbythisprogram,seeifthereissomethingalreadyloadedthatwishestoimportanyitemsexported.Mesadoesnotrestricttheprogrammertohaveasingleimplementationmoduleforagiveninterface,soitispossibleforstep2or3toonlypartiallysatisfytheimportneedsforaninterface.Notethattheloaderiscapableofmanyofthetaskstypicallyassociatedwiththelinkageeditorofamorebatchorientedsystem.Indeed,smallmulti-modulesystemsaresometimestestedbysimplyloadingthevariousmodules.LargeorpublicallydistributedsystemsarealmostalwaysboundtogetherbytheBinderdescribedbelow.Objectprogramsalsocontainalistofcontrolmodules.ManyMesamodulesaresimplycollectionsofprocedures,butsomecontainmainlinecodeaswell.Whenaprogramisrun,itscontrolmoduleshavetheirmainlinecodeexecutedintheorderspecifiedwhentheobjectprogramwascreated.InkeepingwiththeTajodesignprinciples,mostprogramseithercreatewindowsforinteractionorregistercommandswiththeExecutive(orboth)andthensimplyreturn.Onceaprogramisloaded,itusuallystaysaroundforever(oruntilthenextboot,whichmaybeaweekortwoaway).Thereis,however,anunloaderthatgoesthroughthethreestepsinthereverseorder.Thusisitpossibletoloadtwohighlyinterconnectedmodules,decidethatoneisbuggy,unloadit,makerepairs,loadthenewone,andhavetheinterconnectionsnowproperlymadetothenewmodule.ug/Gr^ ^l s[ gQ!$*? 2r58>iAoCG0Yq {q 6!} 'wS SlsP - ##$` -0>2680;'<?fBNn ,M q#,$ ,.t2 :>aAL:  d4H DK$&*++`/28R9;t=HH=sHCFtF sF&tFFasFF "$'1+s.17BF@  o $}%(-/0*36==; #H'a),0;!;! t ;!;!ls;!$&)/2 37-8?sDc8"6q6q t6q6qs6q$&)/237'8?qDc4=!M#'0 EeL #m% (B)\-7 7;>#?<B .  o1s p#(-/z47:< +i  I $g&({+1X 7:=8AEG)5 [8Q#n'( /47n>CBWDn' wc#% ,- 3a8;7?D$  j !} &C7!~t#A!}!}#'s,!}!}. 2 5;N=B% H  ] .%8(x*-13 89<>CZ LU!"%<(.2~49 >AWG TF %))/m37=@ G o#5%r)'+/3u[ Z2"&*/25[7:>BEG' 5{~C$ t&''&s'+.u169)<@AD, 8N!$) 2t8z<?BDc G"%(+.?8;ADF TVm$94.2CompilerTheMesacompilerisorganizedintomultiplepasses.Thisispartlytosimplifydealingwithalanguagethatallowsforwardreferences,andpartlybecausetheinitialimplementationwasontheAltowithasmallmemory.ThefirstpassisatabledrivenLALRparserwithsemanticroutinesthatconstructanabstractsyntaxtreeinvirtualmemory.Laterpassesdecoratethetree,andeventuallygeneratemachinecodeaspartoftheobjectfile.Thecodeisforastackarchitecture[Johnsson82]thatisinturnimplementedinmicrocodeontheDandelion.Alljumpinstructionsinthisarchitecturearerelativetotheprogramcounter,sothecoderequiresnorelocationbytheloader.Thereisnoseparateassembler;allportionsofthesystem,downtothe512bytebootstraploader,arewritteninMesa.TheunitofcompilationistheMesaMODULE.Thisistypicallyacollectionofproceduredeclarations,togetherwithglobalvariabledeclarations,andsometimesasmallamountofmainlinecode.Atthebeginningofthesourceprogram,thereisadeclarationofthoseinterfacesthatareimportedorexportedbythismodule.Asmentionedinsection4.1,thecompilermustproduceaheaderontheobjectfilethatprovidesthisimport/exportinformationtotheloader.Thecodeandthebindinginformationareallthatarereallyneededforexecutionofamodule.However,additionalinformationisneededtosupportsource-leveldebugging.TheMesacompilerwritesoutmostofthecompile-timesymboltableforusebythedebuggerandperformancetools.Unlikesomepublishedsymboltablestructures[Graham79],theMesasymboltablesareorganizedinsuchawaythatnoinformationusefultodebuggingisdestroyedinthecompilationprocess.Thecompileralsoprovidesasource-to-objectmappingfacility.Thesymboltablecontainsabodytable,whichcontainsanentryforeachprocedurebodyorBEGIN...ENDblockcontainingdeclarations.Theseentriesarelinkedtogetherintoatreestructureshowingthenestingrelationshipofthesourceprogram.Eachentryinturnisassociatedwithapieceofthefinegraintable,atablethattellstheprogramcountervalueassociatedwiththefirstinstructionofeachstatementofthesourceprogram.Theexactrepresentationofthistableunderwentmassivechangesin1981whenallowancesweremadeforthePackager(seesection4.5).Thequestionmostoftenaskedatthispointis"Whataboutoptimization?"Inanutshell,theMesacompilerdoesn'tdoalotofoptimizationthatrearrangestheorderofexecution;whenitdoesdestroytheabilitytodosource/objectmapping,ittriestoarrangethingssothatthedebuggercangivetheuserfeedbackthatthishashappened.Thisisanexampleofa"90%solution."Beingabletosetsourcebreakpointsissuchapowerfulcapability,andworkssuchahighportionofthetime,thattheusersarewillingtosay"darn"inthefewcaseswhereitdoesn'twork,aslongasthedebuggeriscapableofdeterminingthesecases.(Theyhavebeenknowntosaystrongerthingsinthefewcaseswherethedebuggercan'tdeterminewhat'sgoingon).Thecompiler/debuggercollaborationdoesanadmirablejob,butnewideas[Zellweger84]wouldallowittodoanevenbetterone.ug/Gw_, _,ls[ , #)j.2$379?ZDdGY v $'+137 AD]FWt "l%_&'+I/38 ;@FU? !& ,p0(4Y9A] N &"+#&l)/13 79<AME^FLm  # #:( +-/2x5;@+B~G0J9 F n; Sv!FF"s&FF'*,?12 8:@ D 3Z %(D/0/38:@SDFB PCe!%H&(P /1t5fBB5sB;>tACBBAsBGt@L s9@L@L<t`@Ls@L$&|+ -0"59S>?DrF> ., &/ -/g1: ! $')!,.279@MB2C8  u !&`(-8 4 <?kC#6_ O "m'K*-/14/:N= E64+ QfC" ) 137M<*@+B1  Y[a %&-k.569% @. u]tM..s.(-36y;\>D^tE..FT,s s,sGEy +#L)-.v.,s,s/s2,s,s2v3,s,s4Ts,s6:G @ *> l "$&,14?8 @yB1D( )B} %)*K-/t2( ( 248as( <=I@CF% <> V#s%( /1Dt4w%%4s%:B# b g 3#*0 5a79:> E!m k!C u  }# &(/,0 :E<=BBE5 S $'L -0'35n < ?@D  N $&)#*/358:@CF f$k')+02K37) > BEFK  ]" )`,03-4N7j<@=@FCF AJ;!#x&1)-/Z4/89=>AQGs i "!&)L,1225C:>@gBEl X|"&*.O1B=M E z  VD (=,k01j357:V>N TVm$10TheMesalanguagecontainstwoclassesofmodules:PROGRAMandDEFINITIONS.ThelaterclassisusedfordefininginterfacesandforsharingtypedefinitionsamongseveralPROGRAMmodules.WhenaDEFINITIONSmoduleiscompiled,itsobjectfilecontainsnoexecutablecode,butcontainsasymboltablelikethatproducedfordebuggingaPROGRAMmodule.Thesetablesareusedtoimplementtheincludedsymbolcapabilityofthelanguage.Forexample,supposemoduleAobtainstypedefinitionsfrominterfaceB.WhencompilingA,thecompileropenstheobjectfileforBandcopiesinformationfromthesymboltabletherein.4.3BinderTheoutputofthecompilerisanobjectfilecontainingthecodeforasinglemodule.Formanyreasons,interestingprogramsaremadeupofmorethanonemodule.Whiletheruntimeloaderiscapableoflinkingtogetherseparatelyloadedmodules,mostmediumtolargesystemsaredistributedasasingleobjectfileputtogetherbyaseparateprogramcalledtheBinder.Thisisdoneforseveralreasons,somemoreobviousthanothers.It'saloteasiertokeeptrackofonefileinsteadof50,particularlygivenMesa'sstricttypecheckingofinterfaces.Resolvingthelinkagebetweenmodulesisatimeconsumingprocess,soifallinternalinterconnectionscanberesolvedbytheBinder,theloaderneedonlytaketimetoresolveexternallinkagerequirements.Packagescanbesharedamongseveralapplicationsmoreeasilyifboundtogetherinconvenientsizedpieces.Interfacescanbeobscuredfromotherprogramsbybindingthemodulesexportingthemintoalargerconfigurationthatdoesnotexportthatinterface.Thesymboltableanddebugginginformationproducedbythecompileroccupyalotofspace.TheBinderneednotcopythisintothenewobjectfile,butneedonlychangetheheaderofthenewobjectfiletopointbacktothecompileroutputfiles.Optionally,allofthisinformationcanbecopiedintoanew"symbols"file.Theinputtothebinderisaconfigurationdescriptionthatcontainsalistofobjectfilestobecombinedintoalargerobjectfile.Italsocontainsalistofwhatistobeimportedandexportedbythenewfile,aswellasoptionalinformationdirectinghowtheinternalbindingsaretobedone.Ouroriginaldesign(andeachsubsequentimplementation)oftheBinder[Mitchell79]containsasyntaxallowingcompletecontrolofbinding,withseveralwaysfortheprogrammertodealwithmultipleimplementorsofinterfaceitems.Intheinterveningsixyears,wehavehadveryfewconfigurationdescriptionsotherthanlistsofobjectfilenames,whichmeans"bindthemtogetherintheonlywaypossible."AlmostallofthecomplicateddescriptionscouldbereplacedbysuitablystagedsequentialexecutionsoftheBinderonsimpleconfigurationdescriptions.ug/Gs_/ ,U $[&v,_/_/,s_/2v5K_/_/60 s<_/_/>FADBGs\ ; H!%( /^3v8:\\8s\>DZ v ZZ sZ'!n#:'D).0 7;3=BDX i}#\v$zXX%"sX*048:>?FtV] sV]| b&F(.3u8V]sV]:J? B T) uT)sT){u T)sT)!"$*.047u9?T)sT):=>AT Q r:wLv LvlsI& 4 f!%9' .1468$BDM@T u) O==NC"&'*- 135 ='@Ev;u 9)9)Y!' ,. /=2k9e>@fAC6g!'#L(+-25Z9=Y@CG04" 2E2E#',k 47;=6AG00 ^-- "tl--s-#'2*0279?DEU+` $P'*N,13 ((*!( 0V68;@EF&!D$&*5,/148;q=A-D6$|<S!y%}')m,0+149>A "H; !$P&@*-.18O 7 ' .179;=|AEF   !T"%*,#.`03u468~>pA'F  hVg &,/27'<?@B@ y< &135:O B G  "(9+0<36,8 @BE h TP"9'E)W+ 3z59EAG0n '\P V 9"E$& .^ 69<AC :  h !!:%',+ 4  LTVm$C114.4DebuggerMesahasafull-functionsource-leveldebuggerthatisusedfordebuggingalllevelsofthesystem,includingtheoperatingsystemkernel.Thedebuggerusesthesymboltableandstatementmappinginformationproducedbythecompiler.Itsfeaturesincludethefollowing:Theabilitytosetbreakpoints.Tosetabreakpoint,theuserloadsthesourcefileintoawindow,selectsaplaceinthefile,andexecutesaSetBreakmenucommand.Asfeedback,thedebuggerchangestheselectiontobethefirstcharacterofthestatementwherethebreakpointisset.Ifthesourcefileisnotavailable,theusercanstillsetabreakpointattheentryorexitofanyprocedurebytypingitsnametothedebuggercommandinterpreter.Theabilitytointerruptarunningprogramandfindthecontextofanyprocessrunningatthetimeofinterruption.Equallyimportant,itispossibletoresumeexecutionofaprograminterruptedinthisfashion.Theabilitytowalkupthelinksofthedynamiccallchain,answeringthequestion"Whocalledwhom."Theabilitytoexamineandmodifydataintheclientprogram.Thedebuggerhasaninterpreterforthefullexpressionsyntaxofthelanguage.SinceMesaisstronglytyped,theinterpretercanusethistypeinformationtoprintoutthevaluesinamoreunderstandablefashion.Numerictypesprintasnumbers,enumeratedonesasthepropernamedvalue,andrecordsprintoutasalistoffieldnames,eachwithitsvalueprintedaccordingtotype.Theabilitytocallproceduresintheclientprogram.Theinterpreterdescribedaboveallowstheusertocallprocedures,typecheckingtheactualargumentsagainstthetypesoftheformalparameters.TheMesadebuggerevolvedfromtheAltoimplementationandstillusestheworldswapprinciple[Lampson79]forinsulatingthedebuggerfromtheclientcode.Thereareseveraladvantagestothisscheme:onecansetbreakpointsdowninthebowelsoftheoperatingsystemorininterruptroutines.Therearealsoseveraldisadvantages,ofwhichtheprimaryisspeed.WhentheAltoswappedits128K-byteworlds,ittookbetween3and4seconds.TheDandelionhasafasterdisk,butwiththe768Kbytesofatypicalprogrammerworkstation,ittakes10-15secondsfortheswap.Thingsgetevenworsewithlargermemories;theDandelionwillhold1.5megabytesonthestandardmemorycards.Onesolutiontothisproblemisteledebugging.Thedebugger'spathtotheclientworldisthrougharathernarrowinterface.Theroutinesthatreadthememoryfromtheworld"swapped"onthediskcanbereplacedwithonesthattalktoothermachinesontheEthernet.Coupledwithasmallteledebugnubintheclientcode,theseroutinesgiveessentiallyinstantaneousturnaround.Theclientcomputerneednotbegeographicallynearby,either;animplementorinPaloAltocandebugaug/Gw_, _,ls[ k6 E ")+-k039;?AD Y =#&,/26:6<C#Wt 5VQ$H&C+p0O2 TT '/)X+x, 36S9O<?HCFR40 t$"%(d+?.3u4RR5sR;a?]FP~"'*/1r3e58>@GBN\~ !z"%').R02=4 :=F@JBEGL' "$'X)%+2r48:>@aBIQ GxGx"?#Z(.035:CEC %a*z 16239C:?EGC "a%@@]9 "%z(*-l3)5:@CN>_;;"[%),.1!4;r>VDlF9 '! (F,y. 0m6:>&?D7{  #&) 137:x=3ACEK5F #)-1G3-9n A1DF3m #(+.g01A35;8l= @<CYE50 .b.bg &y(2*.h47 >D,.eR!s (+1z37>fBEJ) x & ^!-#& 036X9jt;&&<?s&C$v  n$(I*.p268= DF="B  #@$'1+-^/5:,;=C: >( "$(+z02Y7S;>A?G m<!9"u%3&n,m/L689=@C]F z&9 " *,/3r8:=mAFp %  #a*4,0.2z9C;X=Cq;  dte s'Y)W,8 3&6U8 :u>>B2C  %'+(-3/69/=8D\F 94#!$&u*012B4;B@D E@ O IF#K(+c 1 :` BWE   Mu #(-/ 89=;@CNG \TVm$,12programrunningonamachineinLondon.4.5PackagerThePilotoperatingsystemsupportsademandpagedvirtualmemory.Italsoallowstheprogrammertospecifyswapunitssothatwhenaparticularpagemustbeswappedin,theoperatingsystemmakesanefforttobringinitsentireswapunit.Whenthecompilergeneratescodeforamodule,itputsthecodeforthevariousproceduresintoacontiguoussetofpagesintheoutputfile(interspersedwithreadonlyconstants).Whentheprogramisloadedbytheruntimeloader,thesefilepagesaremappedintovirtualmemory.Thedefaultswapunitforcodeistoswapthecodefortheentiremoduleasaunit.Proceduresareoftencollectedinthesamemodulebecausetheyworkonthesameabstraction,orbecausetheysharecommonprivatedefinitionsanddata.Itisoftenthecasethatsomeoftheproceduresofthemoduleareusedonlyforinitialization,orthatsomeprocedureinmoduleAistightlycoupledwithanotherprocedureinmoduleB.ThePackagerisatoolthatallowstheprogrammertoassociateproceduresofacollectionofmodulesintoexplicitswapunits.ItcorrespondsverymuchtotheChineserestaurantstereotypeof"onefromcolumnA,twofromcolumnB."Thepackagertakestwofilesasinput,oneisbinderoutput,theotherapackagingdescription.Apackagingdescriptionisasequenceofswapunitdescriptions.Eachswapunitcontainsalistofmodulesandproceduresfromthosemodules.Thisisaconsiderablesimplification,sinceanexplicitlistisonlyoneofaboutninewayssupportedforspecifyingtheproceduresinaswapunit.Forexample,onecouldspecify"allproceduresofMnotalreadyplacedinswapunitsnamedAandB."Recallthatthesourceleveldebuggingreliesoncompileroutputtablesthatgiveasource/objectmapping.Thesetables,togetherwiththesymboltablestakeuplotsofroom;theysometimesaccountfor80%ofthebulkofacompileroutputobjectfile.WedidnotwantforthePackagertohavetorewritethatinformation.Considerablecarewentintotheredesignofthesource/objectmappingtablesproducedbythecompilertomakethemindependentoftheeventualentrypointlocationoftheproceduresoncetheyhavebeenpackaged.4.6PerformanceToolsThepackagerdiscussedaboveistheeasierhalfofanimportantproblem,thatofreducingworkingsetsize;themoredifficulthalfisthatofdeterminingwhattheswapunitsshouldbe.WehaveanumberoftoolsinXDEtoaidinansweringthisandotherinterestingquestions.Indeed,theprincipalconclusionof[Knuth71]wasthatprogrammersshouldhaveandusemoredataabouttheruntimeperformanceoftheirprograms.Thesetofperformancetoolsincludesthefollowing:Spyaprogramthatwakesupperiodically(atinterruptlevel)andrecordstheexecutionug/Gs_/ :qw& wY YlsVb s#!"'+0C6l7:>@ T-  I8C ! '+.r0R57:-@;DQ  gmG3!N 2!T#$**+.04J68= DGLu W"~$ ,0 5 <@COJA  q|"%[)+f03x7=@ElH - F"$(-/}0D = |"&+0379<? GB E" ),124L8:=@DF@U 9"%5'/148\>@uE@Us@UGs> B#u%>'3u,z> s> -m/[t2z> > 3as> 8:q;>B F; n !j#$ *#+1!38;?A= 9 ? "M (*-1W6L81:>DC96h u#&i',e1E37n8?9 GR44 H a"o$N'* 37G:=CrDG%1 , F!(9+O,- 5>BD /  ">(+8 14S ;}=M>B/F3- {$' &,u'-s-),05-6:J=uB5-s-CuF_-s-GR*H w$Z("*R0648;>@J ( #m"n$)c-50246):2=(C%  :' %_)},/\14Q79@AG%A  Yh" w l yst `tt"btt"st&C)*,3G9.<=C@  .z[ #% -S0376:9>ADZG uB) ")M,(/2 9 AEF  Z #s&M .3H69_;?BF  $Q'))F* 36T;> ' ' $& -/59;@jB 9TVm$013contextofagivenprocess(orsetofprocesses).PerfPackageatoolthatallowstheprogrammertodefineasetofnodesinarunningprogram,usingthestandardmachineryforsettingbreakpoints.Asetoflegs,definedbypairsofnodescanalsobedefined.ThePerfPackagereplacesthebreakpointhandlerwithonethatcountsthenumberoftimesthateachnodeisvisited,aswellastheaveragetimespentoneachofthelegs.Transfercountingtoolsseveraltoolstonoteallinterestingcontroltransfers(procedurecallsandreturns),andpresentvariousstatisticsaboutthem.Pagefaultanalysistoolstoolstorecordandpresentdataaboutpagefaultbehavior.Thesetoolsallrelyheavilyonthesource-leveldebugginginformationproducedbythecompilertopresenttheirresultsinthemostusableformat.TheSpyisaninterestingexample.Onecanfirstseeinwhichmodulesaprogramisspendingitstime.Thenforasetofmodules,onecangetstatisticsaboutthemosttime-consumingprocedures.Finally,statisticscanbecollectedatthestatementlevel.SincetheSpyworksonasamplingprinciple,itissometimesusefultoswitchtothePerfPackagetoobtainexactstatisticsatthestatementlevel.4.6ConsistentCompilationToolsTheMesacompilerchoosestopaintRECORDtypeswiththe48bitversionstampoftheobjectfileofthemoduleinwhichtheyaredefined,typicallyaninterfacemodule.ThusifproceduresinprogrammodulesXandYbothreferencearecordtypefrominterfaceA,thenXandYneedtoberecompiledwheneverAis.Thisleadstocompilationdependenciesdeterminedbytheincluderelationshipsofacollectionofprograms.AtoolcalledtheIncludeCheckertriestodealwiththeseproblems.Itsoriginalgoalwastotakeacollectionofmodulesanddeterminewhethertheywereconsistentwithrespecttoversionsofthevariousinterfacesholdingthemtogether.IthasgrowntowhereitcanbepointedatthecurrentversionofaprogramandtoldtocreatethesequenceofCompilerandBindercommandlinesnecessarytomakeanewone.InissimilartotheUNIXTMprogramMake,butdiffersinatleasttwoways:itonlycaresaboutcompilationandbindingdependencies,anditdeterminesthesedependenciesautomaticallyfrominformationintheobjectfile.Anearlier,moreambitious,toolworkedonthefollowingpremise:if,intheexampleabove,thechangestoAwereinareasunusedbyXandY,thentheyneednotbeactuallyrecompiled,butmerelyupdatedtorefertothenewversionofA.SuchatoolrequiressomecareonthepartoftheCompilertoleavebehindasuitable"audittrail"sothatthelatertoolcandetermineexactlywhatwasusedfromagivenincludedmodule.Thistoolwasnotasuccess,quitepossiblybecauseitalsotriedtodealwiththeproblemofaninadequatediskontheAltoworkstation,andhadtheunfortunatesideeffectofsometimesdeletingtheonlycopyofthesoftwarethatitwastryingtomakeconsistent.ug/Gs_'~\$/&m(*B \\  #h'* 1379;7t<\\=s\@BvCZw%,O.2 ;W<? t@ZwZwA-sBZwZwCXB #%+-- 5:< CV8 !$")|+c/:25594:?ADFS!$&)Q^Q^Y '*,`/`16 7BI^   (/P 6=? AnG0G* O$J),/13 9@QChFD  ~tj &(E,/1246}AICz B   &+ 1135;><?EA@ d! ')"*1M5h7;W= ?k G0>X y v# w8 8l . !s5 D  v"o55#Bs5'+.13 56: >"?BQFu3U  'X8w!>&,~.4w:>e? G01! <u1!s1!1u1!s1!d%&+ .21u7C1!s1!869u<=1!s1!=u@e1!s1!AE=F. "u.s.kP!%t'..( / s.7n ?AQC,  %'V*..1t0,,17 s,:a=q?*B/EU* !$% ,+-36f=BfE(O  * "%) 058>@uBG0& o%@w:$)+,25~8:[>AG%# >")%*./268x9>@OBv$sFs! {w!]$'+-048 @C}  5# , 5(8 @hB>DI  $ s e%t'*&0^6(89<`AF usmY"Gu$hs%u(s)*.1J47g9}> F] ;@<!&Lu(s(*S-.17:=?ADF\ ;5"_&*U,,/147:;@E' Z.%n(+Z.016:F?DF gDB!\ (F+-/D2A 9<?A] ~C"?%S(*R,24688<>B0  TVm$145.OtherusefultoolsThetoolsdescribedinsection4arearepresentativesampleofthosethatareheavilyintegratedwiththeMesalanguage.Thereareanumberofothertoolsthatrunintheenvironmentthatarevaluableforprogramdevelopment,butarenotaslanguagespecific.Asamplecollectionofthesetoolsfollows:ProgramLibrarianDFsoftware,like[Schmidt82]butwithlibrarianextensionsAdobebuilt-ins:FileTool,abbreviationexpansion,ChatMailreadingprogramsTooldriver6.Usersupplied"Hacks"Thereisadefinitepositivefeedbackeffectfromhavingthedevelopersofasystemrelyonitfortheirday-to-dayexistence,particularlyinasystemasopenandextensibleasXDE.Intheearlydays,whenanimplementorwroteasmallprogramthatinhancedhisproductivitytherewasanaturaltendencytoshareitwithhisfriends.Such"neathacks"oftenwereincludedinthenextofficialreleaseofthesystem.Thesymbiotepackagedescribedinsection3.7startedlifethisway.Wereachedthepointwheretheproducersandusersofthisancillarysoftwarewerenolongerhousedinthesamecornerofasinglebuilding,butwerespreadacrossthecontinent(evenafewonothercontinents).Inthissituation,adegreeoforderwascalledfor.ThedirectoryononeofthefileserverswaschangedfromaprivateMesagroupdirectoryintoapublicone,andasetofruleswasestablishedtogoverntheuseofthisdirectory.Herearesomeoftherulesfromthemostrecentset[Johnsson83]:A"hack"isauseful(orsemi-useful)programthatismadeavailabletothegeneralcommunityasapublicservice.Nowarrantyofsuitabilityorresponsibilityforerrorsisimpliedbytheauthor.Ahackstoredonthedirectoryremainsthe"property"ofthesubmitter.Othersmaynotmakemodifications(exceptfortheirownprivateuse)withoutnegotiatingwiththeowner(whomayalreadybemakingsimilarorincompatiblemodifications).Astheownerofahack,youarenotrequiredtofixbugs,butyoumustbewillingtotransferownership(permanently!)tosomeonewhovolunteerstofixthem.Hacksthatarederivedfromreleasedsoftwareshouldbeannouncedtothepubliconlyug/Gr^ ^l< s[ ~.]!" +06158L:?Q EYr  #^{$&F)-/2h4 6[ >]ACeW= " g!$&,249j ?AEU RRPP{L &),*1 MMKK  M (; HHF&F&6+CC6r< <lfs91 V"&*].1u 8n:E;@'CE,F6    #$%*+/1 89>?B Ea4  ]#)(+14[ ADB0` 1Jy"U'-/p4 6I:=/?- "/{ U%(F+-U/5]:=?D *  eYx$'*k.25`;?L@C-E?( M Q$ %),X0`36u+/%58 9S=@CDG%$?   n!`#%(3 .2X48A9<[?C!E"  jE!# +1w4h59?AD [;,"s'*^0%1 8N: BD&\gb:u"t#$s(.36 =?B\ wP6#Z ,S14;7;f@tCB ]!x%)-2=4~9>@  rj#D&(`*0v2-4G7:x=8@BG0 ^ )*0l3p :;=  $"%s*0-46=?7AEBTVm$d15afterdiscussionwiththeorganizationorindividualresponsibleforthatreleasedsoftware.Everyhackstoredonthedirectorywillalsohavedocumentationandallsourcesnecessarytorebuilditstoredonthedirectory.Testingisimportant.Ahackisnotshoddysoftware;itissoftwaremadeavailableoutsidetheregularreleasechannels.Theseruleshaveprovedquitesuccessful;atlastcounttherewereover200programsstoredonthedirectory.Theprogramscanberoughlydividedintofourcategories:Modifiedversionsofofficialtools,withaddedfunctionality.Thesenewfeaturesareoftenincorporatedintotheofficialversionsatthenextrelease.Extensionstotheenvironment.Theseincludeaddingnewkeyboardcommands(madeeasierbytheTIPmechanism),changingtheappearanceoftinywindows,andchangingthesemanticsofscrollbars.Generallyusefultools.Forexample,thereisacalendarprogram,severalgraphicseditors,aspreadsheet,atoolforbrowsingfilesonremotedirectories,etc.Funandgames.Thisincludesaprogramtoplaymusiconthetonegeneratorofthekeyboard,severalarcade-likegames,andMazeWar,amulti-playerseek-and-destroygameplayedoverthenetwork.7.ConclusionsThissectionsdiscussesthemajorsuccessesandtheareaswherewefellshortofourgoalsanddesires.GoodpointsConsistentuserinterface(byseduction,notfiat)Balanceofnovice/expertusability(accelerators&2Dvs.1D)Sourceleveldebugging"personaltimesharing"homogeneousenvironment(selectionbetweentools)Adequateperformance(cyclesofaddfeatures/tuneperformance)Extensibility(TIP,proceduralinterfacetotools)Agreatpercentageofourshortcomingshavecomefrom"thinkingsmall."Bytryingtosqueezetoomuchfunctionalityintotoolittlememory,extensionisdifficult,andtogetadequateperformancethetuningprocessmakesmaintenancedifficult.TheCompilerisanexample,itoriginallyranona64KAlto(anamazinglycomplexlanguagetofitintosuchasmallmachine),butitsdatastructuresnowlimitprogramsizetoabout1000lines.EventhetwoclassesofpointersoftheMesaLanguageareanartifactoftheoriginalAltoimplementation.Anotherproblemisabilitytoscale,butwithug/Gs_/ \ N" *3+ 2' 90;E=C\\ "<u$\\%s\*036:^ CFZ %O&*,u/.ZZ/sZ5 XX "#'B(+v0h689?:C#U$QR g %~')-14n7:,@FDqFuPL sPL 4 !#%*/2~5 MMq!A%),1 :,>DAHFK "l$)g.0L25I!I! m '+0c47=DF &,|. 57:^@XCDP= B=B=#V&2,3/128>Cp@ !"%'-027q >x==!'c(.//269;p>DF;YK &|+6.#46X >Z9$ $!r1 1l s. }%(&*v-146[9;r=AYD+[ (( #H% ,@.&d&d #) 0246##!m!m$   $ *0@ww1 "5&(^+ 3  q &W+- 3 4 $'R*.X4}9;?AYFux  < &k,.. 368z:@ D  i>x #~ ),o235;= C7EG Q i&8'),/14; =?B z""&*,/35:<>B (>d!,279@=?`C&ETVm$416unexpectedresults.Worldswapdebuggingisanexample;programsrunbetterwithmorememory,butworldswaptakeslonger.A"sameworld"debuggerisintheplans.Anotherclassisshortcomingscouldbelooselycalledparochialism.Muchbenefithasbeengainedbyhavingasinglelanguagesystem,andwhenwestarted,almostnothingsimilarwasavailablefromoutsideanyway.Astherestoftheworldgetsbitmapdisplaysandmice,manyinterestingapplicationswillappearwritteninotherlanguages.Thecurrentprogramofplacingthisenvironmentinadozenmajoruniversitiesmaywellleadtootherlanguagesbecommingavailable.Lessofalong-termproblemisanon-industry-standardoperatingsystem.Forexample,experienceatPARChasshownthattheUNIXTMschemeofstandard-input/standard-output,alongwithpipestogluesmallprogramstogethercanbereasonablyimplementedintermsofMesainterfaces.Ontheotherhand,twodimensionaluserinterfacesareoftenpreferredtotheparadigmoftypingcommandsintoaTTY-likeexecutive(butcertainlynotalways)ug/Gs_/ f&')/58zADnWw  D,!$u('*L/38=?EwUC Z.S $h'+03k6: AH S P|# #&+h027e9 BCDP  !m% +W2 M  <-49}<-B KW  Dn=vK!ksKW$ (*>dB$E?I#  tJw"$ + 459;?F FF O3N> !9$w *-}1U79<9BDD i"%+,-TVm$qGACHA  TIMESROMAN TIMESROMAN HELVETICA TIMESROMAN TIMESROMAN TIMESROMANY HELVETICAY HELVETICA3 L8N *W|e~  % 2 sj/w.[]<>MesaPaper.tioga%Monday, December 3, 1984 12:16 pm PST