Jim Welsh

– Queen’s University Belfast
– Emerate Professor at The University of Queensland Brisbane, School of Information Technology and Electrical Engineering

Jim Welsh is well-known for the bestselling book “Introduction in Pascal”, several editions appeared, followed by “Introduction to Modula-2”.
Also he and his team worked on porting the CDC6000 Pascal compiler from ETH to Belfast on the ICL1900. At first this was the MK1 compiler, a second with improved error handling was the MK2, see below for the sopurces of MK2 and the article “Two 1900 compilers”.

After several years of improving that compiler, a completely new compiler for the ICL1900 and ICL2900 was written by the team in Belfast: Pascal Plus (see the manual below) that enhanced standard Pascal with modularity and concurrency.

Being involved with the standardization and Validation efforts, Jim Welsh, with Atholl Hay, developed the “A Model Implementation of Standard Pascal”, a fully validated Standard Pascal (ISO7185) compiler. Sources are available, it requires a fully standard ISO7185 Pascal compiler to compile. Book and sources below.

Articles by Jim Welsh (and colleagues)

Books by Jim Welsh on my bookshelf

Introduction to Pascal Third Edition
Jim Welsh, John Elder
Introduction to Pascal, Second Edition
Jim Welsh, John Elder
Introduction to Modula-2
Jim Welsh, John Elder
Structured System Programming
Jim welsh, Michael McKeag

A structured Compiler (Mini Pascal)
A structured Operating System
Grammar of Mini pascal, the compiler in the book
Sequential program structures
Jim welsh, John Elder, David Bustard
A Model Implementation of Standard Pascal (reconstructed book from sources)
Jim Welsh, Atholl Hay
Sources of Model Compiler
Pascal Plus user manual, David Bustard
1900 Pascal User’s Guide,
Version 2, August 1977

Sources of 1900 Pascal Compiler MK 2

As explained in the next Summary, the CDC compiler was ported in a number of steps to the 1900 computer.

Not all sources survived time. Here are the sources of the 2A version, a further developed ETH type compiler. Still recursive descent down like the ETH ones. Compiler source, post-mortem dump source, and ICL 1900 runtime assembler source

This compiler differs of course in the code generation to ICL 1900 machine code.

    (****************************************************
      *                                                  *
      *     1900  PASCAL COMPILER   MK  2                *
      *     -----------------------------                *
      *                                                  *
      *     AUTHORS :  J WELSH                           *
      *                C QUINN                           *
      *                K MCSHANE                         *
      *                                                  *
      *                DEPARTMENT OF COMPUTER SCIENCE    *
      *                QUEEN'S UNIVERSITY                *
      *                BELFAST                           *
      *                                                  *
      *     FROM THE ETH ZURICH COMPILER                 *
      *     FOR  CDC 6000  BY U AMMANN                   *
      *                                                  *
      *     POSTMORTEM DIAGNOSTICS AND OPTION HANDLING   *
      *         BY D.A.WATT AND W.FINDLAY                *
      *         DEPARTMENT OF COMPUTING SCIENCE          *
      *         THE UNIVERSITY OF GLASGOW                *
      *         SCOTLAND                                 *
      *                                                  *
      ****************************************************)
(*
         THE COMPILER WAS DEVELOPED IN 5 STAGES
      BY "STEPWISE ENRICHMENT"  AS FOLLOWS

      STAGE 1  SOURCE LISTING GENERATION AND
               LEXICAL ANALYSIS

      STAGE 2  SYNTAX ANALYSIS AND
               SYNTACTIC ERROR RECOVERY

      STAGE 3  SEMANTIC ANALYSIS AND
               SEMANTIC ERROR RECOVERY

      STAGE 4  OBJECT PROGRAM GENERATION

      STAGE 5  POSTMORTEM DIAGNOSTICS AND USER OPTION HANDLING .

                 * * * * * * * *

                                                    *)

Summary of A Pascal Compiler for ICL 1900 Series Computers

J. Welsh and C. Quinn, Software–Practice and Experience, Vol. 2, 73–77 (1972).

Welsh and Quinn did the work in 1971, their paper appeared in 1972.
Wirth also remembers the project in Recollections about the Development of Pascal

1. The source of the ETH CDC6000 Pascal compiler was to be transported to Belfast

2. Rip out the code generation sections and replace them with new sections that would generate ICL 1900 machine code
It is reported that these three areas of code generation took them a total of six person months.
Vital to Welsh and Quinn’s engineering approach was  for every construct that their new code generator could produce machine code for, they wrote one or more test programs and recorded the machine code text that they expected to be the results of compilation.

3. An ICL 1900 emulator would be written in Pascal
Only 30 of the ICL 1900 instructions could be generated by the paper compiler, and so only that subset were emulated, together with 14 run-time support routines. This took them one-person month. No testing was possible at this time.  H. Johnston is acknowledged as helping to write the emulator.

