The Macintosh Programmer's Workshop
Total Page:16
File Type:pdf, Size:1020Kb
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.