PL/I

PL/I

Infobox programming language
name = PL/I
logo =
paradigm = imperative, structured
year = 1964
designer = Hursley Laboratories
developer = IBM
latest release version =
latest release date =
typing =
implementations =
dialects = PL/M, XPL, PL/P, PL/C, PL/S, PL/AS, PL/X, PL/8, EPL
influenced_by = COBOL, Fortran, ALGOL,
influenced =

PL/I ("Programming Language One", pronEng|ˌpiːˌɛlˈwʌn) is an imperative computer programming language designed for scientific, engineering, and business applications. It is one of the most feature-rich programming languages and one of the very first in the highly-feature-rich category.Fact|date=April 2007It has been used by various academic, commercial and industrial users since it was introduced in the early 1960s, and is still actively used today.

PL/I's principal domain is data processing; it supports recursion and structured programming. The language syntax is English-like and suited for describing complex data formats, with a wide set of functions available to verify and manipulate them.

PL/I is considered by some to be a turning point where it was found that large languages with a lot of complexity that allow programmers to do almost anything (such as coerce types with no semantic relationship to one another) are burdensome and dangerous rather than "more powerful."Fact|date=July 2008

History

PL/I was developed by IBM, at its Hursley Laboratories in the United Kingdom, as part of the development of System/360. Prior to System/360, IBM made several different incompatible models of mainframes for different purposes: some were designed for business use, others for scientific use. The goal of the System/360 project was to develop one series of compatible models to replace all the previous models, and which could be used equally well for commercial or scientific use.

Not only did business and scientific users use different machines; they also used different languages. Business users mainly used COBOL, while scientific users used Fortran. The goal of PL/I was to develop a single language usable for both business and scientific purposes. Another goal was to add structured programming constructs derived from ALGOL, which neither COBOL nor Fortran supported (at the time). PL/I was designed by a committee drawn from IBM programmers and users drawn from across the United States, working over several months. IBM originally wanted PL/I to be ready for use by the launch of System/360, but unfortunately this deadline could not be met.

