Cambridge Supervisor : Planning Document 8
The hidden costs of line-numbering systems

This note discusses the techniques which would need to be adopted were we to implement facilities like those of CTSS for dealing with line-numbered files.

(1) Producing the numbers

It is cardinal to the approach that the system produces a fresh number for each line of input typed.

There are two ways of doing this:

  1. to make it a low-level reflex of the multiplexer software, which would output a character string and insert it in the input buffer as if it had been read. Note that this involves work in changing the status of the line, etc. This approach seems objectionable in that the basic multiplexer control software (the actual interrupt routines) are both more complex and not content free.
  2. to arrange that each line of user-typed input is read by a system object program which then adds the relevant line number characters, outputs the number of the next line, and passes the line it now has to the file. This is objectionable on grounds of efficiency. It invokes an object-program activation per line, and goes directly counter to our philosophy of making plain input operations cheap to the system. I believe that this is the fundamental reason why input is not cheap enough in CTSS.

(2) Editing.

The simultaneous filing-editing process involves passing all of the 'manual' line numbers to a temporary file, sorting it on completion, and then doing a merge operation. This is not cheap because it involves both a sort and a pass of the complete file. Now all editing involves a pass of a file, and perhaps this point is not significant. It should, however, be noted that in encouraging users to correct their files as they them one is making the FILE command more expensive, and thus may not be a good thing.

(3) The compiler/object program's view

Compilers, assemblers and user programs are not geared to ignoring certain parts of an input line which contain the number. To deal with this there are two approaches.

  1. to change the supervisor so that it ignores the line-number unless specifically asked not to, as it would be for instance by the edit program. This involves copious ad hoc changes and is generally messy.
  2. to change compilers, assemblers, and user programs so that they ignore line numbers if present. This goes against our basic philosophy of making it immaterial to a user program where its input is coming from.

(4) The filing system view

A file may be created in at least three ways:

  1. from a console
  2. from an ordinary input peripheral
  3. by object program output.

If the standard editor presupposes line-numbered files, then not merely must the now route (a) be planned this way, but the existing routes (b) and (c) must be changed. This is a substantial upheaval.

(5) General

Establishments which are basically card-oriented are used to ignoring parts of a card, and relying on fixed format in the rest. Even so, they have to do it explicitly. Chaos easily results in CTSS if a program consumes files made either by console or by O.P. output or by the newer console facilities. One gets absurdities such as requiring each line to have not more than 74 significant characters, so that the consuming programs can ignore the last 6 which are either the line number or are wasted. The situation is much worse in a traditionally free-format place such as UML.

11 November 1965

Copyright © 1965 University of Cambridge Computer Laboratory. Distributed by permission. Thanks to Barry Landy, Roger Needham and David Hartley for giving permission to distribute these documents. Thanks to Barry Landy for lending me the paper document from which this was scanned. Any typographical errors probably arose in the course of OCR.

Previous Planning Document: Initial Planning of the Cambridge On-Line System, JCV, 9 November 1965
Next Planning Document: 9. (Number 9 missing)
Return to Cambridge Supervisor Planning Documents
Return to CUCPS TITAN page
Return to CUCPS home page
Return to University of Cambridge home page

Contact: CUCPS Committee (
This HTML version last updated: $Date: 1999/06/05 21:38:16 $