These days, most compilers and interpreters seem to provide the following in diagnostics:
- A description of the problem
- The name of the source file
- A line number
- A relevant position within the line
- The text of the line
- An indication of where the relevant position is in the line's text
In earlier systems, diagnostic printouts often consisted, from what I can tell, of a message or error code and the text of an offending card or line. All that is really missing is the precise indication of where on the card or line the problem was found.
I was somewhat surprised to see that the Pascal P-series of compilers, as far back as P2 from 1974, provided almost everything that modern systems do:
- An error code
- A line number
- The text of the line (albeit as a side effect of listing the source code)
- An indication of where the relevant position is in the line's text
(See the routines error
and endofline
. The file
name was implicit, since only one file was ever being compiled.)
Did any systems predating P2 do this (or better, e.g. by indicating a range of
positions as in GCC and Clang)? LISP 1.5 seems to have been close, having a function error1
that was designed for this exact purpose (printing a line of text along with a “cursor”),
although the interpreter never actually used it!