Cover of book that described the PL/C dialect | |
Paradigm | procedural, imperative, structured, educational |
---|---|
Developer | Cornell University |
First appeared | 1970 (1970) |
Stable release | Release 7.6 / 1977 |
Typing discipline | strong |
Dialects | |
PL/CT, PL/CS, PL/CV | |
Influenced by | |
PL/I, CUPL |
PL/C is an instructional dialect of the programming language PL/I, developed at the Department of Computer Science of Cornell University in the early 1970s in an effort headed by Professor Richard W. Conway and graduate student Thomas R. Wilcox. PL/C was developed with the specific goal of being used for teaching programming. The PL/C compiler, which implemented almost all of the large PL/I language, had the unusual capability of never failing to compile a program, through the use of extensive automatic correction of many syntax errors and by converting any remaining syntax errors to output statements. This was important because, at the time, students submitted their programs on IBM punch cards and might not get their output back for several hours. Over 250 other universities adopted PL/C; as one late-1970s textbook on PL/I noted, "PL/C ... the compiler for PL/I developed at Cornell University ... is widely used in teaching programming." Similarly, a mid-late-1970s survey of programming languages said that "PL/C is a widely used dialect of PL/I."
Origins and rationale
Work on this project was based on a prior Cornell compiler for the programming language CUPL, which in turn was influenced by the earlier Cornell language implementation CORC. Both of these were small, very restricted languages intended for the teaching of beginning programming. CORC had been used at Cornell from 1962 to 1966 and CUPL from 1965 to 1969. Conway's group had been involved in the development of both of those efforts, each of which attempted automatic repair of source code errors.
As the 1970s began, Cornell was attempting to find a teaching language that had general commercial acceptance but also contained modern language features. As another Cornell computer science professor, David Gries, wrote at the time, the first criterion effectively eliminated the ALGOL family of languages and the second criteria argued against FORTRAN and BASIC (with COBOL not even being considered); thus, they chose PL/I. While PL/I did have a foothold in educational use, the decision went against the grain of most universities, where one survey found that some 70 percent of American college students were being taught with FORTRAN. However, Cornell was intent on having a language useful for showing computer science principles and best engineering practices and through which methods such as structured programming and stepwise refinement could be taught, and PL/I was a more expressive vehicle for that than FORTRAN.
For educational institutions that did choose to use the language, the production IBM PL/I F compiler then available was much too slow, in both compile time and execution time, for its use to be practical for student programs. A similar situation existed for FORTRAN, where the IBM FORTRAN IV G compiler was too slow and the University of Waterloo's WATFOR implementation had become a very popular alternate solution. So there was an opening for a student compiler for PL/I; indeed, IBM recognized this and contacted Cornell and suggested they make a 'WATFOR for PL/I'. Indeed, this simile would be made explicit; as one university would explain to their computer center users, "PL/C is to PL/I what WATFOR is to FORTRAN IV, a fast compile-and-go system with some batching capabilities intended primarily for student use."
IBM supplied some of the funding for the initial PL/C development effort, which took place during 1968 and 1969, with the "C" in the name standing for Cornell. PL/C began being used on a regular basis in September 1970.
Dialect and features
PL/C, a large subset of PL/I, eliminated a few of the more complex features of PL/I – record I/O, list processing, multitasking, and the compile-time preprocessor. It added extensive debugging and error recovery facilities. PL/C was upwardly compatible with PL/I, meaning that a program that runs without error under the PL/C compiler should run under PL/I and produce the same results. The only exception is if certain incompatible diagnostic features of PL/C were used. The PL/C compiler had the unusual capability of never failing to compile any program, through the use of extensive automatic correction of many syntax errors and by converting any remaining syntax errors to output statements.
PL/C provided extensions to PL/I's own CHECK
facility for flow tracing, and additionally provided new facilities, such as the PUT ALL;
and PUT ARRAY;
statements for printing the values of every scalar and every array variable at that point in the program. PL/C also provided pseudo-comments, which could be used to conditionally turn on code based on options supplied in the PL/C job control card:
*PL/C ID='JANE SMITH' COMMENTS=(2) ... /*2 PUT SKIP LIST('AT POINT Y, THE VALUE OF POPULATION IS', POPULATION); */ /*4 PUT ALL; */ ...
The comments value shown here would result in the first PUT
statement being "uncommented" and invoked during the run, while the second one whose number did not match would still be a comment. Pseudo-comments also provided a way to use PL/C-specific statements in an upwardly compatible way with PL/I, as in the second case, since the PL/I compiler would see them as comments only.
PL/C handles floating point arithmetic by computing all single-precision values as double precision, which can complicate attempts by the programmer to validate rounding behavior of particular computations.
A simple example of PL/C's error repair has been presented as:
PUT LIST (A B) ERROR SY06 MISSING COMMA ERROR SY07 MISSING SEMI-COLON PL/C USES PUT LIST (A, B);
While many cases such as this one can be successfully repaired, there are also cases where the repair does not achieve what the programmer likely intended.
There were several other education-related PL/I compilers, including PLAGO from the Polytechnic Institute of Brooklyn and SP/k from the University of Toronto, however they tended to use much more restricted subsets of PL/I, whereas PL/C supported almost the entire language. And PL/C was the only PL/I educational dialect mentioned in languages expert Jean E. Sammet's extensive survey of programming languages in use for 1976–77.
Design and implementation
The implementation of the PL/C compiler itself was done in IBM 360 Assembly Language, with a heavy use of assembly language macros. It was done as a three-pass compiler, with the first pass doing syntax analysis and error correction of syntactical mistakes, the second pass doing semantic analysis and further error correction, and the third pass doing code generation. PL/C needed to avoid the longstanding problem of "cascading diagnostics", wherein one error is internally but often mistakenly "fixed" by the compiler, resulting in a secondary, tertiary and additional series of unhelpful error messages. The design of the intermediate language used between the passes and of the accompanying symbol table was tailored towards, and key to the achievement of, the error-repair and diagnostic reporting capabilities of PL/C. While a number of these techniques dated from the Cornell CORC and CUPL efforts, here they were being used for the first time on large programming language with a full set of commercial-grade features. This was especially notable given that the PL/I language was notoriously challenging for compilers to deal with.
The compilation speed of PL/C was quite good – some 10,000–20,000 sources lines of code per minute on an IBM System/360 Model 65. The work done on PL/C was described in a paper presented at an AFIPS joint conference in Spring 1971. More prominent was the paper "Design and Implementation of a Diagnostic Compiler for PL/I" by Conway and Wilcox, published in the March 1973 issue of the flagship journal Communications of the ACM, which gave the project considerable visibility within the computer science world.
PL/C was implemented as a compile and go system, similar to WATFOR. It ran on the IBM System/360 and System/370 under OS and HASP. As such, it was designed to run within a 128K byte partition, where the PL/C software and the generated object code took a maximum of 100K bytes. Error correction was attempted at runtime as well, with the PL/C execution supervisor trapping or otherwise detecting use of uninitialized variables, division by zero, out-of-range array indexes, and the like, by issuing a diagnostic and making some adjustment to allow the program to keep running. Overall, use of PL/C significantly reduced the severity of the wait-times-for-batch-runs problem (although Cornell itself developed a job entry system for turning around most student batch jobs very quickly).
Use and distribution
As soon as it was ready, PL/C was distributed beyond Cornell itself, in the form of magnetic tapes sent to interested parties. For instance, PL/C was first used at the University of Michigan in the Fall 1970 semester. The PL/C project was considered a research effort, not a commercial endeavor; however, those installations who wanted to use PL/C were asked to pay a "research grant" in exchange. This amount was $1,800 as of 1972, and had risen to $2,400 by 1976. Cornell's further development work on PL/C was partly funded by these payments.
PL/C quickly became the most popular of any education version of PL/I; in 1970–71 alone, it was sent to 100 different institutions, resulting in 60 of them purchasing it. By 1976, there were more than 200 sites around the world that had installed PL/C. Eventually, over 250 universities had used it. There was also some interest in PL/C from non-academic entities, thus resulting in PL/C adding support for some business-oriented features such as PICTURE variables.
A survey conducted by New Mexico State University in 1972 looked at various possibilities for teaching languages and implementations and concluded regarding PL/C: "PL/C seems praiseworthy. Its purchase price ($1,800) is probably its biggest drawback. It has all of the built-in functions PL/I has, is much faster in both compilation and execution, and runs in 86K of a 100K partition leaving 14K for the student program. Its only real possible deficiency for student programs is its lack of record I/O capability. The PL/C compiler not only diagnoses errors, but often corrects them properly. It inserts missing parentheses and semicolons and shows both the invalid statement and the corrected statement. If PL/C finds a statement completely unrecognizable it deletes it and attempts execution anyway."
Some universities, including Washington State University, found success in teaching an introductory class that used PL/C first and then Fortran (using WATFIV) second, which was found to be a beneficial order in terms of student learning. Indeed, Cornell at one point restructured their introductory course offering to allow students the option to do that.
PL/C release numbers were to some extent synchronized to releases of the IBM PL/I F compiler, so that for instance Release 4 of PL/C was intended to match Version 4 of the IBM F compiler in terms of upward compatibility. In terms of some instances of PL/C distributions, Release 4 was available by January 1971; Release 6 by August 1971; Release 6.5 by November 1973; Release 7.1 in March 1975; and Release 7.5 in March 1976. The last version of PL/C appears to have been Release 7.6, put out in 1977.
Variants
Within the computer science department at Cornell there was a sense of pride about PL/C being associated with the university, and there were several variants of PL/C worked on by Conway, other faculty members, and graduate students.
In 1974, the PL/CT variant of PL/C, for use on interactive terminals rather than in batch job submissions, was first made available at Cornell. A second release was made in 1975, and then it was made available to outside institutions in 1976. PL/CT primarily ran on an IBM System/370 under VM/CMS; it could also run in the IBM TSO environment. Somewhat unusually, PL/CT was not interpreted but rather was still implemented as a compiler.
A variant under development by 1976 was PL/CS, which was a far more restricted subset of PL/I than regular PL/C and which provided direct language support for assertions. The subset was enough, however, that PL/CS would still be suitable for teaching introductory programming classes. It was implemented as an alternate lexical and syntactic analyzer that then plugged into the common PL/C code generator and runtime system. PL/CS was also used in research on the formal semantics of programming languages.
A different implementation of the PL/CS definition came with Professor Tim Teitelbaum and his pioneering Cornell Program Synthesizer work. This early instance of an integrated development environment was developed in 1978 for the PDP-11/60, and contained a structured editor for PL/CS along with an incremental compiler as well as an interpreter. The Cornell Program Synthesizer was soon adapted for the Terak desktop workstation, an early personal computer, which was based on the LSI-11 processor. The Terak computer found popularity for instructional use at Cornell and at other universities, as did the PL/CS available on it. In addition, Cornell built a link between the Terak and their IBM 370 mainframe, that would allow batch-mode execution of programs under PL/C and the obtaining of results on printers.
There was an even more experimental dialect being worked on, starting in 1975, that was known as PL/CV, which supplied some language support for formal proof of correctness and which ran as a separate verifier step. The PL/CV work was led by Professor Robert L. Constable. PL/CV used PL/CS as part of what it did, and indeed Constable had participated in the creation of PL/CS, especially working with Conway and David Gries on the adding of assertions. A second version, PL/CV2, was released in 1978 and was presented at the Symposium on Principles of Programming Languages in 1979.
Cross compilers
In the early 1970s, three cross compilers based on PL/C were created at the University of North Carolina; in these, the host platform was the IBM 360, and the target machine was one of several minicomputers in use at the time. The PL/C language subset was used in these cross compilers, as was the PL/C compiler's first two passes for syntax and semantic analysis. However the IBM 360 code generation pass and storage allocation modules were replaced by ones specific to the target architecture.
The first of these cross compilers was PLCV (not to be confused with the PL/CV verifier), a cross compiler for Varian Data Machines minicomputers, specifically the 620/i and 620/f, and was created around 1971. An improved version of PLCV came out around 1973. The second, PLCI, was targeted at the Interdata Model 3; it also had a revised version around the same time. The third was PLCD, used to target the Digital Equipment Corporation's PDP-11/45 minicomputer, which came out in 1973. Again, PLCD used PL/C but with the IBM 360 code generator replaced by one for PDP-11/45.
The University of North Carolina used these cross compilers for real projects, not just education; in particular, PLCD was used in support of a graphical programming environment that would use the same programming language for both a general purpose mainframe and a graphical support minicomputer, thereby allowing easier shifting of code from one to the other. The IBM PL/I F compiler was used on the mainframe, with programmers restricting themselves to the PL/C subset of the language, and PLCD was used to generate code for the PDP-11/45.
Textbooks
The textbook An Introduction to Programming: A Structured Approach Using PL/I and PL/C was written by Conway and Gries using PL/C as the programming language and was published in 1973. It presented top-down design, and stressed the discipline of structured programming throughout, becoming one of the most prominent textbooks to do so. One section of the book was devoted to considerations of program correctness, such as the Invariant Relation Theorem; it is said to have been the first programming textbook to incorporate such material. The book had a potential market at any university using PL/C, and Conway later said that the book had sold very well.
A second edition was published in 1975. Besides reorganizing some material on the development and testing of computer programs, it incorporated changes due to Release 7 of the PL/C compiler. A third edition was published in 1979 and, besides pitching the textbook material at a somewhat higher level to reflect that many college students had previous programming exposure in high school, incorporated additions to reflect the PL/CT and PL/CS variants of PL/C.
An Introduction to Programming: A Structured Approach was used as the basis for several offshoot textbooks, sometimes with additional co-authors, that were either aimed at a more beginning level or that covered other languages or dialects.
Legacy
PL/C was still in use at the beginning of the 1980s. However, by then the Pascal programming language was beginning to come to the fore as a teaching language, and the move of student access towards smaller and more distributed computer systems than IBM mainframes also continued. And PL/I itself never gained the dominance its designers had hoped for in either the business or scientific programming fields.
At Cornell itself, the switch to using Pascal in its introductory computer programming classes took place during 1984. Conway has said he does not know how long PL/C remained in use at the various sites where it was installed.
In 2012, an effort was ongoing to resurrect the popular Michigan Terminal System and the software that ran on it as part of an archival effort on IBM 360/370 simulators. Among the things they requested was permission to run the PL/C object code, which was informally granted by those staff associated with it who were still at Cornell.
As of 2022, the source for PL/C appears to have been lost.
See also
References
- ^ Conway, Richard W.; Wilcox, Thomas R. (March 1973). "Design and implementation of a diagnostic compiler for PL/I". Communications of the ACM. 16 (3): 169–179. doi:10.1145/361972.361992. hdl:1813/5952.
- ^ Stillman, Rich (1980). "Technology marches on: Using microcomputers to deliver elementary computer science instruction". Proceedings of the 8th annual ACM SIGUCCS conference on User services (SIGUCCS '80). Association for Computing Machinery. pp. 135–139. doi:10.1145/800086.802776.
- ^ Cornell University Announcements: Graduate School of Management, 1984–85. Cornell University. August 10, 1984. p. 22.
- Barnes, Robert Arthur (1979). PL/I for Programmers. New York: North Holland. p. xv. ISBN 9780444002846.
- ^ Sammet, Jean E. (November 1978). "Roster of programming languages for 1976–77". SIGPLAN Notices. 13 (11): 56–85. doi:10.1145/953777.953783. S2CID 13509254.
- ^ Leavitt, Don (March 1, 1976). "PL/C Gains Interactive Version". Computerworld. p. 15.
- ^ Morgan, Howard L.; Wagner, Robert A. (1971). "PL/ C:—The design of a high-performance compiler for PL/I". Proceedings of the May 18–20, 1971, spring joint computer conference (AFIPS '71 (Spring)). Association for Computing Machinery. pp. 503–510. doi:10.1145/1478786.1478858.
- ^ Rudan, John W. (2005). The History of Computing at Cornell University (PDF). Ithaca, New York: The Internet-First University Press. pp. 48, 57, 62, 65–66, 86–87.
- ^ "Richard Conway". Production and Operations Management. 19 (3): 2-ix, x. May 2010. ProQuest 356759223 – via ProQuest.
- ^ "Cornell Department of Computer Science: 50 Years of Innovation". Cornell Bowers CIS. Retrieved September 15, 2022.
- ^ Conway, Richard W.; Constable, Robert L. (November 1976). PL/CS – A Disciplined Subset of PL/I (Report). Cornell University. TR76-293.
- ^ Gries, David (January 1974). "What should we teach in an introductory programming course?". SIGCSE '74: Proceedings of the fourth SIGCSE technical symposium on Computer science education. Association for Computing Machinery. pp. 81–89. doi:10.1145/800183.810447.
- ^ Adams, J. Mack; Inmon, William H.; Shirley, Jim (March 1972). "PL/I in the computer science curriculum". ACM SIGCSE Bulletin. 4 (1): 116–126. doi:10.1145/873684.873713. S2CID 32179236.
- ^ Conway, Richard W.; Gries, David (1973). An Introduction to Programming: A Structured Approach Using PL/I and PL/C. Cambridge, Massachusetts: Winthrop Publishers. pp. (iii), 3, 9, 192–206, 232−236, and passim. ISBN 9780876264065. (Note the first edition uses "PL/1" on the cover but "PL/I" on the title page and in the text itself.)
- ^ Conway, Richard W. (July 31, 2015). "A Conversation with Richard W. Conway". An Oral History of Computer Science (Interview). Interviewed by David Gries. Cornell University Library. See segments at 35:00 and 40:30.
- ^ "Availability of PL/C in MTS". Computing Center Newsletter. University of Michigan. January 21, 1971. p. 5.
- Hull, T.E. (1977). "Semantics of floating point arithmetic and elementary functions". In Cowell, Wayne (ed.). Portability of numerical software. Berlin: Springer-Verlag. p. 42. ISBN 0-387-08446-0. OCLC 3311037.
- Holt, Richard C.; Wortman, David B. (July 1975). "SP/K (PL/1 Subset) compilers now available for 360/370 and PDP-11". SIGMINI Newsletter. 1 (1): 8–9. doi:10.1145/1164857.1164862. S2CID 29890098.
- Zeil, Steven. "Dealing with Error Messages". Department of Computer Science, Old Dominion University. Retrieved September 24, 2022.
- Pratt, Terrence W. (1975). Programming Languages: Design and Implementation. Englewood Cliffs, New Jersey: Prentice-Hall. pp. 385–386, 415.
- Dhotre, I.A.; Puntambekar, A.A. (2008). Systems Software. Technical Publications. p. 3-2.
- ^ Conway, Richard W. (1974). "Introductory instruction in programming". Proceedings of the fourth SIGCSE technical symposium on Computer science education (SIGCSE '74). Association for Computing Machinery. pp. 6–10. doi:10.1145/800183.810430.
- ^ Palazzo, Michael (November 15, 1978). "Computer Dept. Wins Prominence Throughout U.S." The Cornell Daily Sun. pp. 1, 10, 11.
- Newton, Glen E.; Starkey, J. Denbigh (1976). "Teaching both PL/I and Fortran to Beginners". Proceedings of the sixth SIGCSE technical symposium on Computer science education (SIGCSE '76). Association for Computing Machinery. pp. 106–107. doi:10.1145/800144.804769.
- See program listing image.
- "New Version of PL/C". Computing Center Newsletter. University of Michigan. March 12, 1975. p. 2.
- See for example Sebesta, Robert W. (2010). Concepts of Programming Languages (Ninth ed.). Addison-Wesley. p. 739. ISBN 9780136073475.
- Gries, David (July 21, 2015). "A Conversation with David Gries". An Oral History of Computer Science (Interview). Interviewed by Robert L. Constable. Cornell University Library. See segment at 28:30.
- ^ Conway, Richard; Moore, Charles; Worona, Steven (1977). "An interactive version of the PL/C compiler". Proceedings of the 1977 annual conference (ACM '77). Association for Computing Machinery. pp. 308–314. doi:10.1145/800179.810220. hdl:1813/7028. ISBN 978-1-4503-2308-6.
- ^ Moore, Charles G. III; Worona, Steven L.; Conway, Richard W. (September 1975). PL/CT – A Terminal Version of PL/C – Release 2 (Report). Cornell University. TR75-259.
- ^ Constable, Robert L.; Donahue, James E. (July 1979). "A Hierarchical Approach to Formal Semantics With Application to the Definition of PL/CS". ACM Transactions on Programming Languages and Systems. 1 (1): 98–114. doi:10.1145/357062.357069. S2CID 7915928.
- ^ Teitelbaum, Tim; Reps, Thomas (September 1981). "The Cornell Program Synthesizer: A Syntax-Directed Programming Environment". Communications of the ACM. 24 (9): 563–573. doi:10.1145/358746.358755. S2CID 14317073.
- ^ Teitelbaum, Tim (September 10, 2015). "A Conversation with Tim Teitelbaum". An Oral History of Computer Science (Interview). Interviewed by David Gries. Cornell University Library. See segments at 10:15 and 16:18.
- Reps, Thomas W.; Teitelbaum, Tim (1989). The Synthesizer Generator: A System for Constructing Language-Based Editors. New York: Springer Verlag. pp. 3, 9. ISBN 9781461396239.
- ^ Constable, Robert L.; Johnson, Scott D. (1979). "A PL/CV Precis". Proceedings of the 6th ACM SIGACT-SIGPLAN symposium on Principles of programming languages (POPL '79). Association for Computing Machinery. pp. 7–20. doi:10.1145/567752.567754.
- ^ Constable, Robert L. (July 21, 2015). "A Conversation with Robert L. Constable". An Oral History of Computer Science (Interview). Interviewed by David Gries. Cornell University Library. See segment at 16:30.
- ^ ERDA Research Abstracts. Vol. 1 / #3. Oak Ridge, Tennessee: United States Energy Research and Development Administration. March 1976. p. 474. Entry 4422.
- ^ Hamlin, Griffith; Foley, James D. (1975). "Configurable applications for graphics employing satellites (CAGES)". Proceedings of the 2nd annual conference on Computer graphics and interactive techniques (SIGGRAPH '75). Association for Computing Machinery. pp. 9–19. doi:10.1145/563732.563734.
- ^ ERDA Research Abstracts. Vol. 1 / #2. Oak Ridge, Tennessee: United States Energy Research and Development Administration. February 1976. p. 311. Entry 2956; also entry 2957.
- ^ Foley, James D. (1973). "Software for satellite graphics systems". Proceedings of the ACM annual conference (ACM '73). Association for Computing Machinery. pp. 76–80. doi:10.1145/800192.805684.
- ^ "Computer Text Is Updated". The Ithaca Journal. June 30, 1975. p. 6 – via Newspapers.com.
- See Second Edition, "Preface", p. xiv.
- See Third Edition, "Preface", pp. xv–xvi.
- "Texts by David Gries". Department of Computer Science, Cornell University. Retrieved September 23, 2022.
- Compare Cornell University Announcements: Courses of Study, 1983–84. Cornell University. July 15, 1983. p. 261. with Cornell University Announcements: Courses of Study, 1984–85. Cornell University. July 16, 1984. p. 268.
- "For *PLC". Michigan Terminal System Archive. April 3, 2012. Retrieved September 19, 2022.
External links
- Finding aids for PL/C Project, Cornell Information Technologies records, Cornell University Library
- PL/C artifacts at the Computer History Museum
- John Daintith, "PL/I", A Dictionary of Computing, 2018, as hosted at Encyclopedia.com