I got my first academic job in February 1979 as a Casual Tutor in the Department of Computer Science at the University of Queensland in Brisbane, Australia. "Casual Tutor" meant that I didn't have a contract, and "Tutor" means something like a Teaching Assistant or TA in the US. I was at the start of the third year of a four-year Bachelor of Science degree, but apparently they had an urgent need for instructors because enrolment in Computer Science was going up exponentially (the Glory Years for CS). I was dumped into teaching a lab section of Fortran for Engineers, in which I was expected to lecture and set programming assignments. I'd like to think that I did a good job, but I was young and callow. Fortunately nobody seemed to notice. I was in this job for 2 years, from February 1979 to November 1980 (the academic year in Australia is the same as the calendar year).
Somewhere in that two year period I was also Tutor at St. John's College, a residential college at the University of Queensland. My job was to tutor the Computer Science students who lived there. I remember that we met in a pleasant wood-lined room that literally reeked of wood polish and history. There were usually only one or two students in attendance, so I was able to give them individual attention. I remember a couple of Chinese girls in particular. This was when communist China was first beginning to open up to the West, so they were a highly novel presence on campus with their drab utilitarian clothing and hairstyle, ubiquitous bicycles of ancient vintage, and "I will try harder" mottos scrawled in the margins of their notes like something out of a George Orwell novel.
In February 1981, after my graduation with a Bachelor of Science degree, I signed up as a PhD student and I was promoted to Tutor Group 2, which means that I had a contract. I remember being a lab TA for the beginning programming class in Pascal. One of the students in that class was, I am pretty sure, my former 7th grade teacher and Queensland cricketer, Ian Seib. He didn't recognize me and I was too shy to approach him.
I remember carrying around the source code for the Pascal compiler used in that class (which was written in Pascal) so that I could quickly answer even the most obscure question by looking at the code. This was a large, heavy, 4-inch thick block of 15x10 inch tractor-fed paper. There was one time when it was very useful. That was when I passed from being just an ordinary geek to übergeek status. A student brought me the following bug. He wanted to output the character "=", which would look like this on a piece of paper:
While his code said was:
What it output was this:
Think about it for a second before I explain.
The first hint was that the student had obviously gotten the quote character wrong. In Pascal the quote character is the single quote, which means that he should have written:
That much was easy to spot. At this point the student was pretty happy because he knew that with two keystrokes he could fix his problem and get an A for his program, although he was mildly curious as to why his code output TRUE instead of getting a compile-time error. TRUE is one of the things you get when printing a Boolean variable, but why do we see it here? My geekhood was challenged. There were girls in the audience too. I thunked the compiler code onto the table.
Looking at the lexical analyzer, I quickly learned that the double-quote character was used to start a number in hexadecimal. These days we would use #FFFFFFFF in html or 0xFFFFFFFF in C for the hex version of the base-10 number 232-1, but that compiler wanted was something like "FFFFFFFF. This was totally undocumented, I wouldn't have found it out if I didn't have the source code for the compiler. Now I was getting somewhere. But again, it still should have given him a compile-time error because there were no digits after the double-quotes. There was clearly more to this than meets the eye.
Another quick dive into the code located the loop that input hexadecimal digits after seeing the double-quotes character. Sure enough, it looked like this:
num := 0;
while c in ['0'..'9'] do
num := num*10 + c - '0';
Got it. That while loop should have been a repeat loop. Since the character after the double-quotes was not a digit, the compiler skipped the body of the while-loop and came out of it with the variable num still having value zero. The compiler was acting as if the code had said:
That is, it was generated code for printing the Boolean expression "Does hex zero equal hex zero?" Of course it printed TRUE. Problem solved.
From July 1 to August 31, 1981 I worked as Les Goldschlager's Research Assistant, during which time we did the research for the paper that was eventually published as "On the Construction of Parallel Computers from Various Bases of Boolean Functions".