with a Pascal Architect
Bill Catambay, Pascal Central Editor
Interview with a Pascal Architect
Editorial Note by Bill Catambay
A long time proponent of the Pascal programming language, and a big fan of the OpenVMS operating system, I decided it was time to learn what I could from Compaq's John Reagan, the architect of Compaq Pascal for OpenVMS. John provides some great insight into the art of compiler making which should be of interest to software developers everywhere, regardless of your preferred programming language or platform. The interview was performed via e-mail.
|Date of Interview:||2-18-00|
Compaq Pascal Compiler Project Leader,
Compaq Computer Corporation
|Subject:||Compaq Pascal Compiler|
Q: Which compilers are you involved with development, and to what degree?
Q: How long have you been working on compilers?
At this point in time, I think I have the longest tenure of anybody on any compiler here at Compaq. Nobody else has been on a single compiler for 17 years except me. I also have the distinction that I've never moved cubicles in my 17 years!
I have also represented Digital (now Compaq) on the X3J9 Pascal Standards Committee. I am the secretary of the committee and the chairman of the Maintenance Task Group, the subgroup of the committee designated to track and correct problems in the published standards. I contributed many pieces to the Extended Pascal standard and the Object-Oriented Report.
Q: What was your background prior to working on DEC compilers?
After graduation, I worked for 2 years at the Oak Ridge National Laboratory in Oak Ridge, TN doing computer support for fusion energy research. At Oak Ridge, I was introduced to PDP-8s, PDP-11s, PDP-10s, and VAX hardware as well as RSX, TOPS-10, and VMS. As part of a port of some F77 code from a PDP-11 to a VAX, I asked for permission to rewrite some code from Fortran to Pascal in an attempt to improve the code and diagnose long outstanding problems. Pascal's strong typing and run-time checking allowed me to find the logic and programming errors in a short time. It was during this time that I was exposed to VAX Pascal and began my long history with Pascal.
While at Oak Ridge, I attended my first DECUS symposium in St. Louis in 1983. I met with the current VAX Pascal project leader to introduce myself and to discuss bugs that I had found. During a conversation, I mentioned that I was interested in compilers and had taken a "traditional" compiler writing course back at Purdue. One thing led to another and in just a few months, I found myself moving from Tennessee to New Hampshire.
Q: Are there any books you recommend for designing compilers?
- Data Structures and Algorithms by Aho, Hopcroft, and Ullman
- Algorithms + Data Structures = Programs by Niklaus Wirth (out of print)
- Software Defect Removal by Robert Dunn (out of print)
- Compiler Construction for Digital Computers by David Gries (out of print)
- Building an Optimizing Compiler by Robert Morgan
Very few people come into the world of compilers knowing compilers. Most compiler courses taught in university are "toy" compilers. While useful, they have to be limited to fit within the course timeframe and resources available. "Industrial strength" compilers are much larger and more complicated. For example, Compaq Pascal is comprised of 192 different modules with a total of 457,000 lines (and doesn't include the common optimizer and code generator for the Alpha machines).
When I interview people to work on compilers, I want to know if they can think and solve problems. A compiler is nothing more than a long sequence of table lookups, tree inserts, sorts, linked-list removals, etc.. It's these basic techniques, in the right order (that's the hard part), that make up a compiler.
Q: If you could name the top three issues vital to a successful compiler tool, what would they be?
Q: You've worked with both the C and Pascal compilers, so can you tell us which builds the more efficient executables, and why?
The strong-typing of Pascal makes is easier for an optimizer to understand the program and provide better generated code. That isn't to say it can't be done for C, but it just takes more work. In the early days of OpenVMS Alpha and the previous state of the code generator, it was easy to write Pascal programs that would generate better code than their C equivalents. In the past few years, the C compiler folks down the hall and the optimizer team have worked very hard to get good code from the C programs as well. I'd guess that today the code for both the Pascal and C versions of an algorithm are similar.
The point is that Pascal can produce efficient code and provide the additional benefit of strong-typing and optional run-time checks. You need not switch from Pascal to C just to get performance (at least on Compaq's OpenVMS or Tru64 UNIX platforms where our compiler runs).
Q: What do you see in the future for Compaq Pascal?
For people writing new applications, I would still ask them to consider Pascal. There are many reasons why it still might be the best language to use.
I see Compaq Pascal remaining to be a strong compiler with support for new machines, new versions of the operating system, and new versions of the optimizer/code generator. As for new features, we certainly will add as many as we can given the resources we have available. Just let us know what you'd like to see and perhaps we can do it. As for new targets, I personally would like to see Compaq Pascal ported to other targets (such as Windows NT and Windows 2000). However, it takes a critical mass of support to get that to happen. Customer feedback is very important to us.
There are still countless Pascal users in the field and I would like to thank each of them for their support (after all, it pays my salary).
End of Interview
You can visit the Compaq Pascal web page at http://www.openvms.digital.com/commercial/pascal/pascal_index.html and you can contact John directly at John.Reagan@compaq.com.