The Macintosh Programmer’s Workshop

Richard J. Meym and Jeff W. PaIrish,Apple Computer

me Macintosh hen the Apple Macintosh was ming), a shell command language, and a introduced, it was clear that language for automating program builds. development WApple needed to provide acom- Originally developed for the Macintosh environment combines plete softwaredevelopmen t environment Plus, MPW now also runs on the Macin- for both itself and third-party developers. tosh SE and 11. a gPaphica1 intehce, The result was the Macintosh Program- This article focuses on the programde- Unix-like command mer’s Workshop.’ MPW includes a com- velopment environment rather than on IangUNe, and prehensive set of programming tools and the tools in that environment. Innovations handles several languages. It also com- not covered here include C and Pascal ex- immediate command bines the graphical interface common to tensions for extended-precision IEEE execution in any all Macintosh applications, a command floating-point numbers, tools to compile window. Here’s how language similar to the Unix shell lan- and decompile Macintosh resources (data guages, and Smalltalk’simmediate execu- structures used to describe menus, win- it works. tion of commands in any window. dows,and dialogues), and the MacApp ob Innovative features include an inte- ject-oriented generic application. grated command and editing language, redirection of input and output to win- History dows and to selected text in windows, a When the Macintosh was introduced in graphical interface for each command, January 1984, most software for it was writ- and userdefined menus, which associate ten using the Lisa Workshop, acrossdevel- shell commands with menu items. opment system that ran on Apple’s Lisa The supported languages include Mo computer. The Lisa Workshop provided a torola 68xxx assembly, C, Apple Pascal mousedriven editor, 68000 assembly lan- (which supports objectariented program- guage, Pascal, a linker, and several utilities

May 1988 0740-7459/88/0500/0059/$01 .00 @ 1988 IEEE 59 running in an environment similar to ties. The various system components tion to the point that system and user soft- UCSD Pascal. A second alternative, the should share a common set of windows, ware were difficult to distinguish, and MDS Macintosh development system,had both for reading and writing. This would some automation and extensibility. the advantage of running on the Macin- let the user view the input and output of However,it was difficult to use Smalltalk to tosh, but it provided only assembly lan- several development tools simultaneously. create stand-alone applications, and its guage and was merely a collection of sepa- And an integrated system would provide a performance was not adequate. rate applications (including an editor, basis on which to build automated opera- Envisioning a system that met our goals assembler, and linker) that were executed tion. was not a problem: Acombination of Mac- sequentially- it was not an integrated en- The system had to protide automated intosh’s user interface, Smalltalk’sinterac- vironmen t. operation for program builds. As the com- tive nature, and Unix’s command lan- By summer 1984, it was clear that a more plexity of Macintosh software grew in re- guage was a good approximation. The complete development system running sponse to increased hardware capabilities, challenge was to engineer this vision on on the Macintosh was needed as soon as building software essentially by hand - the limited hardware and software avail- possible. The urgency of this need was un- one step at a time -was rapidly becoming able on early Macintosh systems:The Mac- derscored by the prediction that the Lisa unworkable. MPW had to provide a mech- intosh Plus, which would be the high-end would soon be superseded by the Macin- anism to automate program builds -and machine when MPW was introduced, in- tosh, bringing cross development to an it had to manage the dependencies be- cluded a Motorola 68000 running at 7.3 abrupt end. tween software components. MHz and only IMbyte of main memory. The engineering team grew from three The system had to be easily extensible, The maximum hard-disk capacity was 20 to 15 during the first year of development. both by Apple and by other users. The tar- Mbytes. At the end of that year, earlyversions of the Software constraints provided an even Macintosh Programmer’s Workshop were bigger challenge: The system architec- being used todevelopMPWitself. Much of ture, encoded in ROM chips, would run Apple’s internal Macintosh software devel- Wehadfourm~ordes&b only asingle application in asingle address opment has been done with this software oWectives=Make space. Multiprocessing, multitasking, and since late 1985. In September 1986, Ver- the virtual memory were not provided. The sion 1.0 was released through the Apple system comprehensive, system did, however, provide code Programmer’s and Developer’s Associa- interne it with the segmentation, resources (swappable data tion, a group based in Renton, Wash. - environment, provide structures, such as descriptions of menus just less than two years after the project automated builds, and and windows), and a memory manager began. A major update, Version 2.0, was make it easily extensible. that supports a heap with relocatable ob completed and released in August 1987. jects. Goals Design Four major design objectives helped get audience for MPW was broad. It in- MPW is built around a single application shaped the system: cluded university students, software en- program that serves as a combined editor The system had to be comprehensive, thusiasts, professional application devel- and shell. Add-on components, called meeting most needs of most developers. opers, and Apple engineers. It would be tools, run in the same address space as the Software developers inside Apple, as well impossible to satisfy the individual needs, primary application. A command lan- as third-party developers, expected MPW much less the preferences, ofall our users, guage automates operation, and a graphi- to support development in 68000 as- so the system had to be easy to customize cal interface helps construct and execute sembly, Pascal, and C. Because MPWwas to and extend. The goal was to let individual commands. be the development system that Apple sup userscustomize the system, making simple plied, it was difficult to cut corners: If modifications and additions, and let prw Macintosh application. The central de- something was needed for software devel- fessionals add major new components, velopment-system component is MPW opment on Macintosh, itwasour responsi- such as additional programming lan- Shell. Because it is a Macintosh applica- bility to provide it, whether minor or guages, without our involvement. tion, it can be run from Finder, which pre major. Several systems already existed that met vides icon-and window-based file manipu- We preferred an integrated system many of our goals. Unix provided a com- lation, by opening any MPW document. over the multiapplication Macintosh prehensive set of tools, automated opera- (Documents are files created by applica- Development System that was in use when tion, and some degree of extensibility,but tions. Documents are opened to see their the design work began. The system should most versions lacked the window-based contents.) You can also use MPW Shell as be a Macintosh application, providing the user interface. Unix also placed demands the start-up application. standard windows, menus, and dialogues. on the hardware that the Macintosh could MPW Shell provides a multiwindow en- Moreover, it had to appear as a single ap not satisfy at the time. Smalltalk provided vironment for editing text files (see Figure plication rather than a set of disjoint utili- a user interface closer to our goals, integra- 1). Editing is done with the mouse (or cur-

60 IEEE Software sor keys) and pull-down menus (with key- MPW provides many commands, such as naturally included in scripts and Make board equivalents). You can select font those for text editing, window manipula- files; these commands have graphical in- styles and sizes for each window. Because tion, file management, and compiling, terfaces. the shell provides the user interface com- linking, and executing programs. Version Commands are implemented four ways: mon to all Macintosh applications, the 2.0 contains more than 100 commands. Built-in. Many commands are imple- users know the basic system operation. Integrating the shell and editor lets us mented directly by MPW Shell. These use a single command language for both built-in commands provide the fastest exe- Integrated editor and shell. MPW Shell editing and shell operations. This has sev- cution and require the least amount of combines the functionalityofa traditional eral obvious advantages - and some disk space. However, because they are editor and shell. Windows can contain advantages that surprised us. The major linked with the shell program, they can source code, documentation, scripts, and ones are that: only be modified or replaced by rebuild- so on; the shell provides general text- Users learn a single command lan- ing the shell. editing capabilities. Editing is disk-based: guage rather than separate languages for Command-language control constructs The entire document need not be in editing and operating the system. (Begin, If, For, Loop, Break, Continue, memory, so you can edit very large files, Selection expressions (an extension of and Exit) are implemented in the shell as helping satisfy the comprehensiveness de- regular expressions) are used both to part of the command interpreter. Most of sign goal. You can use menus to create, match file names (normallya shell capabil- the file-handling commands (like Files, open, and print files, to edit, to search and ity) and to match text in find and replace Duplicate, Rename, and Delete) and replace text using literal or regular-expres commands. editing commands (like Align, Copy, Cut, sion-based patterns, and to manipulate All the power of the command lan- Paste, and Find) are also built in. windows. guage is available for editing operations, Scripts. A file of shell commands is The shell recognizes a command lan- including shell variables and command called a script. Scripts can have an un- guage similar to the languages used by the substitution (using the output ofone com- limited number of parameters that are Bourne shell2 and C shell’ under Unix. mand, such as a list of recently modified accessed individually or collectively as Shell commands may be entered in any files, as part of another command). shell variables. Scriptsare often developed window. They are executed by pressing the You can use the shell’s control con- and tested by opening the script in a win- Enter key, an idea borrowed from the structs (like If, For, and Loop) to combine dowand using the Enter key to execute the Smalltalk Do-It button. Pressing Enter exe- editing operations. commands, one at a time or in groups. cutes the command or commands that are Editing operations can be easily and The command language and the ability selected in the topmost window. If no selection exists, the line containing the in- sertion point (the point where typed text appears) isexecuted. Thus, using Enter in- stead of Return lets you type and execute commands immediately. You can correct errors by editing the incorrect command and reentering it. Because you can execute commands from any window, you can execute them directly from program documentation or comments in the source code. MPW users often create files of frequently used com- mands, some general-purpose and others project-specific. Integrating the shell and editor, coupled with the use of the Enter key, minimizes the typing required to run the system.

Commands. Syntactically, commands consist of a name, parameters (often file names), and options. Commands are im- plemented four ways: in the shell, as scripts, as integrated tools, and Fire1. MPW running concurrently with Multifinder. The windows and menus shown as applications. were created by MPW. The disk and trash icons on the right belong to Finder.

May 1988 61 I/O. The command language includes specifications for the source and destina- tion of input and output. Input specifica- tions can refer to a file, a window, selected text in a window, or text entered interac- tively. Output and diagnostics can replace or be appended to files, windows, or selec- tions in windows. Tools can use 1/0 routines supplied with the C and Paca1 libraries or use the Macintosh’s own file-system routines. The same calls are used regardless of the source or destination of the I/O, be it a file, window, or srlection. Tools are nor- mallynotawareofthesourceoftheirinput Figure 2. The dialogue box in the center of the screen provides a graphical interface to or the destination of their output; thissim- the Date command. Every command has a similar interface. Options are selected with plifies the design and implementation of the mouse, and context-sensitive help is available for each option. Once the parameters tools. and options have been selected, the command can be executed immediately or saved When a file and window have the same in a window name, 1/0 operations affect the window rather than the file because windows have priority over files. This is especially impor- to write scripts helps automate program rentlywith the shelland cachesother tools tant because the material in the window builds, one ofour major objectives.Scripts in memory between invocations. (such as source code) may contain recent are also one of the easiest ways to extend Applications. Macintosh applications, changes not yet saved in the file. This also the system because they allow new com- such as MacPaint and Hypercard, can also avoids the added complexity of providing mands that are combinations of existing be run from the shell. These applications separate mechanisms to access windows ones. take over the machine and are run inde- and files. Tools. These are programs that are pendently from the shell. When the user compiled and linked independently from quits the application, MPW Shell is imme- Graphical interfaces. We introduced the shell, but they run in an environment diately restarted. Special scripts (called graphical command interfaces in Version provided by the shell. , the Suspend and Resume) are executed 2.0 to help users manage the many options linker, and the Make utility are typical before the application islaunched andjust available in the MPW commands. While tools. Internally, tools are similar to pro- after the shell is restarted. They are often the command language provides a rea- grams that run under a Unix shell. The used to automatically save the shell’s state sonable way to automate a sequence of command that invoked a tool is passed to -including open windows, user-specified operations and to extend the develop- the tool as a vector of strings. Tools have menu items, aliases, and variables - and ment environment by adding both tools three files that are open by default: stan- restore the state after the shell is restarted. and scripts, remembering the various pa- dard input, standard output, and diagnos- rameters and options used by a host of Parameters to applications specify which tic output. commands is too burdensome. documents (files) to open or print. Be- Tools are the second major way to ex- To ease this burden, command names cause many programs developed under tend the system. Because tools take advan- are often English words. Options have the MPW are applications, testing is often tage of the windows provided by the shell, same meaning in several related tools. done by running the application from the they are relatively easy to write. Most Unix- (For example, in many tools the option -p shell. You can use scripts to build and exe- style utilities can be ported to MPW with causes progress information to be written cute applications automatically. little or no modification. to standard output). An on-line help facil- Because the Macintosh Plus originally Multifinder, which became available in ity displays brief summaries of the parame- lacked multitasking and provided only a late 1987,lets several applications run con- ters and options for each command. But single address space, creating the shell currently in fixed-memory partitions. even that is not always enough, so we support for tools was a major challenge. Windows for each application appear on added graphical interfaces to the com- Tools run concurrentlywith the shell, au- the screen; you switch applications by mands. tomaticallyperform 1/0 to windows using clicking the appropriate window. This lets Figure 2 shows the graphical interface the shell’s editing capabilities, and share MPWrun concurrentlywith other applica- for the Date command. The tool that im- the shell’s address space - yet they are tions, so you can run applications under plements these interfaces, called Com- written as independent programs. MPW development while you examine and mando, presentsa graphical interface to a supports a single tool running concur- modify their source code. command by interpreting a resource de-

62 IEEE Software rCreateMake Options I Program Name .-Program Type- ..i I Count 1 0Application i Source Files @Tool Files... 0DA 1 ...... scriptionstoredwith thecommand. Ithan- dles all user interactions and builds a com- CreateMake Count -Tool C0unt.c mand stringasparametersandoptionsare chosen with the mouse. The completed -Help* ( Cancel , command can then be passed to the shell Crcate a simple makcfile for building an application, tool, or desk acccssory . Thc makefilc is for usc by thc Build mcnu. for execution. You select file-name parameterswith the Macintosh's Standard File interface: You Figure The CreateMake script creates simple Make files for applications, tools, and scroll through a hierarchical list of files 3. desk accessories written in assembly language, C, Pascal, and Rez. The user enters the and select the files to be supplied as param- program name, selects it source files from a list displayed when the Files.. . option is eters. You select options with check boxes selected, and selects the program type. (nonexclusive options in a menu) and radio buttons (exclusive options, named menu item in the Build menu, Create after cat-radio pushbuttons).Context-sen- includes several example user-defined Build Commands.. . Figure 4 shows the sitive help is available for each parameter menus. . Build menu. Other items in the menu and option by clicking the parameter or Buildmenu.The Make tool is frequently build the program based on recent option with the mouse. All the commands used to automate program builds. Make changes, completely rebuild the program, supplied with MPW have graphical inter- takes as input a list of file dependencies and display the build and complete build faces, and you can add similar interfaces to (such as the dependence of object files on commands in awindow. Each Build menu your own scripts and tools. source files) and the shell commands item uses Make to create the list of build needed to satisfy these dependencies. It commands. You can use the Make file uses the dependencies and the modifica- Userdefied menus. MPW Shell pro- created by CreateMake, modify it, or tion datesoffiles to determine which com- vides an initial set of pull-down menu create a new Make file. mands must be executed to bring the pro- items. The shell directly executes many of The Build menu is composed of a series gram up to date. Because the shell these items, such as Cut, Copy, and Paste. of userdefined menu items, so it is both executes only one tool at a time, Make can- Other menu items, such as Open ... and optional and easily extended. In addition, not execute other commands directly. In- Print Window, execute commands and CreateMake is implemented as a script, stead, it writes the commands to standard thus may be implemented with both making it easy to modify for other lan- output. Asimple script, such scripts and tools. (An ellipsis at the end of as guages. The Build menu and CreateMake a menu item indicates that a dialogue will Make target > Makeout illustrate the system's extensibility: While appear, letting you specify additional in- Makeout Apple supplies these scripts, any user formation.) For example, the Print Win- could have created them. dow menu item executes the command can run Make, direct its output to file Makeout, and then execute the com- Print (PrintOptionst"(Active)" J mands generated by Make. Internals 22 "(Worksheet/" To provide tight integration among the Constructing the input to Make is diffi- shell, editor, and tools, we had to imple- thatruns the Printtool. (Shellvariablesare cult for new users and is tedious for expe- ment some services normally considered in braces. Using quotesallows spaces in file rienced users. MPW Version 2.0 includes a to be the operating system's responsibility. names. The symbol indicates that you script, called CreateMake, that creates a 22 For example, to share memory efficiently, are appending to diagnostic output. The simple Make file for programs written in symbol dcontinuesthe command onto the assembly language, C, Pascal, and Rez (a next line.) language for describing Macintosh re- You can create additional menu items by sources; resources are swappable data or associating a list of commands with the code). Parameters toCreateMake indicate name of a menu and the item in that the name of the program and its source menu. For example, the command files. An option indicates the type of pro- gram to construct: an application, tool, or AddMenu File Restart ' Shutdown -r' desk accessory. CreateMake uses these pa- adds the menu item Restart to the File rameters to construct Make input that menu. It executes the command specifies the commands needed to build Shutdown -r, which restarts the computer the program, including the appropriate Figure 4. The Build menu provide an easy (the -r option indicates restart). Userde- link options and a list of libraries based on way to build most programs. The Create fined menu items can be added to existing the languages used in the program. Figure Build Commands... menu item runs menus or be used to create new menus. 3 shows the graphical interface to CreateMake toconstwct a Make file forthe Keyboard equivalents can also be associ- CreateMake. program. The remaining items automati- ated with userdefined menu items. MPW CreateMake is executed by the first cally build the program using Make.

May 1988 63 I

Shell command interpreter

Language libraries

capabilities as C (such as standard input and standard output). I Editor’s menu management Sharedmemory. The Macintosh operat- I ing system was originally designed to run - one program at a time. An application’s Wlndow 1/0 system global data, stack, and heap occupied most of the availablememory. When it ter- Virtual edit memory minated, another application - usually Finder - would overlay the space oc- cupied by the application. Running a new File system program always implied a complete purge of the old program, regardless of the new program’s memory requirements. Figure 5. I10 organization. MPW Shell uses the standard language libraries for all its I/O. Some programs, notably Multifinder When the shell is reading from the consoledevice,thedata it receives may originate from and Switcher (which let multiple applica- several sources, including windows and menu items. tions share memory and.which let the user quickly switch among them), use a we had to implement our own code cach- console can also return text strings that memory-partitioning scheme that creates ing and garbage collection. have been associated with user-defined separate application area so more than menu items. one program can exist in memory. This Editor/shelt integration. Although they User-defined menu items are a good ex- scheme has the benefit of having well-de- are highly integrated at the user level, the ample of how the editor was designed to fined boundaries between applications shell and editor are conceptually two dis use Macintosh features to help users cus- and makes it relatively simple to clean up tinct programs that are only loosely tomize their environments. For example, memory after an application has termi- coupled. The shell is responsible for com- you can create command macros that can nated. But its major disadvantage is that mand processing, resource management, be invoked from the keyboard by combin- memoryiseasilyfragmented,~~amemory and memory management. The editor is ing the editor’s userdefined menu items request by an application often cannot be responsible for editing and 1/0 manage- with the facility that lets you associate any satisfied even though the space is available ment. key on the keyboard with any menu item. in another partition. Command processing in the shell is de- To maximize memory use, MPW Shell signed much like any tool. The command Tools. Workshop tools are closely pat- uses a shared-partition scheme where the interpreter reads a line of text from stan- terned after the programs that execute shell and tools share a common heap and dard input, processes the line, reads the from a Unix shell. They are compiled and stack (see Figure 6). When the shell starts next line of text to process, and so on until linked independently of the shell. Before a tool, it allocates a global area for the tool a terminating condition occurs. The com- a tool is executed, the shell sets up the in the common heap (which contains mand interpreter uses the standard C li- tool’s parameters and opens the three both code and data), adjusts the global brary routines for all 1/0 instead of ac- files, standard input, standardoutput, and register accordingly, seb up the tool’s in- cessing theeditor’sdatastructures directly diagnostic output. tersegmentjump table, and then calls the (see Figure 5). Using the standard 1/0 Because the Macintosh Plus lacks multi- tool. routines gives the shell the same flexibility tasking, the shell must explicitly give up The shell tracks some system resources as any other tool to read or write files, win- control to begin tool execution. The tool allocated to tools, such as files and dows, or selections in windows without ex- will retain control until it requiresaservice memory, to reclaim the resources when plicitly specifying the type of object for managed by the shell, such as window 1/0 the tool terminates. The shell tracks these which the I/O is intended. and tool-segment loading. After the shell resources by overriding several ROM MPW provides a simple, generic con- services the tool’s request, it returns con- operating-system routines. It monitors soledevice interface to the language li- trol to the tool. When the tool terminates, heap allocation by intercepting the braries. The console is an on-screen com- whether successfully or after an error, the memory-allocation routines and using a mand interface; in the simplest case, it is shell ensures that all the files opened by block- tagging scheme to differentiate like awindow-based teletype. By supplying the tool areclosedand thatanymemoryal- shell and tool blocks. By monitoring the a generic console-device interface to the located by the tool is reclaimed. appropriate file-system calls, the shell re- language libraries, the editor gives you You can write tools in any combination cords in ashell data structure the namesof control over where the console data origi- of the languages supported by MPU’: as- files opened by a tool and removes the nates. For example, in addition to return- sembly, C, and Pascal. We have developed name when the files are closed. The shell ing the contents of a window or the con- runtime library interfaces for assembly determines if a memory-manager or file- tents of the selection in a window. the language and Pascal to offer the same system call came from a tool (or from

64 IEEE Software High memory

Screen memory, drivers

ROM on behalf of a tool) by comparing Application jump table the current global context to the tool’s global context. Application parameters When a tool terminates, it returns to the Globals ---$ shell. The shell then cleans the heap by re- Application globals moving all tagged blocks. It also closes any Stack base _+ remaining files left open by the tool. To improve the time to reexecute a tool, the shell postpones closing the tool’s re- Application stack Old tool code segment source file and removing any of the tool’s Free memory resource blocks in memory (most notably, Old tool resource Stack pointer --+ I code segments). Instead, it marks these I Tool code seament 4 I memory blocks as relocatable and purge- I TOOI resource I able so the memory manager may later move the blocks around to consolidate free space or reclaim the space completely t if needed. The next time the tool is run, any resourcvs still in memory are used I Tool data without reloading them from disk. I In many cases, the code segments of sev- Window data eral tools can remain memory-resident Tool dala I simultaneously. However, when a tool’s Application heap Free memory memory requirements are large, the shell does its best to free up memory as needed. Shell code segment 2

Before starting a tool, the shell makes ~~ many of its own heap objects relocatable r Shell co;;;pment i and purgeable so they may be moved or I deleted as needed. As the heap fills up, the shell will dispose memory allocated by in- Syslem globals active tools and write the modified por- tions of all files opened as windows to its Low memory scratch file on disk. By sharing the shell’smemory this way, a , for example, that requires 1 Fire6. Memory organization. MPW Shell shares its stack with an executing tool. The Mbyte to run efficiently by itself will re- application heap is shared between the shell, the executing tool, and one or more previ- quire just alittle more than that 1 Mbyte to ously executed tools. run - including the space for the shell. This allocation strategy takes less memory than the total memory requirements to the new address is called, an intermediary console device, file device, and system dev- run the compiler in a separate partition ensures that the context is correct and ice. Each handler contains five standard where the maximum memory require- then calls the real routine as if it were a entries: read, write, close, ioctl, and ments of both the shell and compiler local call. On return, the intermediary re- faccess. At initialization, the editor re- would have to be met simultaneously. stores the context to the previous state. places the shell’s entire console handler Because both the shell and the tool have and the faccess and ioctl entries of the tile separate global environments, some form Window I/O. The editor supports win- handlerwith itsown exportedfunctions.A of context switch must occur during a call dow 1/0 at two levels: by overriding device tool’s device handlers are copied by its between the two environments (such as a handlers in the runtime libraries and by runtime libraries at initialization from the tOOl’ShbrdrieS calling some part ofwindow overriding the file system. Overriding the table of device handlers associated with I/O). We devised a context-switching sys- runtime libraries’ device handlersis neces- the shell. tem, called Export, to do this. A routine sary to give tools access to information, Tools can also use ROM calls for 1/0 and that may be called from another context such as the tab setting of a window, that still benefit from the window 1/0supplied can be registered via Export to provide the cannot be accessed through ROM rou- by the editor. By overriding the file system, automatic switching. Export works by re- tines. the editor can watch all ROM filesystem cording the proper context at the time of MPW runtime libraries’ device handlers calls and either process the call itself or let the export and returning a new address to closely resemble Unix device handlers. the ROM handle the call. be used for the exported routine. When There are three standard handlers: the For example, when a tool tries to open a

May 1988 65 file, the editoi-detects the call and searches PW was a product-development Our long-term objectivesare to increase its list ofwindows for one whose complete effort, not a research project. the levelofintegration in MPW. Each time path name matches the complete path MThe goal was to produce the best we have increased the level of integration, name specified. If there is no match, the possible product using well-understood we have been pleasantly surprised by unex- editor lets the file system handle the re- technology. The major challenge was to pected benefits. For example, combining quest. Ifawindowmatches the request, the design and implement such a system given the shell and editor languages makes the editor creates a data structure that will the limited hardware and system-software system easier to learn and letsyou use shell satisfy future I/O requests for thatwindow resources. We believe we have done so. But variables,command substitution,and con- and then returns a window-reference we intend to do more. trol constructs when editing scripts. number that is outside the domain of all Our short-term objectives are to add We are considering languageurien ted file-system reference numbers. source-code version control and source- editing, incremental compilation, and level symbolic debugging. The source- closer coupling between the editor, com- When a tool makes 1/0 requests other code control system will make it easier for pilers, and other tools. Expected benefits than opening a file, determining whether several people to work together on a coni- include an increase in system perfor- the request is for a window or file is done mon project. It will support all files related mance, easier navigation through source by testing whether the reference number to a project, notjust source code. In addi- code and documentation, and simpler in the request is a window-reference num- tion, projects may be nested in other proj- coordination ofmultiple filesand their de- ber ects, letting large projects be broken into pendencies. To extend the more conventional nu subunits. The symbolic debugger will The design of a fully integrated system tion of 1/0 redirection (such as in a Unix allow source-leveldebugging of programs supporting several languages is a signifi- environment) to include redirecting 1/0 written in any combination of MPW-sup cantchallenge.MPWisafirststepinmeet- to and from selections in windows, we ported languages. The debugger will run ing that challenge. Although there are al- needed a mechanism to differentiate the as an independent application under Mul- ready several systems with the level of name of a window (or file) and the name tifinder, where it will be used to debug integration we seek, such as Smalltalk and of the selected text in that window, so we both tools and applications. These two en- Gnome,.’we know of no system that is both use the special suffix .# to mean the selec- hancements should be completed this highly integrated and provides equal sup tion in the file. summer. port for multiple languages. .:.

Acknowledgments We thank Bud Tribble, who gave us the orig- inal charter to develop MPW, Jim Thomas, who has managed the engineering effort since eai-ly 1986, and Daniel Smith, a key designer and implementerwho really should have been a coauthor. ‘4 hard-working team of IS engi- neers designed aiid built the tools and lan- guage$ includedwith MPM’; another IS writers and testcrs contributed theii- talents. Finally, our fans and critics both at Apple and in the Macintosh development community continu- ally encourage us to try harder and find a bet- ter way.

Richard J. Meyers is a principal engineer at Jeff W. Parrish is a staffenginerr at Apple Com- References Apple Computer. He implemented Smalltalk- puter. He designed and implemented Mac- iMnrintosh I+oLgrnmmrri Workshop Kp/brpnrp, 80 on Apple’s Lisa computer and has coli- Works on Apple’s I.isa computer and has con- 2, Version Apple Programmer’s and tributed tothe system softwareon both theLisa tributed to the system software on both the Lisa Developer’sAssn., Reiiton, Wash., 1987. aiid Macintosh computers. He served as the and Macintosh computers. He is engineering Systnn V InlnjkQI)~filiitzon, ISSUP 2, Vol. 2, engineering manager for the development manager for the development of the Macin- ATTg-T, Murray Hill, NJ., 1986. and initial release of the Macintosh Program- tosh Programmer’s Workshop shell enviroii- W. Joy, “Introduction to the <; Shell,” Unix mer’s Workshop. ment. C’swi Su@lmwntq Ilontmmts, 4.2 Lkh~lq Meyers received a BA summa cum laude in Parrish received a BA and MS in physics and So/hiinr~Ihstn‘/nction, Univ. of Oalifornia, physics and mathematics from Hope College an MSin coinputer science from the University Berkeley, Calif., Nov. 1980. in Michigan and an MS in electrical engi- of Oregon. D.B. Garlan and P.1.. Miller, “Gnome:An In- neering and computer science from the Uni- troductory Programming Environment versity of California at Berkeley. Based on a Family of Structure Edtors,” Proc. %JhilnrQEng Symp. Prnrtirnl .%Ihum- Dpuelqbmm! En~nrmm~nls,ACM. New York, Address questions about this article to the authors at Apple Computer, 20525 Mariani Ave., MS 1984. 27-E, Cupertino, CA95014.

66 IEEE Software