Jump to content

Teaching compiler

From Encyc

During the period when computer students used punch cards, to "submit" programs to a computer running in "batch mode" several universities developed teaching compilers, for language like Fortran, COBOL and PL/1.

The compilers manufacturers like IBM released had drawbacks when used for teaching students:

  1. Their error messages were cryptic -- unhelpful for students.
  2. They did a lot of work to generate really efficient code -- pointless for students, because, once their simple program had been debugged, it would only be run, a few times. It might only be run once.
  3. During the days of batch programming, after a program had been successfully compiled, it required the user to use a linkage loader or linker, to link in standard library functions. And these linkers were themselves complicated to use.

Since a teaching compiler did no work optimizing the compiled code to be efficient it could run more quickly. The teaching compiler could itself include all the usual standard libraries a student program would be likely to use, so no separate link step was required. If the student's program had compiled successfully, the teaching compiler could execute it itself.

The teaching compiler could recognize common errors, and give a simpler, clearer error report, like "Unpaired brackets on line 7, near 'Printf('". PL/C, and SP/K, two teaching compilers for students learning PL/1, would make minor corrections to the student's programs. For example, every PL/1 statement was supposed to end with a semicolon. If a statement was correct, except it lacked a semicolon, the compiler would warn the student, and add that semicolon.

WATFOR, a teaching compiler for Fortran students, may have been the most widely used teaching compiler.