Programming

On PASCAL

PASCAL was designed in 1969 by the Swiss computer scientist Niklaus Wirth and released in 1970. Wirth was a PhD student at Berkeley in the early 1960s, at the same time Ken Thompson, co-inventor of Unix and author of the Go programming language was in school there. It’s not uncommon for a language to kick around for a decade or more gathering steam. In 1983, PASCAL got legit and was standardized, in ISO 7185. The next year Wirth would win the 1984 Turing Award. Perhaps he listened to When Doves Cry when he heard. 

PASCAL is named after Blaise Pascal, the French Philosopher and Mathemetician. PASCAL was built to teach students to program, but as with many tools students learn on, it grew in popularity as those students graduated from college throughout the 1970s and 1980s. I learned PASCAL in high school computer science in 1992. Yes, Kris Kross was making you Jump and Billy Ray Cyrus was singing Achy Breaky Heart the same year his daughter was born.  I learned my first if, then, else, case, and while statements in PASCAL. 

PASCAL is a procedural programming language that supports structured data structures and structured programming.At the time I would write programs on notebook paper and type them in next time I had a chance to play with a computer. I also learned enumerations, pointers, type definitions, and sets. PASCAL also gave me my first exposure to integers, real numbers, chars, and booleans. I can still remember writing the word program at the top of a piece of paper, followed by a word to describe the program I was about to write. Then writing begin and end. Never forgetting the period after the end of course. The structures were simple. Instead of echo you would simply use the word write to write text to the screen, followed by hello world in parenthesis wrapped in single quotes. After all, there are special characters if you use a comma and an exclamation point in hello word. I also clearly remember wrapping my comments in {} because if you didn’t comment what you did it was assumed you stole your code from Byte managize. I also remember making my first procedure and how there was a difference between procedures and functions. The code was simple and readable.  Later I would use AmigaPascal and hate life. 

PASCAL eventually branched out into a number of versions including Visual PASCAL, Instant PASCAL, and Turbo PASCAL. There are still live variants including the freepascal compiler available at freepascal.org. PASCAL was the dominant language used in the early days of both Apple and Microsoft. So much so that most of the original Apple software was written in PASCAL, including Desk Accessories, which would later become Extensions. Perhaps the first awesome computer was the Apple II, where PASCAL was all over the place. Because developers knew PASCAL, it ended up being the main high-level language for the Lisa and then the Mac. In fact, some of the original Mac OS was hand-translated to assembly language from PASCAL. PASCAL wasn’t just for parts of the operating system. It was also used for a number of popular early programs, including Photoshop 1.

PASCAL became object-oriented first with Lisa Pascal, Classcal then with Object PASCAL in 1985. That year Apple released MacApp, which was an object oriented API for the classic Mac Operating system. Apple stuck with Object PASCAL until 1991, when it transitioned to C++ for System 7. MacApp would go on to burn a fiery death when Apple acquired NeXT. 

PASCAL wasn’t just for Apple. Universities all over the world were using PASCAL, including the University of California San Diego, which introduced UCSD Pascal, which was a branch of Pascal-P2. UCSD p-System was one of three operating systems you could run on the original IBM Personal Computer. Microsoft would then implement the Object Pascal compiler, which caught on with developers that wanted to get more than what BASIC offered. Around this time, people were actually making real money and BORLAND released Turbo Pascal, making it cheap to grab big marketshare. Object PASCAL also begat Delphi, still used to write programs by people who refuse to change today. 

Wirth himself was fascinating. He not only wrote The Pascal User Manual and Report but also went on to write an article called Program Development by Stepwise Refinement, about how to teach programming and something all computer science teachers and aficionados should read. His book Algorithms + Data Structures = Programs helped shape how I think of computers even today, because it turns out the more things change the more they stay the same. 

He also coined Wirth’s law, which states that software is getting slower more rapidly than hardware becomes faster. Every time I see a beachball or hourglass on my laptop I think of that. This could be initially from his work on building a compiler into the ALGOL language, which resulted in ALGOL W and watching that turn into the swamp thing that was ALGOL X and then ALGOL 68, which became so complex and difficult that writing good compilers became out of the question. Due to this ALGOL languished, making room for PASCAL in the hearts of early programmers. 

While PASCAL is his most substantial contribution to computing, he also designed Algol, Modula and Oberon, and did two sabbaticals at Xerox PARC,  the first from 1976–1977 and the second from 1984–1985. Here, he would have been exposed to a graphical operating system  and the mouse, before Apple popularized them. 

Perhaps one of the most enduring legacies of PACAL though, is A. A is a computer programming language that was originally written as a hoax. Dennis Richie had just finished reading a National Lampoon parody of the Lord of the Rings called “Bored of the Rings.” Unix as a parody of Multics mean to “to be as complex and cryptic as possible to maximize casual users’ frustration levels” Ken Thompson would go on to describe A this way “Dennis and Brian worked on a warped version of Pascal, called ‘A’. ‘A’ looked a lot like Pascal, but elevated the notion of the direct memory address (which Wirth had banished) to the central concept of the language. This was Dennis’s contribution, and he in fact coined the term “pointer” as an innocuous sounding name for a truly malevolent construct.” Anyone who has gotten a null pointer exception should know that their pain is intentional. The prank evolved into B and then C. By the way, the hoax is a hoax. But there is a little truth to every lie. The truth here is that in many ways, C is the anti-pascal. I blame Berkeley in the 60s. But not for wasting your time with the hoax. For that I blame me. I mean, first I blame the creators of Unix, then me.