The Long View
The Long View
MacPascal and Think Technologies
Today it’s hard to imagine how daunting the original Macintosh API was for programmers, especially compared to the complexity of the cocoa programming environment. But most programmers were used to the extremely sparse world of the text terminal (glass TTY), in which they had to learn only how to read and write text on the terminal, and read and write data to files. If you had a Commodore 64 or Apple II you might know something about bitmapped graphics, but learning to draw on the screen was basically about learning the hardware, not about operating a complicated set of software libraries. Some programming languages had libraries with subroutines for communicating with terminals. For example, in Pascal, there was writeln (which would write a line to the terminal) and readln (which would read).
Another thing that may seem odd is the popularity of the Pascal language. Through the 1960’s and most of the 1970’s, FORTRAN IV was the most commonly used high level programming language, and was the language taught to scientists and engineers in school. FORTRAN IV was not a stack-based language. Subroutines saved their return addresses, local variables and parameters in statically allocated data structures called activation records, so FORTRAN IV code was non-reentrant, and recursive programming was not practical. Even though much good work was (and continued to be) done with the language, modern programming thought had turned away from the FORTRAN design. The new way of programming was embodied in the Algol-60 and Algol-68 specifications. I say specifications, because these languages were designed without too much concern for implementation. They were complex and powerful computer languages. It was pretty hard to write a compiler that could handle all the complexities of programs written in the full form of the language. It was also complicated for programmers. Niklaus Wirth was a computer scientist at Stanford University working on languages and compilers. After the Algol-60 specification was released, he became interested in simpler, easier to learn and easier to implement Algol-like languages. He invented several such languages, including Pascal. In 1970, Wirth produced a Pascal compiler written entirely in Pascal. Pascal implementations started appearing in the late 1970’s, most notably the highly-portable UCSD Pascal system that was released in 1978.
In 1979, Apple offered a Pascal system for the Apple II, and one was also offered for the ill-fated Apple III, released in 1980 as the successor of the Apple II. Pascal was the coolest language to know in the early 1980’s, and it became the official language of both the Lisa and the Macintosh. Lisa software, including the operating system, were mostly written in Pascal, and the Lisa Programming Workshop was designed for Pascal programming. The Macintosh operating system was largely written in assembly language (to optimize for memory space), but its functions were intended to be called from Pascal.
Maybe I should say something about BASIC. BASIC was a popular language in the microcomputer world. It was a FORTRAN-like language with the same problems as FORTRAN. But it was interpreted, not compiled. This sounds like a bad thing, because interpreters are slow. But it was a good thing, because debugging was greatly enhanced in an interpreter. You could single-step through a BASIC program to see where an error occurred. Of course, (Microsoft) BASIC was famously used with the Apple II, and a version became available for the Mac in the summer following the January 1984 release of the Macintosh. But it was useless. It was an okay BASIC, but it treated the Macintosh like a terminal. Nobody wanted to program the Macintosh that way. About a year later, Microsoft produced a much better version 2 of Mac Basic. But I don’t know who would have cared. The Mac API was designed to be called from Pascal, and Inside Macintosh assumed that was the language you were using. Things were hard enough when you used the language described in the documentation.
MacPascal
Because in MacPascal, your program was running within the context of another program (the interpreter), you did not have to create resources, initialize menus and windows, or use the Macintosh memory manager. Most of the complexities of the Macintosh Toolbox were removed, at least at first. You could still access those parts of the Toolbox, but you didn’t have to do it all at once. You could learn one thing at a time. In particular, MacPascal was a testbed for learning Quickdraw graphics. Quickdraw procedures that draw on the screen, like LineTo and FrameRect, would immediately be directed to the Drawing window. Likewise, the standard terminal text functions in Pascal (like writeln) would immediately put text in the Text window. This meant that standard Pascal programs you might have found in a textbook on programming in Pascal would still work and do sensible things. MacPascal was a set of training wheels, simultaneously for learning Pascal, and for learning the Macintosh API. And it did this by applying user interface tricks nobody had ever seen before.
One bad thing about MacPascal: It was copy protected. You couldn’t copy it to your hard disk. You had to have the original floppy disk mounted. This was fixed in version 2.
The Integrated Development Environment - Lightspeed Pascal
THINK Pascal, Object Pascal, and THINK C
All things cool become uncool eventually, and once everybody knew Pascal well, it quit being the language we wanted to learn. Now we wanted to program in C. Pascal and C are very close relatives. They are both simplified Algol-like languages. They look different, but if you can write a Pascal compiler, you can write one for C. THINK Pascal led to THINK C, which had almost all the same great features. Apple also changed MacApp from Object Pascal to C++, and THINK C incorporated C++ and the new MacApp. THINK was ultimately bought by Symantec, who continued the C++ product line for a while. The end came with the switch to PowerPC, when Metrowerks Code Warrior outpaced Symantec C and won its market.
The Modern IDE
MacPascal-THINK was the source of the modern development environment. This was 1986. The first usable version of Windows was still 9 years away. DOS was effectively a text-only world, and DOS programming tools were crude stone-age things. Unix programmers were writing their source code in vi and compiling it on the command line. Hmm. I guess a lot of them still do. Much later, Windows and (some of the) unix world would adopt the same programmer’s user interface as THINK.
The same way that the Macintosh invented the user interface for computer users, THINK Technologies invented the user interface for programmers. The project file, source level debugger, variable browser, these are the user-illusion that programmers expect today. They are really the creation of the THINK programmers, Terry Lucas, Peter Maruhnic, Jon Hueras, Steven Stein, Wynn Newhouse, Rick Tompkins, and designers Andrew Singer, Mel Conway, and Jon Hueras.
-- BG (basalgangster@macGUI.com)
Saturday, March 20, 2010