Jump to content

PL/C

From Alfawiki
PL/C
Company typeAcademic project
IndustryComputer programming, Education
Founded1970; 56 years ago (1970)
FounderRichard W. Conway, Thomas R. Wilcox
Headquarters
Ithaca
,
United States
ProductsPL/I teaching compiler

PL/C is a teaching-oriented variant of the PL/I programming language, created in the early 1970s at Cornell University's Department of Computer Science under the guidance of Professor Richard W. Conway and graduate student Thomas R. Wilcox. This dialect was specifically tailored for instructional purposes. Its compiler implemented almost the entire PL/I language and was distinctive in that it never failed to compile submitted code, employing comprehensive automatic syntax error correction and transforming unresolved errors into output statements. This capability was especially valuable when students submitted programs via IBM punch cards, which involved significant waiting times before results were returned.

More than 250 academic institutions incorporated PL/C into their curricula; a PL/I textbook from the late 1970s remarked that "PL/C ... developed at Cornell University ... is widely used in teaching programming." A contemporaneous survey also recognized PL/C as a prevalent PL/I variant for educational use.

Origins and rationale

PL/C evolved from earlier Cornell-developed compilers for CUPL and CORC,[1] both small-scale languages intended for programming instruction.[2] CORC was in use at Cornell between 1962 and 1966, followed by CUPL from 1965 through 1969.[3] The team led by Conway contributed to these projects,[4][5] each featuring automatic source code error correction.[2]

In the early 1970s, Cornell aimed to adopt a teaching language that combined commercial relevance with modern capabilities.[6] According to Professor David Gries, this goal excluded ALGOL-family languages and discouraged FORTRAN and BASIC, resulting in the selection of PL/I.[7] Although PL/I had limited use in education,[8] most universities favored FORTRAN, with approximately 70% of U.S. students learning it.[7] Cornell’s priority was a language well-suited for illustrating computer science concepts and engineering methodologies such as structured programming and stepwise refinement, areas where PL/I offered greater expressiveness than FORTRAN.[9]

However, existing IBM PL/I compilers were inadequate for student use due to slow compilation and execution times,[8] paralleling IBM’s sluggish FORTRAN IV compiler that prompted the development of the popular WATFOR alternative.[8] Recognizing this deficiency, IBM encouraged Cornell to develop a "WATFOR for PL/I."[10] Consequently, PL/C was designed as a rapid compile-and-go system with batch processing features tailored for educational environments.[11]

The initial development of PL/C during 1968–1969 received partial funding from IBM,[3] with the letter "C" signifying Cornell.[4] The system became operational in September 1970.[3]

Dialect and features

PL/C represented a substantial subset of PL/I, omitting some intricate features like record I/O, list processing, multitasking, and the compile-time preprocessor. It incorporated robust debugging tools and advanced error recovery mechanisms. Designed for upward compatibility with PL/I, programs that executed without errors on PL/C were expected to run identically on standard PL/I systems, except when utilizing certain diagnostic features unique to PL/C. Notably, its compiler guaranteed compilation success by automatically correcting numerous syntax mistakes and converting any remaining errors into output commands.

Enhancements to PL/I’s CHECK statement enabled detailed flow tracing in PL/C. Additionally, new commands such as PUT ALL; and PUT ARRAY; were introduced to display all scalar or array variables at specified program points. The language also supported pseudo-comments that conditionally activated code segments based on job control parameters:

*PL/C ID='JANE SMITH' COMMENTS=(2)

...

   /*2 PUT SKIP LIST('AT POINT Y, THE VALUE OF POPULATION IS', POPULATION); */

   /*4 PUT ALL; */

...

In this example, the first PUT command is enabled by matching its comment number, while the second remains inactive as a comment. This approach allowed PL/C-specific instructions to maintain upward compatibility with standard PL/I compilers, which treated them as comments.

Regarding floating-point calculations, PL/C handled all single-precision operations internally as double precision, complicating efforts to verify rounding behavior.

An illustration of PL/C’s automatic error correction:

   PUT LIST (A B)
ERROR SY06 MISSING COMMA
ERROR SY07 MISSING SEMI-COLON
PL/C USES PUT LIST (A, B);

