I was surprised when I heard that Pascal didn't originally have units. If I recall correctly they were introduced in Turbo Pascal 4. Did other pascal version have units prior to that? How long before other Pascal's got units?

2 Answers 2


The Pascal programming language didn't have any modularity construct. Early versions of Turbo Pascal didn't have them either. Turbo Pascal 3 consisted of about 40kB of code (including the editor); there wasn't any room for advanced language features. Units were introduced in Turbo Pascal 4.0. The concept was certainly not new (Modula-2, a successor of Pascal, had a similar primitive module system at the time, and so had other languages before), and the term “compilation unit” was also already in common use.

  • 1
    Turbo Pascal 2.0 could handle "include files"; that was the accepted modularity construct for version 3 as well. Given that the compiler was many times faster than its competitors even when compiling from disk, it didn't need partial compilation to allow faster build times than competitors which did support it.
    – supercat
    Sep 15, 2014 at 21:31

Units were included as part of UCSD Pascal ("p-System"), introduced in 1978, which predated Turbo Pascal by several years. Here is a reconstructed section of the original manual (excerpt below):

A UNIT is a group of interdependent procedures, functions, and associated data structures which perform a specialized task. Whenever this task is needed within a program, the program indicates that it USES the UNIT. A UNIT consists of two parts, the INTERFACE part, which declares constants, types, variables, procedures and functions that are public and can be used by the host program, and the IMPLEMENTATION part, which declares constants, types, variables, procedures and functions that are private.

  • Do you know if the concept was "borrowed" from Modula?
    – Gerry
    Aug 4, 2011 at 0:30
  • 2
    @Gerry, There may have been some influence, however I haven't been able to find a direct link. Wirth's original paper describing Modula, which included the concept of a program unit, was published in 1977 but the language was never actually implemented. I have not been able to find a free copy of the 1977 paper on-line to check the syntax. UCSD Pascal followed just a year later. Modula-2 has an IMPORT keyword instead of USES and MODULE instead of UNIT.
    – tcrosley
    Aug 4, 2011 at 1:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.