4. The new compiler and emulator would be hand carried (by Welsh and Quinn) to ETH Zurich to be compiled and tested
Wirth reports  that Welsh and Quinn had some trouble explaining to Swiss customs what punched cards were.
The main reason for the slippage to eight days of work was the incompatible character encoding between the two machines and their operating systems. This took two days to resolve before work could really start. Welsh and Quinn, and later Wirth, don’t say how it was resolved. One of the main issues was that the designers of the CDC system, in their wisdom, had chosen an amazing convention for end-of-line/record: on a CDC system two consecutive colon characters :: meant end-of-line, on the stated grounds that no one would write these characters normally! When the CDC card reader was reading the cards produced in Belfast it would often just stop as it had detected what it thought was end-of-record/file.

5. The ICL 1900 emulator would be tested and debugged on the CDC 6000. This took just three compile/execute runs to fully debug.

6. The Pascal/1900 compiler would be tested and debugged on the CDC 6000 computer using the 1900 machine emulator

A few interesting statistics are reported in the paper:
– After some syntax errors were removed, eight compile/execute steps were needed for the new compiler to compile all the test programs and produce the expected results.
– Thirty-one errors were detected by this process and easily corrected.
– In three more compile/execute runs, the new compiler could compile itself, generating a machine code binary file that could be plugged into the ICL 1900 emulator.
– In three compile/execute/emulate runs, the new compiler, under emulation, successfully compiled all the test programs, generating identical code.
– A single troublesome error remained: sometimes the compiler’s symbol table became corrupted. This proved hard to debug/fix under emulation and the decision was made to live with it and do the repair back in Belfast.

7. The Pascal/1900 compiler (binary and source) would be hand carried back to Belfast
The remaining error was quickly found back in Belfast and a patch applied to the binary to fix it. After compiling itself one more time, the patched binary could be abandoned and a working self-compiling Pascal/1900 compiler was available. Thereafter the compiler ran correctly and compiled itself, generating a code file which was identical, word for word, with its own. No further errors have since been detected.

[1] J. Welsh and C. Quinn, A Pascal Compiler for ICL 1900 Series Computers, Software–Practice and Experience, Vol. 2, 73–77 (1972).

THE DESIGN, IMPLEMENTATION AND APPLICATION OF LANGUAGES FOR DISTRIBUTED COMPUTING
DR D W BUSTARD and DR J ELDEROct 79 – July 83
The programming language Pascal Plus has emerged from refinement of a number of experimental notations developed for large-scale sequential and concurrent applications in the early 1970s. The language can be used to construct simulation models for any concurrent system and to implement such systems on either single processors, or multiprocessors with shared memory. The language is also useful for general purpose programming as it supports Pascal as a sub-set.

The main purpose of this project, together with a related development contract [3], is to make Pascal Plus widely available as a tool to aid research in all areas of computing. This entails the development of a portable compiler kit and specific high quality compilers for three of the leading main frames in UK universities (DEC, CDC and IBM).

All four systems have recently been aligned with the ISO Pascal Standard and both the portable and CDC systems are available for distribution. The development of the IBM and DEC compilers will be completed shortly as part of a new project.

References
1. J.Welsh and D.W.Bustard, Pascal Plus – Another Language for Modular Programming, in Software – Practice and Experience. Vol. 9, pp 947-957, 1979.

2. D.W.Bustard and J.Welsh., A Tutorial Guide to Pascal Plus, Department of Computer Science, Queen’s University, Belfast, 1982.

3. J.Welsh and D.W.Bustard, Portable Pascal Plus, in Proceedings of Pascal Experiences Conference. Gothenburg, Sweden, June 1980.

DR D W BUSTARD
PORTABLE PASCAL PLUS COMPILER
Nov 78 – Sept 84
Background
The objective of this project, which is funded through the EMR (q.v.) Contract mechanism, is to produce a compiler-interpreter system to allow Pascal Plus to be easily implemented on a variety of computers.

Achievements
A pre-release version of the portable-plus system was completed in 1980 and has still been installed on a range of different processors including LSI/PDP 11 s (running RT-11 and RSX-11), Vax (running VMS), Z80 (running CP/M) and Motorola 68000.

Experience gained from this work led to the production of a revised system which is now available for distribution. In the new system Pascal-plus is aligned with the ISO Pascal Standard, keeping the full Pascal language as a pure sub-set [2]. The alignment produced a significant expansion in the size of the compiler which was counter-acted by splitting it into two passes. Also for ease of portability the compiler is now coded in standard Pascal rather than Pascal-plus.

Enhancements due for release in December 1983 include a model p-code to assembly language translator [3][4] and a program development tool that assists with both the preparation of a program text and the detection and correction of compilation and logical errors [5].

References
1. J.Welsh and D.W.Bustard, Portable Pascal-plus, in Proceedings of Pascal Experiences Conference, Gothenburg, Sweden, June 1980.

2. D.W.Bustard and J.Welsh, A Tutorial Guide to Pascal-plus, Department of Computer Science, Queen’s University, Belfast, 1982.

3. R.Orr, A Naive Pascal-plus P-code to Assembly Language Translator, Department of Computer Science, Queen’s University, Belfast, 1982.

4. A.Rammasubu, A Study of the Optimisation of Portable Object Code, MSc Dissertation, Department of Computer Science, Queens’s University, Belfast, 1982.

5. R.M.S.Young, A Pascal-plus Compiler for an Interactive Environment, MSc Dissertation, Department of Computer Science, Queen’s University, Belfast, 1981.