While many syntax issues were fixed automatically, some corrections did not necessarily align with the original programmer’s intent.

Other instructional PL/I compilers such as PLAGO and SP/k restricted their supported subsets more severely. In contrast, PL/C supported nearly the full language specification and was noted as the sole educational PL/I dialect mentioned in Jean E. Sammet’s 1976–77 survey of programming languages.

Design and implementation

The PL/C compiler was developed using IBM 360 Assembly Language and its successors, incorporating a wide range of assembly macros. It functioned as a three-pass compiler: the initial pass focused on syntax analysis and correcting errors, the second conducted semantic checks along with additional error correction, and the final pass was responsible for code generation. PL/C effectively tackled the long-standing problem of "cascading diagnostics," where a single mistake triggers numerous confusing error messages. Its intermediate representation and symbol table architecture played a vital role in enabling robust error correction and clear diagnostic output. While some methods were adapted from earlier Cornell initiatives such as CORC and CUPL, PL/C was pioneering in applying these strategies to a complex, commercially-oriented language like PL/I.

On an IBM System/360 Model 65, PL/C compiled between 10,000 and 20,000 lines of source code per minute. The system was introduced at an AFIPS conference in 1971 and gained broader attention following the 1973 publication of "Design and Implementation of a Diagnostic Compiler for PL/I" by Conway and Wilcox in Communications of the ACM.

Conceived as a compile and go system akin to WATFOR, PL/C ran on IBM System/360 and System/370 platforms under OS and HASP. The compiler was engineered to fit within a 128K byte memory partition, with both the compiler itself and generated object code occupying up to 100K bytes. It also incorporated runtime error detection: the execution supervisor identified problems such as uninitialized variables, division by zero, or out-of-bound array accesses, issuing relevant diagnostics while allowing program execution to proceed. This approach significantly minimized batch processing delays, complementing Cornell’s rapid job submission system for students.

Use and distribution

PL/C quickly spread beyond Cornell through distribution on magnetic tapes to interested institutions, debuting at the University of Michigan in Fall 1970. Although primarily a research initiative rather than a commercial product, organizations requesting installations were charged a research grant fee—$1,800 in 1972, increasing to $2,400 by 1976—to support ongoing development.

As an educational tool, PL/C became the leading version of PL/I; during 1970–71 it was adopted by 100 institutions with 60 purchases. By 1976, more than 200 sites worldwide had installed it, eventually surpassing 250 universities. Demand from non-academic sectors prompted enhancements such as business-oriented PICTURE variables.

A survey conducted by New Mexico State University in 1972 underscored PL/C’s advantages: extensive PL/I language features, faster compilation and execution speeds, and efficient memory utilization. The compiler not only identified errors but frequently corrected them automatically, improving student learning outcomes despite lacking record I/O functionality.

Several universities, including Washington State University, structured their introductory programming courses by teaching PL/C before Fortran (WATFIV), resulting in improved student performance. Cornell similarly adjusted its curriculum to adopt this sequence.

PL/C releases were somewhat synchronized with IBM’s PL/I F compiler versions: Release 4 corresponded with IBM F Version 4; Release 4 was available by January 1971; Release 6 appeared by August 1971; Release 6.5 by November 1973; Release 7.1 by March 1975; Release 7.5 by March 1976; with the final known iteration, Release 7.6, released in 1977.

Variants

The computer science department at Cornell University took pride in PL/C's connection to their institution, which resulted in multiple variants created by Conway, faculty members, and graduate students.

In 1974, PL/CT was launched to support interactive terminal use rather than batch processing, with a follow-up release in 1975 and public distribution beginning in 1976. PL/CT was primarily designed for the IBM System/370 running VM/CMS and TSO systems, functioning as a compiler instead of an interpreter.

By 1976, PL/CS emerged as a streamlined subset of PL/I with built-in assertion capabilities, tailored for introductory programming classes. This variant employed a distinct lexical and syntactic analyzer integrated with the PL/C code generator and runtime system. Additionally, PL/CS facilitated research into formal programming language semantics.

In 1978, Professor Tim Teitelbaum developed the Cornell Program Synthesizer for the PDP-11/60, which featured a structured editor for PL/CS alongside an incremental compiler and interpreter. This pioneering integrated development environment was later adapted to the Terak desktop workstation, which became widely used for teaching at Cornell and other academic institutions. Furthermore, Cornell connected the Terak to their IBM 370 mainframe to allow batch execution of PL/C programs with output printed on paper.