The language was originally to be called NPL, for "New Programming Language"; but that abbreviation could not be used because it was the name of the National Physical Laboratory in the UK. The 'NPL' name was in effect between March 1 and November 30 in 1964. MPL and MPPL were considered before settling on PL/1. [The name is seen as either "PL/1" (Arabic digit "1") or "PL/I" (Roman numeral "I"). When first introduced, the language name used the digit (for example, the March 1968 IBM language specifications (Y33-6003-0).) But by late 1976, when the ACM SIGPLAN Working Group released the formal definition, it used the roman numeral instead. In general, since then the roman numeral is most commonly used.] (This was a parallel to IBM's forthcoming database access language, Data Language/1).

Compilers were implemented by several groups in the early 1960s. The Multics project at MIT, one of the first to develop an operating system in a high level language, used Early PL/I (EPL), a subset dialect of PL/I, as their implementation language in 1964. EPL was developed at Bell Labs and MIT by Douglas McIlroy, Robert Morris, and others.

Although PL/I did not have immense universal popularity on all computing platforms of that era, that is not to say that it did not enjoy success on isolated islands within the 1970s computer industry. It received significant use in business data processing, and also for more general programming use, especially for authoring operating systems on certain processors. PL/M, a subset of PL/I distributed by Intel, was used to write the CP/M operating system proper and much application software running on CP/M and MP/M; Digital Research sold a PL/I compiler which was itself written in PL/M. PL/M was used to write much other software at Intel for the 8080, 8085, and Z-80 processors during the 1970s. The SAS System was initially written in PL/I; the SAS data step is still modeled on PL/I syntax. The XPL dialect of PL/I was used to write HAL/S as used on the Space Shuttle. A subset of PL/I, PL/P, was used to write new portions of PRIMOS at all rings of protection in its later revisions. A subset compiler named CORC, developed at Cornell University for teaching a dialect called PL/C, 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. Another dialect of PL/I was PLAGO, created at the Polytechnic Institute of Brooklyn, which used a simplified subset of the PL/I language and focused on good diagnostic error messages and fast compile times.

Another variant of PL/I was PL/S, the IBM systems programming language. IBM used PL/S to write the MVS operating system in the early 1970s. IBM uses an improved and renamed PL/S for internal work on current operating systems, OS/390 and now z/OS.

PL/8 (or PL.8), so-called because it was about 80% of PL/I, [cite journal| url=http://www.research.ibm.com/journal/rd/341/ibmrd3401C.pdf | title="The evolution of RISC technology at IBM"| last=Cocke| first=John| coauthors=Markstein, V.| year=1990| month=January| journal=IBM Journal of Research & Development| volume=34| issue=1| pages=4–11| publisher=IBM| format=PDF| accessdate=2008-03-06] was a simplified variant of PL/I, having fewer data types and much more limited input/output. A version was used on IBM mainframes as a development tool for software that was being designed for the AS/400, as well as to write the S/390 microcode.

IBM and various subcontractors also developed another variant in the early 1970s to support signal processing for the Navy called SPL/1.

The pioneering online airline reservation system Sabre, primarily written in 7090 assembler, later used PL/I and a custom compiler for some high-level tasks.

Although mostly used on mainframes, there are also PL/I versions for DOS, Microsoft Windows, AIX, OpenVMS, and Unix.

Retrospective

For a number of reasons, PL/I was not as successful as originally hoped; though it was claimed that without it the US Project Apollo would never have been able to put a man on the moon.Fact|date=February 2007

Design and implementation issues

Perhaps most important was that, even though the language was easy to learn and use, implementing a PL/I compiler was difficult and time-consuming. This was at least partially a result of having been designed by a committee, and the desire to supply the needs of very different types of users (business and scientific). Also, unlike COBOL and other high-level languages, the standard did not have any smaller "levels" or "subsets" defined, so every feature of the language had to be implemented to meet the defined standard. (Eventually a PL/I General Purpose subset was officially defined, but not until 10-15 years later.)

There were many choices made in the language syntax which made the language difficult to parse. Some examples:

* The compiler (and human readers) had no way of telling whether a statement was a declaration or an executable statement until encountering the ending semicolon, which could be several lines later.
* The PL/I "keywords" were not reserved; programmers could use them as variable or procedure names in programs. Thus each time the compiler encountered a keyword, it had to determine if it was being used as a keyword or as a name. (And since the compiler attempted "auto-correction", when it encountered a keyword used in incorrect syntax, it often decided that it must be a variable name, which then generated further errors & further attempts at auto-correction, producing error messages that were very confusing to programmers. [http://horningtales.blogspot.com/2006/10/my-first-pli-program.html] )
* The very sophisticated macro facility, which in effect required the compiler to have a built-in PL/I interpreter, also ballooned the size of the compiler, and often required adding an extra pass or two, further slowing down the compile process.

Typically a PL/I compiler was two to four times as large as comparable Fortran or COBOL compilers, and also that much slower. This was a considerable drawback in the days of 256K byte mainframes and paying for CPU time by the second, but was often offset by programmer productivity.

Compiler complexity was another issue that was perhaps underestimated during the initial design of the language. Optimization (needed because of the poor performance of early PL/I compilers compared to COBOL or Fortran) was unusually complex due to the need to handle asynchronous modification of variables (for example in the 'on error' exception handling construct) making it difficult to reliably predict how certain variables might be modified at runtime.

Another implementation issue was a "political" one: the entirely-IBM origin of the language. Competitors were not enthusiastic about spending money to implement an IBM-designed language, especially as they would have to be playing catch-up using info from an IBM-controlled language committee. Many delayed implementing PL/I until their customers asked for it, and often tried to persuade customers to stay with "tried and true" COBOL or Fortran.

Programmer preference issues

Such delays, its complexity, and the low quality of early versions of IBM's PL/I compiler discouraged users from switching from COBOL or Fortran. It contained many rarely used features, such as multithreading support, which added corresponding cost and complexity to the compiler, and its co-processing facilities required a multi-programming environment with support for non-blocking multiple threads for processes by the operating system.

Another major problem was the attitude of programmers. At the time, they were sharply divided into scientific programmers (who used Fortran) and business programmers (who used COBOL), with significant tension and even dislike between the groups. PL/I syntax borrowed heavily from both COBOL and Fortran syntax. So instead of noticing features that would make their job easier, Fortran programmers of the time noticed "COBOL" syntax and had the opinion that it was a "business" language, while COBOL programmers noticed "Fortran" syntax and looked on it as a "scientific" language. In addition, both COBOL and Fortran programmers viewed it as a "bigger" version of their own language, and both were somewhat intimidated by the language and disinclined to adopt it.

Another factor was "pseudo"-similarities to COBOL, FORTRAN, and ALGOL. These were PL/I syntax statements that looked similar to one of those languages, but worked differently in PL/I. Such frustrations left many experienced programmers with a jaundiced view of PL/I, and often an active dislike for the language.

Improved features

With full support for pointers to all data types (including pointers to structures), recursion, co-processing, extensive built-in functions and many other facilities, PL/I was indeed quite a leap forward compared to the programming languages of its time. In addition, the PL/I macro preprocessor was unusual, perhaps unique, in using its target language's syntax and semantics ("e.g." as compared to the C preprocessor's "#" directives). However, these were not enough to convince a majority of programmers or shops to switch to PL/I.

ample programs

Hello world program

Hello2: proc options(main); put list ('Hello, world!');end Hello2;

earch for a string

FINDSTRINGS: PROCEDURE OPTIONS(MAIN); /* READ A STRING, THEN PRINT EVERY */ /* SUBSEQUENT LINE WITH A MATCH */

DECLARE PAT VARYING CHARACTER(100), LINEBUF VARYING CHARACTER(100), (LINENO, NDFILE, IX) FIXED BINARY;

NDFILE = 0; ON ENDFILE(SYSIN) NDFILE=1; GET EDIT(PAT) (A); LINENO = 1; DO WHILE (NDFILE=0); GET EDIT(LINEBUF) (A); IF LENGTH(LINEBUF) > 0 THEN DO; IX = INDEX(LINEBUF, PAT); IF IX > 0 THEN DO; PUT SKIP EDIT (LINENO,LINEBUF)(F(2),A); END; END; LINENO = LINENO + 1; END; END FINDSTRINGS;

Variable Names

PL/I compiler also accepts variable names like key words (like IF, ELSE and THEN) and it uses the same symbol ('=') for checking equality of variables and for assignment. Something like this is accepted:

IF IF = THEN THEN THEN = ELSE; ELSE ELSE = IF;

Automatic storage

PL/I implemented the use of automatic storage by default. This meant the compiler would automatically create assembler code to 'Getmain' storage for variables, and would generate code to set these variables to the 'INIT' value upon entry to the procedure. However, care is required to control the use of these values properly. Large amounts of code can be generated to initialize variables unnecessarily upon every execution. Also, variables can end up being reset to INIT values unexpectedly if defined incorrectly. Often, the term 'STATIC', to override PL/1's default to 'AUTO' is used to provide functionality similar to COBOL.

tandards

* ANSI ANSI X3.53-1976 (R1998) "Information Systems - Programming Language - PL/I"
* ANSI ANSI X3.74-1987 (R1998) "Information Systems - Programming Language - PL/I General-Purpose Subset"
* ISO 6160:1979 "Programming languages -- PL/1"
* ISO/IEC 6522:1992 "Information technology -- Programming languages -- PL/1 general purpose subset"

Notes

ee also

* Alphabetical list of programming languages

External links

* [http://www.kednos.com/ Kednos PL/I] for HP OpenVMS VAX and Alpha
* [http://www-306.ibm.com/software/awdtools/pli/ IBM PL/I] for IBM mainframe, Linux on zSeries and Windows
* [http://www.users.bigpond.com/robin_v/resource.htm PL/I Resources]
* [http://home.nycap.rr.com/pflass/pli.htm PL/I home]
* [http://www.uni-muenster.de/ZIV.EberhardSturm/PL1andC.html Power vs. Adventure - PL/I and C] A side-by-side comparison of PL/I and C.
* [http://pl1gcc.sourceforge.net/ PL/I for GCC] The pl1gcc project is an attempt to create a native PL/I compiler using the GNU Compiler Collection.
* [http://home.nycap.rr.com/pflass/relate.htm Languages Related to PL/I]
* [http://www.cs.vu.nl/grammars/browsable/os-pli-v2r3/ PL/I grammar]


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”