All languages

PL/I language

Designed to serve scientific, commercial, real-time and systems programmers in one language: ALGOL block structure, COBOL-style records and picture editing, FORTRAN arithmetic, storage classes and ON-units. Multics was written in it.

Overview

PL/I is a procedural, imperative language designed by IBM and a SHARE committee so one language could serve scientific, commercial and systems programmers. It combined ALGOL block structure with COBOL-style records and picture editing, FORTRAN arithmetic, programmer-controlled storage classes and ON-unit exception handling.

Code

hello: proc options(main);
  dcl n fixed binary(31) init(42);
  dcl msg char(20) varying;
  dcl flags bit(8) aligned init('10101010'b);
  dcl rate fixed decimal(5,2) init(0.05);
  msg = 'total: ' || char(n);
  put skip list(msg, n * 2, rate, flags);
end hello;
dcl fixes base, scale, length and storage class at once, so controlled puts the buffer's lifetime under allocate/free, while the on condition unit registered earlier handles the condition signal raises.

Distinctive traits

  • Storage classes (static, automatic, controlled, based, area) make lifetime a declaration; controlled, based and area put allocation under allocate/free.
  • No reserved words: keywords are ordinary identifiers, so later additions such as select or packages could not invalidate working programs.
  • ON-units attach an exception handler to each runtime condition (zerodivide, conversion, endfile) and are inherited down the call chain.
  • PICTURE and FIXED DECIMAL give COBOL-style report editing and packed-decimal data in the same syntax as binary arithmetic.
  • Multitasking is in the language: TASK and EVENT variables, a task option on call, and a wait join (fork/join).
  • Bit strings and pointer-addressed based variables let system code lay out and walk control blocks from a high-level language.

Status

Active. IBM Enterprise PL/I for z/OS 6.2 is the current mainframe compiler, Iron Spring PL/I covers Linux and OS/2, and the language is standardized as ISO 6160:1979 (endorsing ANSI X3.53-1976) and ECMA-50.

History

SHARE's Advanced Language Development Committee was charged by SHARE and IBM to specify a language serving scientific, commercial, real-time and systems programmers; its first definition appeared as the NPL Technical Report in December 1964. MIT's Multics project wrote a system-programming subset, EPL, and then the operating system itself in PL/I. ANSI standardized the language in 1976 (X3.53), ECMA in 1976 (ECMA-50) and ISO in 1979 (ISO 6160).

Sources & references