From 1975 onward, an experimental dialect named PL/CV was created to enable formal correctness proofs as a distinct verification phase. Under Professor Robert L. Constable's leadership, PL/CV incorporated features from PL/CS and emphasized assertions. A second iteration, PL/CV2, was introduced in 1978 and presented at the 1979 Symposium on Principles of Programming Languages.

Cross compilers

During the early 1970s, three cross compilers based on PL/C were developed at the University of North Carolina; these used the IBM 360 as the host platform with various minicomputers as target systems. These compilers employed a subset of the PL/C language along with the initial two compiler phases for syntax and semantic checking. The code generation and storage allocation components for IBM 360 were replaced by modules tailored to each target machine's architecture.

The first of these, PLCV (not to be confused with the PL/CV verifier), targeted Varian Data Machines minicomputers—specifically models 620/i and 620/f—and was developed around 1971. An enhanced version of PLCV followed around 1973. The second compiler, PLCI, focused on the Interdata Model 3 and underwent revision during the same period. The third cross compiler, PLCD, aimed at the Digital Equipment Corporation PDP-11/45 minicomputer and was released in 1973; it substituted the IBM 360 code generator with one designed for the PDP-11/45.

These cross compilers found practical applications beyond academic use. Notably, PLCD facilitated a graphical programming environment that utilized the same language on both a mainframe and a graphical support minicomputer, promoting portability of code. Programmers employed the IBM PL/I F compiler on the mainframe within the constraints of the PL/C subset while using PLCD to produce code for the PDP-11/45.

Textbooks

The 1973 textbook An Introduction to Programming: A Structured Approach Using PL/I and PL/C, written by Conway and Gries, featured PL/C as its instructional language. This work highlighted the principles of top-down design and structured programming discipline, establishing itself as a prominent resource in the field. It was distinguished by including a chapter on program correctness, such as the Invariant Relation Theorem, making it reportedly the first programming textbook to address this topic. Designed primarily for university courses employing PL/C, the book enjoyed significant commercial success.

A revised second edition was published in 1975, which restructured the content on program development and testing and integrated updates from the PL/C compiler's Release 7. The third edition, issued in 1979, catered to a more experienced audience reflecting growing pre-college programming exposure, while also expanding coverage to include the PL/CT and PL/CS variants of PL/C.

This seminal textbook gave rise to multiple derivative works, often co-authored, targeting novices or exploring other languages and dialects.

Legacy

PL/C continued to be utilized into the early 1980s; however, Pascal was beginning to dominate as the preferred language for teaching programming. This transition coincided with a shift away from IBM mainframes toward smaller, distributed computing environments. Despite its ambitions, PL/I did not attain the broad adoption in business or scientific domains that its creators envisioned.

At Cornell University, introductory programming classes switched to Pascal in 1984. Conway later expressed uncertainty regarding how long PL/C remained in use at other institutions where it had been deployed.

In 2012, initiatives aimed at reviving the Michigan Terminal System on IBM 360/370 simulators included informal approval from former Cornell personnel to execute PL/C object code within these emulated environments.

By 2022, the original source code for PL/C appears to have been lost.

See also

External links

  1. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named afips-plc
  2. ↑ 2.0 2.1 Cite error: Invalid <ref> tag; no text was provided for refs named PLCConwayWilcox
  3. ↑ 3.0 3.1 3.2 Cite error: Invalid <ref> tag; no text was provided for refs named cornell-history-computing
  4. ↑ 4.0 4.1 Cite error: Invalid <ref> tag; no text was provided for refs named pom-bio
  5. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named cornell_cs_timeline
  6. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named plcs
  7. ↑ 7.0 7.1 Cite error: Invalid <ref> tag; no text was provided for refs named gries-what
  8. ↑ 8.0 8.1 8.2 Cite error: Invalid <ref> tag; no text was provided for refs named nmsu-review
  9. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named conway-gries
  10. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named CUPL.Conway
  11. ↑ Cite error: Invalid <ref> tag; no text was provided for refs named mts-jan71