Pascal was developed on the pattern of theALGOL 60 language. Wirth was involved in the process to improve the language as part of theALGOL X efforts and proposed a version namedALGOL W. This was not accepted, and the ALGOL X process bogged down. In 1968, Wirth decided to abandon the ALGOL X process and further improve ALGOL W, releasing this as Pascal in 1970.
On top of ALGOL'sscalars andarrays, Pascal enables defining complex datatypes and building dynamic and recursive data structures such aslists,trees andgraphs. Pascal hasstrong typing on all objects, which means that one type of data cannot be converted to or interpreted as another without explicit conversions. Unlike C (and also unlike most other languages in theC-family), Pascal allowsnested procedure definitions to any level of depth, and also allows most kinds of definitions and declarations insidesubroutines (procedures and functions). A program is thus syntactically similar to a single procedure or function. This is similar to the block structure of ALGOL 60, but restricted from arbitrary block statements to just procedures and functions.
Pascal became very successful in the 1970s, notably on the burgeoningminicomputer market.Compilers were also available for manymicrocomputers as the field emerged in the late 1970s. It was widely used as a teaching language inuniversity-level programming courses in the 1980s, and also used in production settings for writing commercial software during the same period. It was displaced by theC programming language during the late 1980s and early 1990s asUNIX-based systems became popular, and especially with the release ofC++.
Much of the history ofcomputer language design during the 1960s can be traced to theALGOL 60 language. ALGOL was developed during the 1950s with the explicit goal of being able to clearly describealgorithms. It included a number of features forstructured programming that remain common in languages to this day.
Shortly after its introduction, in 1962 Wirth began working on his dissertation with Helmut Weber on theEuler programming language. Euler was based on ALGOL's syntax and many concepts but was not a derivative. Its primary goal was to add dynamic lists and types, allowing it to be used in roles similar toLisp. The language was published in 1965.
By this time, a number of problems in ALGOL had been identified, notably the lack of a standardizedstring system. The group tasked with maintaining the language had begun theALGOL X process to identify improvements, calling for submissions. Wirth andTony Hoare submitted a conservative set of modifications to add strings and clean up some of the syntax. These were considered too minor to be worth using as the new standard ALGOL, so Wirth wrote a compiler for the language, which became namedALGOL W.
The ALGOL X efforts would go on to choose a much more complex language,ALGOL 68. The complexity of this language led to considerable difficulty producing high-performance compilers, and it was not widely used in the industry. This left an opening for newer languages.
Pascal was influenced by the ALGOL W efforts, with the explicit goals of teaching programming in astructured fashion and for the development of system software.[5] A generation of students used Pascal as an introductory language in undergraduate courses. Other goals included providing a reliable and efficient tool for writing large programs,[6] and bridging the canyon between scientific and commercial programming, as represented by the then-widespread languages Fortran and COBOL, with a general-purpose language.[7]
Variants of Pascal have also been used for everything from research projects toPC games andembedded systems. Newer Pascal compilers exist which are widely used.[11]
Wirth's example compiler meant to propagate the language, the Pascal-P system, used a subset of the language designed to be the minimal subset of the language that could compile itself. The idea was that this could allow bootstrapping the compiler, which would then be extended to full Pascal language status. This was done with several compilers, but one notable exception was UCSD Pascal, which was based on Pascal-P2. It kept the subset status of the language based on the idea that this would run better on the new (then) microprocessors with limited memory. UCSD also converted the Pascal-P2 interpreter into a "byte machine", again, because it would be a better fit for byte oriented microprocessors.
UCSD Pascal formed the basis of many systems, including Apple Pascal. Borland Pascal was not based on the UCSD codebase, but arrived during the popular period of UCSD and matched many of its features. This started the line that ended with Delphi Pascal and the compatible Open Source compiler FPC/Lazarus.
The ISO standard for Pascal, ISO 7185, was published in 1983 and was widely implemented and used on mainframes, minicomputers and IBM-PCs and compatibles from 16 bits to 32 bits. The two dialects of Pascal most in use towards the end of the 20th century and up until today are the ISO 7185 standard version and the Delphi/Turbo Pascal versions (of which the two Borland versions are mostly compatible with each other).
The source for much of the early history on Pascal can be found in the Pascal User's Group newsletters at:
During work on the Lisa,Larry Tesler began corresponding with Wirth on the idea of adding object-oriented extensions to the language, to make Pascal amulti-paradigm programming language. This led initially toClascal, introduced in 1983. As the Lisa program faded and was replaced by the Macintosh, a further version was created and namedObject Pascal. This was introduced on the Mac in 1985 as part of theMacAppapplication framework, and became Apple's main development language into the early 1990s.
The Object Pascal extensions were added toTurbo Pascal with the release of version 5.5 in 1989.[12] Over the years, Object Pascal became the basis of theDelphi system forMicrosoft Windows, which is still used for developing Windows applications, and cancross-compile code to other systems.Free Pascal is an open source, cross-platform alternative with its own graphicalIDE calledLazarus.
The first Pascalcompiler was designed inZürich for theCDC 6000 seriesmainframe computer family.Niklaus Wirth reports that a first attempt to implement it inFORTRAN 66 in 1969 was unsuccessful due to FORTRAN 66's inadequacy to express complex data structures. The second attempt was implemented in a C-like language (Scallop by Max Engeli) and then translated by hand (by R. Schild) to Pascal itself for boot-strapping.[13] It was operational by mid-1970. Many Pascal compilers since have been similarlyself-hosting, that is, the compiler is itself written in Pascal, and the compiler is usually capable of recompiling itself when new features are added to the language, or when the compiler is to beported to a new environment. TheGNU Pascal compiler is one notable exception, being written in C.
The first successful port of the CDC Pascal compiler to another mainframe was completed by Welsh and Quinn at theQueen's University of Belfast (QUB) in 1972. The target was theInternational Computers Limited (ICL)1900 series. This compiler, in turn, was the parent of the Pascal compiler for the Information Computer Systems (ICS)Multum minicomputer. The Multum port was developed – with a view to using Pascal as a systems programming language – by Findlay, Cupples, Cavouras and Davis, working at the Department of Computing Science inGlasgow University. It is thought that Multum Pascal, which was completed in the summer of 1973, may have been the first16-bit implementation.
A completely new compiler was completed by Welsh et al. at QUB in 1977. It offered a source-language diagnostic feature (incorporating profiling, tracing and type-aware formatted postmortem dumps) that was implemented by Findlay and Watt at Glasgow University. This implementation was ported in 1980 to theICL 2900 series by a team based atSouthampton University and Glasgow University. The Standard Pascal Model Implementation was also based on this compiler, having been adapted, by Welsh and Hay atManchester University in 1984, to check rigorously for conformity to the BSI 6192/ISO 7185 Standard and to generate code for a portable abstract machine.
To propagate the language rapidly, a compilerporting kit was created in Zürich that included a compiler that generated so calledp-code for avirtual stack machine, i.e., code that lends itself to reasonably efficient interpretation, along with an interpreter for that code – thePascal-P system. The P-system compilers were named Pascal-P1, Pascal-P2, Pascal-P3, and Pascal-P4. Pascal-P1 was the first version, and Pascal-P4 was the last to come from Zürich. The version termed Pascal-P1 was coined after the fact for the many different sources for Pascal-P that existed. The compiler was redesigned to enhanceportability, and issued as Pascal-P2. This code was later enhanced to become Pascal-P3, with an intermediate codebackward compatible with Pascal-P2, and Pascal-P4, which was not backward compatible.
The Pascal-P4 compiler–interpreter can still be run and compiled on systems compatible with original Pascal (as can Pascal-P2). However, it only accepts a subset of the Pascal language.
Pascal-P5, created outside the Zürich group, accepts the full Pascal language and includes ISO 7185 compatibility.
Pascal-P6 is a follow on to Pascal-P5 that along with other features, aims to be a compiler for specific CPUs, including AMD64.
UCSD Pascal branched off Pascal-P2, whereKenneth Bowles used it to create theinterpretive UCSD p-System. It was one of three operating systems available at the launch of the originalIBM Personal Computer.[14] UCSD Pascal used an intermediate code based on byte values, and thus was one of the earliestbytecode compilers.Apple Pascal was released in 1979 for the Apple II andApple III computer systems. It was an implementation of, or largely based on, UCSD Pascal. Pascal-P1 through Pascal-P4 were not, but rather based on theCDC 6600 60-bit word length.
Apple Computer created its own Lisa Pascal for the Lisa Workshop in 1982, and ported the compiler to the Apple Macintosh andMPW in 1985. In 1985Larry Tesler, in consultation with Niklaus Wirth, defined Object Pascal and these extensions were incorporated in both the Lisa Pascal and Mac Pascal compilers.
In the 1980s,Anders Hejlsberg wrote the Blue Label Pascal compiler for theNascom-2. A reimplementation of this compiler for theIBM PC was marketed under the names Compas Pascal and PolyPascal before it was acquired byBorland and renamedTurbo Pascal.
Turbo Pascal became hugely popular, thanks to an aggressive pricing strategy, having one of the first full-screen IDEs, and very fast turnaround time (just seconds to compile, link, and run). It was written and highly optimized entirely inassembly language, making itsmaller and faster than much of the competition.
In 1986, Anders ported Turbo Pascal to the Macintosh and incorporated Apple's Object Pascal extensions into Turbo Pascal. These extensions were then added back into the PC version of Turbo Pascal for version 5.5. At the same timeMicrosoft also implemented the Object Pascal compiler.[16][17] Turbo Pascal 5.5 had a large influence on the Pascal community, which began concentrating mainly on the IBM PC in the late 1980s. Many PC hobbyists in search of a structured replacement for BASIC used this product. It also began to be adopted by professional developers. Around the same time a number of concepts were imported fromC to let Pascal programmers use the C-basedapplication programming interface (API) ofMicrosoft Windows directly. These extensions included null-terminatedstrings,pointer arithmetic,function pointers, an address-of operator, and unsafetypecasts.
Turbo Pascal and other derivatives withunit ormodule structures aremodular programming languages. However, it does not provide a nested module concept or qualified import and export of specific symbols.
The universities ofWisconsin–Madison,Zürich,Karlsruhe, andWuppertal developed thePascal-SC[18][19] andPascal-XSC[20][21][22] (Extensions for Scientific Computation) compilers, aimed at programming numerical computations. Development for Pascal-SC started in 1978 supporting ISO 7185 Pascal level 0, but level 2 support was added at a later stage.[23] Pascal-SC originally targeted theZ80 processor, but was later rewritten for DOS (x86) and68000. Pascal-XSC has at various times been ported to Unix (Linux,SunOS,HP-UX,AIX) and Microsoft/IBM (DOS withEMX, OS/2,Windows) operating systems. It operates by generating intermediate C source code which is then compiled to a native executable. Some of the Pascal-SC language extensions have been adopted byGNU Pascal.
Pascal Sol was designed around 1983 by a French team to implement aUnix-like system named Sol. It was standard Pascal level-1 (with parameterized array bounds) but the definition allowed alternative keywords and predefined identifiers in French and the language included a few extensions to ease system programming (e.g. an equivalent to lseek).[24] The Sol team later on moved to theChorusOS project to design adistributed operating system.[25]
IP Pascal is an implementation of the Pascal programming language usingMicropolis DOS, but was moved rapidly toCP/M-80 running on the Z80. It was moved to the80386 machine types in 1994, and exists today asWindows XP and Linux implementations. In 2008, the system was brought up to a new level and the resulting language termed "Pascaline" (afterPascal's calculator). It includes objects,namespace controls,dynamic arrays, and many other extensions, and generally features the same functionality and type protection asC#. It is the only such implementation that is also compatible with the original Pascal implementation, which is standardized as ISO 7185.
Pascal, in its original form, is a purelyprocedural language and includes the traditional array ofALGOL-like control structures with reserved words such asif,then,else,while,for, andcase, ranging on a single statement or abegin-end statements block. Pascal also has data structuring constructs not included in the originalALGOL 60types, likerecords, variants,pointers,enumerations, andsets and procedure pointers. Such constructs were in part inherited or inspired fromSimula 67,ALGOL 68,Niklaus Wirth's ownALGOL W and suggestions byC. A. R. Hoare.
Pascal programs start with theprogramkeyword with a list of externalfile descriptors as parameters[26] (not required in Turbo Pascal etc.); then follows the mainblock bracketed by thebegin andend keywords.Semicolons separatestatements, and thefull stop (i.e., a period) ends the whole program (orunit).Letter case is ignored in Pascal source.
programHelloWorld(output);beginWriteLn('Hello, World!'){No ";" is required after the last statement of a block - adding one adds a "null statement" to the program, which is ignored by the compiler.}end.
A Type Declaration in Pascal is used to define a range of values which a variable of that type is capable of storing. It also defines a set of operations that are permissible to be performed on variables of that type. The predefined types are:
Data type
Type of values which the variable is capable of storing
a sequence or "string" of characters is declared as a "packed array of char" with a starting index of 1. These can be assigned string constants and individual characters can be accessed as elements of the array.
The range of values allowed for the basic types (except Boolean) is implementation defined. Functions are provided for some data conversions. For conversion ofreal tointeger, the following functions are available:round (usingrounding half away from zero) andtrunc (rounds towards zero).
The programmer has the freedom to define other commonly used data types (e.g. byte, string, etc.) in terms of the predefined types using Pascal's type declaration facility, for example
Often-used types like byte and string are already defined in many implementations.
Normally the system will use aword to store the data. For instance, thebyte type may be stored in a machine integer - 32 bits perhaps - rather than an8-bit value. Pascal does not contain language elements that allow the basic storage types to be defined more granularly. This capability was included in a number of Pascal extensions and follow-on languages, while others, likeModula-2, expanded the built-in set to cover most machine data types like 16-bit integers.
Thepacked keyword tells the compiler to use the most efficient method of storage for the structured data types: sets, arrays and records, rather than using oneword for each element. Packing may slow access on machines that do not offer easy access to parts of a word.
In contrast with other programming languages from its time, Pascal supports a set type:[27]
varSet1:setof1..10;Set2:setof'a'..'z';
A set is a fundamental concept for modern mathematics, and they may be used in many algorithms. Such a feature is useful and may be faster than an equivalent construct in a language that does not support sets. For example, for many Pascal compilers:
ifiin[5..10]then...
executes faster than:
if(i>4)and(i<11)then...
Sets of non-contiguous values can be particularly useful, in terms of both performance and readability:
ifiin[0..3,7,9,12..15]then...
For these examples, which involve sets over small domains, the improved performance is usually achieved by the compiler representing set variables asbit vectors. The setoperators can then be implemented efficiently as bitwise machine code operations.
As shown in the example above, Pascalfiles are sequences of components. Every file has a buffer variable which is denoted byf^. The proceduresget (for reading) andput (for writing) move the buffer variable to the next element. Read is introduced such thatread(f, x) is the same asx := f^; get(f);. Write is introduced such thatwrite(f, x) is the same asf^ := x; put(f); The typetext is predefined as file of char. While the buffer variable could be used for inspecting the next character to be used (check for a digit before reading an integer), this leads to serious problems with interactive programs in early implementations, but was solved later with the "lazy I/O" concept, which waits until the file buffer variable is actually accessed before performing file operations.
Here the variableNodePtr is a pointer to the data typeNode, a record. Pointers can be used before they are declared. This is aforward declaration, an exception to the rule that things must be declared before they are used.
To create a new record and assign the value10 and characterA to the fieldsa andb in the record, and to initialise the pointerc to thenull pointer ("NIL" in Pascal), the statements would be:
Inside of the scope of thewith statement, a and b refer to the subfields of the record pointerNodePtr and not to the record Node or the pointer type pNode.
Linked lists,stacks andqueues can be created by including a pointer type field (c) in the record.
Unlike many languages that feature pointers, Pascal only allows pointers to reference dynamically created variables that are anonymous, and does not allow them to reference standard static or local variables. Pointers also must have an associated type, and a pointer to one type is not compatible with a pointer to another type (e.g. a pointer to a char is not compatible with a pointer to an integer). This helps eliminate the type security issues inherent with other pointer implementations, particularly those used forPL/I orC. It also removes some risks caused bydangling pointers, but the ability to dynamically deallocate referenced space by using thedispose function (which has the same effect as thefree library function found inC) means that the risk of dangling pointers has not been eliminated[28] as it has in languages such as Java and C#, which provideautomatic garbage collection (but which do not eliminate the related problem ofmemory leaks).
Some of these restrictions can be lifted in newer dialects.
Pascal is astructured programming language, meaning that the flow of control is structured into standardstatements, usually without 'goto' commands.
whilea<>bdoWriteLn('Waiting');ifa>bthenWriteLn('Condition met'){no semicolon allowed before else}elseWriteLn('Condition not met');fori:=1to10do{no semicolon here as it would detach the next statement}WriteLn('Iteration: ',i);repeata:=a+1untila=10;caseiof0:Write('zero');1:Write('one');2:Write('two');3,4,5,6,7,8,9,10:Write('?')end;
Pascal structures programs into procedures and functions. Generally, a procedure is used for its side effects, whereas a function is used for its return value.
programPrinting(output);vari:integer;procedurePrintAnInteger(j:integer);begin...end;functiontriple(x:integer):integer;begintriple:=x*3end;begin{ main program }...PrintAnInteger(i);PrintAnInteger(triple(i))end.
Procedures and functions can be nested to any depth, and the 'program' construct is the logical outermost block.
By default, parameters are passed by value. If 'var' precedes a parameter's name, it is passed by reference.
Each procedure or function can have its own declarations of goto labels, constants, types, variables, and other procedures and functions, which must all be in that order.This ordering requirement was originally intended to allow efficientsingle-pass compilation. However, in some dialects (such asDelphi) the strict ordering requirement of declaration sections has been relaxed.
Pascal adopted many language syntax features from theALGOL language, including the use of a semicolon as a statement separator. This is in contrast to other languages, such asPL/I andC, which use the semicolon as a statement terminator. No semicolon is needed before theend keyword of a record type declaration, a block, or acase statement; before theuntil keyword of a repeat statement; and before theelse keyword of anif statement.
The presence of an extra semicolon was not permitted in early versions of Pascal. However, the addition ofALGOL-like empty statements in the 1973Revised Report and later changes to the language in ISO 7185:1983 now allow for optional semicolons in most of these cases. A semicolon is still not permitted immediately before theelse keyword in anif statement, because theelse follows a single statement, not a statement sequence. In the case of nested ifs, a semicolon cannot be used to avoid thedangling else problem (where the inner if does not have an else, but the outer if does) by putatively terminating the nested if with a semicolon – this instead terminates both if clauses. Instead, an explicitbegin...end block must be used.[29]
Several Pascal compilers and interpreters are available for general use:
Delphi is Embarcadero's (formerly Borland/CodeGear) flagshiprapid application development (RAD) product. It uses the Object Pascal language (termed 'Delphi' by Borland), descended from Pascal, to create applications forWindows,macOS,iOS, andAndroid. The.NET support that existed from D8 through D2005, D2006, and D2007 has been terminated, and replaced by a new language (Prism, which is rebranded Oxygene, see below) that is not fully backward compatible. In recent yearsUnicode support andgenerics wereadded (D2009, D2010, Delphi XE).
Free Pascal is across-platform compiler written inObject Pascal (and isself-hosting). It is aimed at providing a convenient and powerful compiler, both able to compile legacy applications and to be the means to develop new ones. It is distributed under theGNU General Public License (GNU GPL), while packages and runtimelibrary come under a modifiedGNU Lesser General Public License (GNU LGPL). In addition to compatibility modes forTurbo Pascal, Delphi, and Mac Pascal, it has its own procedural and object-oriented syntax modes with support for extended features such asoperator overloading. It supports many platforms and operating systems. Current versions also feature an ISO mode.
Oxygene (formerly namedChrome) is an Object Pascal compiler for the.NET andMono platforms. It was created and is sold byRemObjects Software, and sold for a while by Embarcadero as the backend compiler of Prism.
Kylix was a descendant ofDelphi, with support for theLinux operating system and an improved object library. It is no longer supported. Compiler and IDE are available now for non-commercial use.
GNU Pascal Compiler (GPC) is the Pascal compiler of theGNU Compiler Collection (GCC). The compiler is written in C, the runtime library mostly in Pascal. Distributed under theGNU General Public License, it runs on many platforms and operating systems. It supports the ANSI/ISO standard languages and has partial Turbo Pascal dialect support. One of the more notable omissions is the absence of a fully Turbo Pascal-compatible (short)string type. Support for Borland Delphi and other language variants is quite limited. There is some support for Mac-pascal, however.
Virtual Pascal was created by Vitaly Miryanov in 1995 as a native OS/2 compiler compatible with Borland Pascal syntax. Then, it had been commercially developed by fPrint, adding Win32 support, and in 2000 it became freeware. Today it can compile for Win32, OS/2, and Linux, and is mostly compatible with Borland Pascal and Delphi. Development was canceled on April 4, 2005.
Pascal-P4 compiler, the basis for many subsequent Pascal-implemented-in-Pascal compilers. It implements a subset of full Pascal.
Pascal-P5 compiler is an ISO 7185 (full Pascal) adaption of Pascal-P4.
Pascal-P6 compiler is an extended version of Pascal adaption of Pascal-P5 according to the Pascaline language specification.
Turbo Pascal was the dominant Pascal compiler for PCs during the 1980s and early 1990s, popular both because of its powerful extensions and extremely short compilation times. Turbo Pascal was compactly written and could compile, run, and debug all from memory without accessing disk. Slowfloppy disk drives were common for programmers at the time, further magnifying Turbo Pascal's speed advantage. Currently, older versions of Turbo Pascal (up to 5.5) are available for free download from Borland's site.
IP Pascal implements the language "Pascaline" (named afterPascal's calculator), which is a highly extended Pascal compatible with original Pascal according to ISO 7185. It features modules with namespace control, including parallel tasking modules with semaphores, objects, dynamic arrays of any dimensions that are allocated at runtime, overloads, overrides, and many other extensions. IP Pascal has a built-in portability library that is custom tailored to the Pascal language. For example, a standard text output application from 1970's original Pascal can be recompiled to work in a window and even have graphical constructs added.
PocketStudio is a Pascal subset compiler and RAD tool forPalm OS and MC68xxx processors with some of its own extensions to assist interfacing with the Palm OSAPI. It resembles Delphi and Lazarus with a visual form designer, an object inspector and asource code editor.
MIDletPascal – A Pascal compiler and IDE that generates small and fast Java bytecode specifically designed to create software for mobiles.
AmigaPascal is a free Pascal compiler forAmiga systems.
VSI Pascal for OpenVMS (formerly HP Pascal for OpenVMS, Compaq Pascal, DEC Pascal, VAX Pascal and originally VAX-11 Pascal[31]) is a Pascal compiler that runs onOpenVMS systems.[32] It was also supported underTru64.[33][34] VSI Pascal for OpenVMS is compatible with ISO/IEC 7185:1990 Pascal as well some of ISO/IEC 10206:1990 Extended Pascal, and also includes its own extensions.[32] The compilerfrontend is implemented inBLISS.[35]
Stony Brook Pascal+ was a 16-bit (later 32-bit) optimizing compiler for DOS and OS/2, marketed as a direct replacement for Turbo Pascal, but producing code that executed at least twice as fast.
In 1983, the language was standardized in the international standard IEC/ISO 7185[36] and several local country-specific standards, including the American ANSI/IEEE770X3.97-1983, and ISO 7185:1983. These two standards differed only in that the ISO standard included a "level 1" extension for conformant arrays (an array where the boundaries of the array are not known until run time), where ANSI did not allow for this extension to the original (Wirth version) language. In 1989, ISO 7185 was revised (ISO 7185:1990) to correct various errors and ambiguities found in the original document.
The ISO 7185 was stated to be a clarification of Wirth's 1974 language as detailed by the User Manual and Report [Jensen and Wirth], but was also notable for adding "Conformant Array Parameters" as a level 1 to the standard, level 0 being Pascal without conformant arrays. This addition was made at the request ofC. A. R. Hoare, and with the approval of Niklaus Wirth. The precipitating cause was that Hoare wanted to create a Pascal version of the(NAG) Numerical Algorithms Library, which had originally been written in FORTRAN, and found that it was not possible to do so without an extension that would allow array parameters of varying size. Similar considerations motivated the inclusion in ISO 7185 of the facility to specify the parameter types of procedural and functional parameters.
Niklaus Wirth himself referred to the 1974 language as "the Standard", for example, to differentiate it from the machine specific features of theCDC 6000 compiler. This language was documented inThe Pascal Report,[37] the second part of the "Pascal users manual and report".
On the large machines (mainframes and minicomputers) Pascal originated on, the standards were generally followed. On theIBM PC, they were not. On IBM PCs, the Borland standards Turbo Pascal and Delphi have the greatest number of users. Thus, it is typically important to understand whether a particular implementation corresponds to the original Pascal language, or a Borland dialect of it.
The IBM PC versions of the language began to differ with the advent of UCSD Pascal, an interpreted implementation that featured several extensions to the language, along with several omissions and changes. Many UCSD language features survive today, including in Borland's dialect.
This sectionneeds expansion. You can help byadding to it.(February 2018)
In 1990, an extended Pascal standard was created as ISO/IEC 10206,[38] which is identical in technical content[39] to IEEE/ANSI 770X3.160-1989[40]As of 2019, Support of Extended Pascal inFreePascal Compiler is planned.[41]
Niklaus Wirth's Zürich version of Pascal was issued outsideETH in two basic forms: the CDC 6000 compiler source, and a porting kit called Pascal-P system. The Pascal-P compiler left out several features of the full language that were not required to bootstrap the compiler. For example, procedures and functions used as parameters, undiscriminated variant records, packing, dispose, interprocedural gotos and other features of the full compiler were omitted.
UCSD Pascal, under ProfessorKenneth Bowles, was based on the Pascal-P2 kit, and consequently shared several of the Pascal-P language restrictions. UCSD Pascal was later adopted as Apple Pascal, and continued through several versions there. Although UCSD Pascal actually expanded the subset Pascal in the Pascal-P kit by adding back standard Pascal constructs, it was still not a complete standard installation of Pascal.
In the early 1990s,Alan Burns and Geoff Davies developed Pascal-FC, an extension to Pl/0 (from the Niklaus' bookAlgorithms + Data Structures = Programs). Several constructs were added to use Pascal-FC as a teaching tool for Concurrent Programming (such as semaphores, monitors, channels, remote-invocation and resources). To be able to demonstrate concurrency, the compiler output (a kind ofP-code) could then be executed on a virtual machine. This virtual machine not only simulated a normal – fair – environment, but could also simulate extreme conditions (unfair mode).
Borland'sTurbo Pascal, written byAnders Hejlsberg, was written in assembly language independent of UCSD and the Zürich compilers. However, it adopted much of the same subset and extensions as the UCSD compiler. This is probably because the UCSD system was the most common Pascal system suitable for developing applications on the resource-limited microprocessor systems available at that time.
Theshrink-wrapped Turbo Pascal version 3 and later incarnations, including Borland'sObject Pascal andDelphi and non-Borland near-compatibles became popular with programmers including shareware authors, and so the SWAG library of Pascal code features a large amount of code written with such versions as Delphi in mind.
Delphi – Object Pascal is essentially its underlying language.
Free Pascal compiler (FPC) – Free Pascal adopted the standard dialect of Borland Pascal programmers, Borland Turbo Pascal and, later, Delphi.
PascalABC.NET – a new generation Pascal programming language including compiler and IDE.
Borland Kylix is a compiler and IDE formerly sold by Borland, but later discontinued. It is aLinux version of theBorland Delphi software development environment andC++Builder.
Lazarus – similar to Kylix in function, is a free cross-platform visual IDE for RAD using the Free Pascal compiler, which supports dialects ofObject Pascal to varying degrees.
Virtual Pascal – VP2/1 is a fully Borland Pascal– and Borland Delphi–compatible 32-bit Pascal compiler for OS/2 and Windows 32 (with a Linux version "on the way").[42]
Sybil is an open source Delphi-like IDE and compiler; implementations include:
WDSibyl[43] forMicrosoft Windows andOS/2, a commercial Borland Pascal compatible environment released by a company named Speedsoft that was later developed into a Delphi-likerapid application development (RAD) environment named Sybil and then open sourced under the GPL when that company closed down;
Open Sybil, which is an ongoing project, anopen source tool for OS/2 and eCS that was originally based on Speedsoft's WDsybl Sibyl Portable Component Classes (SPCC) and Sibyl Visual Development Tool (SVDE) sources, but now its core isIBM System Object Model (SOM), WPS andOpenDoc.[44]
Wirth's initial definition of the language was widely criticized. In particular,Nico Habermann commented in his "Critical Comments on the Programming Language Pascal" (1973) that many of its constructs were poorly defined, in particular fordata types,ranges,structures, andgoto.[45] Later,Brian Kernighan, who popularized theC language, outlined his criticisms of Pascal in 1981 in his article "Why Pascal is Not My Favorite Programming Language".[46] The most serious problem Kernighan described was that array sizes and string lengths were part of the type, so it was not possible to write a function that would accept variable-length arrays or even strings as parameters. This made it unfeasible to write, for example, a sorting library. Kernighan also criticized the unpredictable order of evaluation of Boolean expressions, poor library support, and lack ofstatic variables, and raised a number of smaller issues. Also, he stated that the language did not provide any simple constructs to "escape" (knowingly and forcibly ignore) restrictions and limitations. More general complaints from other sources[28][47] noted that the scope of declarations was not clearly defined in the original language definition, which sometimes had serious consequences when usingforward declarations to define pointer types, or when record declarations led tomutual recursion, or when an identifier may or may not have been used in an enumeration list. Another difficulty was that, likeALGOL 60, the language did not allow procedures or functions passed as parameters to predefine the expected type of their parameters.
In the two decades after 1975, Pascal gained increasing attention and became a major programming language for important platforms (including Apple II, Apple III, Apple Lisa, Commodore systems, Z-80-based machines and IBM PC) due to the availability of UCSD Pascal and Turbo Pascal.[48]
Despite initial criticisms, Pascal continued to evolve, and most of Kernighan's points do not apply to versions of the language which were enhanced to be suitable for commercial product development, such as Borland'sTurbo Pascal. As Kernighan predicted in his article, most of the extensions to fix these issues were incompatible from compiler to compiler. Since the early 1990s, however, most of the varieties seem condensed into two categories: ISO and Borland-like. Extended Pascal addresses many of these early criticisms. It supports variable-length strings, variable initialization, separate compilation, short-circuit Boolean operators, and default (otherwise) clauses for case statements.[49]
Some of the problems arising from the differences in the implementations of Pascal were later partly solved by the advent of Free Pascal, which supports several dialects with mode directives.[50]
^In an issue ofElectronics in 1978, Wirth explained why he named the language after Blaise Pascal: "Actually, I am neither capable of fully understanding his philosophy nor of appreciating his religious exaltations. Pascal, however, was (perhaps one of) the first to invent and constructa device that we now classify as a digital computer."[4]
^"About Microsoft's "Delegates"". Archived fromthe original on 2012-06-27.We looked very carefully at DelphiObject Pascal and built a working prototype of bound method references in order to understand their interaction with the Java programming language and its APIs ... Our conclusion was that bound method references are unnecessary and detrimental to the language. This decision was made in consultation with Borland International, who had previous experience with bound method references in DelphiObject Pascal.
^TechMetrix Research (1999)."History of Java"(PDF).Java Application Servers Report. Archived fromthe original(PDF) on 2010-12-29. Retrieved2009-10-16.The project went ahead under the name "green" and the language was based on an old model ofUCSD Pascal, which makes it possible to generate interpretive code
^Bamberger, Lothar; Davenport, James H.; Fischer, Hans-Christoph; Kok, Jan; Schumacher, Günter; Ullrich, Christian; Wallis, Peter J. L.; Winter, Dik T.; Wolff von Gudenberg, Jürgen (1990). Wallis, Peter J. L. (ed.).Improving Floating-Point Programming (1st ed.). Bath, United Kingdom:John Wiley & Sons Ltd.ISBN0-471-92437-7.
^Michel Gien, "The SOL Operating System", in Usenix Summer '83 Conference, Toronto, ON, (July 1983), pp. 75–78
C. A. R. Hoare: "Notes on data structuring". In O.-J. Dahl, E. W. Dijkstra and C. A. R. Hoare, editors,Structured Programming, pages 83–174. Academic Press, 1972.
C. A. R. Hoare, Niklaus Wirth:An Axiomatic Definition of the Programming Language Pascal. 335–355, Acta Informatica, Volume 2, 1973.