All languages

Pascal language

Wirth's teaching language for structured programming: `if`/`while`/`for`/`repeat` and single-entry control flow, with records, sets and enumerations over ALGOL's block structure. It made disciplined control flow the default and became the standard introductory language of the 1970s and 80s.

Overview

Pascal is an imperative language designed by Niklaus Wirth at ETH Zurich and published in 1970, intended to teach structured programming — control flow built from if, while, for, and repeat rather than arbitrary jumps. It keeps ALGOL's block structure and adds records, sets and enumerated types.

Code

program Demo(Output);
{ declarations, then actions; `;` SEPARATES statements }
var
  Sum: Integer;
begin
  Sum := 3 + 5;
  Writeln(Output, Sum, -Sum)   { 8, then -8 }
end.
Every block is begin … end and the loops and selections used here are if/while/for/repeat/case; a goto exists in standard Pascal but is the rare escape hatch, and ; separates statements rather than terminating them.

Distinctive traits

  • Structured control flow is enforced by the grammar: if/while/for/repeat and case cover iteration and selection, so goto is a rarely used escape hatch rather than the default.
  • begin … end delimits every compound statement, and declarations must precede statements, so a block reads top to bottom — and var declarations give each block its own nested scope, as in ALGOL.
  • The type system is nominal, static and strongly typed: type declarations introduce fresh types, and record, set of, enumerated and subrange types are first-class declarations rather than library constructs.
  • The semicolon is a separator, not a terminator — the single most common beginner error, and a deliberate simplification of ALGOL's grammar.
  • Standardized as ISO 7185 in 1983, with Extended Pascal (ISO 10206) following; the ISO standard added conformant array parameters at C. A. R. Hoare's request.
  • Programs are compiled, classically to a machine-independent P-code, which is what made the language portable across the machines of its era.

Status

Active in two senses: the specification is fixed by ISO 7185:1990, and the language continues through Free Pascal and Delphi/Object Pascal, both actively released. Modula-2, also by Wirth, is its direct successor.

History

Wirth designed Pascal in 1968–69 and published the defining report at ETH Zurich in 1970; the first compiler, a recursive-descent parser for the CDC 6000, was operational in early 1970. The revised report of 1973 by Jensen and Wirth served as the de facto standard until ISO 7185 in 1983, with a corrected edition in 1990.

Sources & references