Pascal (programming language)
VSI Pascal | |
---|---|
Dialects | |
Influenced by | |
Influenced | |
|
Pascal is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring. It is named after French mathematician, philosopher and physicist Blaise Pascal.[a]
Pascal was developed on the pattern of the
On top of ALGOL's
Pascal became very successful in the 1970s, notably on the burgeoning
A derivative named Object Pascal designed for object-oriented programming was developed in 1985. This was used by Apple Computer (for the Lisa and Macintosh machines) and Borland in the late 1980s and later developed into Delphi on the Microsoft Windows platform. Extensions to the Pascal concepts led to the languages Modula-2 and Oberon, both developed by Wirth.
History
Earlier efforts
Much of the history of computer language design during the 1960s can be traced to the ALGOL 60 language. ALGOL was developed during the 1950s with the explicit goal of being able to clearly describe algorithms. It included a number of features for structured 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 the Euler 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 to Lisp. The language was published in 1965.
By this time, a number of problems in ALGOL had been identified, notably the lack of a standardized
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
Pascal was influenced by the ALGOL W efforts, with the explicit goals of teaching programming in a structured 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]
One of the early successes for the language was the introduction of
The
Variants of Pascal have also been used for everything from research projects to PC games and embedded systems. Newer Pascal compilers exist which are widely used.[11]
Dialects
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:
Pascal Users Group Newsletters.
Object Pascal
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 a multi-paradigm programming language. This led initially to Clascal, introduced in 1983. As the Lisa program faded and was replaced by the Macintosh, a further version was created and named Object Pascal. This was introduced on the Mac in 1985 as part of the MacApp application framework, and became Apple's main development language into the early 1990s.
The Object Pascal extensions were added to
Implementations
Early compilers
The first Pascal
The first successful port of the CDC Pascal compiler to another mainframe was completed by Welsh and Quinn at the
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 the
The first Pascal
The Pascal-P system
To propagate the language rapidly, a compiler porting kit was created in Zürich that included a compiler that generated so called
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, where Kenneth Bowles used it to create the interpretive UCSD p-System. It was one of three operating systems available at the launch of the original IBM Personal Computer.[14] UCSD Pascal used an intermediate code based on byte values, and thus was one of the earliest bytecode compilers. Apple Pascal was released in 1979 for the Apple II and Apple 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 the CDC 6600 60-bit word length.
A compiler based on the Pascal-P4 compiler, which created native binary object files, was released for the IBM System/370 mainframe computer by the Australian Atomic Energy Commission; it was named the AAEC Pascal 8000 Compiler after the abbreviation of the name of the commission.[15]
Object Pascal and Turbo Pascal
Apple Computer created its own Lisa Pascal for the Lisa Workshop in 1982, and ported the compiler to the Apple Macintosh and MPW in 1985. In 1985 Larry 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,
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 in assembly language, making it smaller 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 time
Turbo Pascal and other derivatives with unit or module structures are modular programming languages. However, it does not provide a nested module concept or qualified import and export of specific symbols.
Other variants
TMT Pascal was the first
The universities of
Pascal Sol was designed around 1983 by a French team to implement a Unix-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 the ChorusOS project to design a distributed operating system.[25]
Language constructs
Pascal, in its original form, is a purely
Pascal programs start with the program
Here is an example of the source code in use for a very simple "Hello, World!" program:
program HelloWorld(output); begin WriteLn('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.
Data types
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 |
---|---|
integer | integer (whole) numbers |
real | floating-point numbers |
Boolean
|
the values True or False |
char | a single character from an ordered character set |
set
|
equivalent to an array of Boolean values
|
array
|
a countable group of any of the preceding data types, of records, or of other arrays |
record | A collection of any of the preceding data types or of other records |
string | 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 of real
to integer
, the following functions are available: round
(which rounds to integer using
trunc
(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
type byte = 0..255; signed_byte = -128..127; string = packed array[1..255] of char;
Often-used types like byte and string are already defined in many implementations.
Normally the system will use a word to store the data. For instance, the byte
type may be stored in a machine integer - 32 bits perhaps - rather than an 8-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, like Modula-2, expanded the built-in set to cover most machine data types like 16-bit integers.
The packed
keyword tells the compiler to use the most efficient method of storage for the structured data types: sets, arrays and records, rather than using one word for each element. Packing may slow access on machines that do not offer easy access to parts of a word.
Subrange types
Subranges of any ordinal data type (any simple type except real) can also be made:
var x : 1..10; y : 'a'..'z';
Set types
In contrast with other programming languages from its time, Pascal supports a set type:[27]
var Set1 : set of 1..10; Set2 : set of '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:
if i in [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:
if i in [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 as
Record types
An example of a Pascal record type:
type car = record length: integer; width: integer end;
An example of a variant record type:
type Shape = (Circle, Square, Triangle); Dimensions = record case Figure: Shape of Circle: (Diameter: real); Square: (Width: real); Triangle: (Side: real; Angle1, Angle2: 0..360) end;
Variant records allow several fields of the record to overlap each other to save space.
Type declarations
Types can be defined from other types using type declarations:
type x = integer; y = x; ...
Further, complex types can be constructed from simple types:
type a = array[1..10] of integer; b = record x : integer; y : char {extra semicolon not strictly required} end; c = file of a;
Further, complex types can be constructed from other complex types recursively:
const Jack = 11; Queen = 12; King = 13; Ace = 14; type valueType = 2..Ace; suitType = club, diamond, heart, spade; cardType = record suit: suitType; value: valueType; end; deckType = array [1..52] of cardType; person = record surname: packed array [1..20] of char; age: integer; end; table = record hands: array [1..3] of deckType; players: array [1..4] of person; end;
File type
type a = file of integer; b = record x : integer; y : char end; c = file of b;
As shown in the example above, Pascal files are sequences of components. Every file has a buffer variable which is denoted by f^. The procedures get (for reading) and put (for writing) move the buffer variable to the next element. Read is introduced such that read(f, x) is the same as x := f^; get(f);. Write is introduced such that write(f, x) is the same as f^ := x; put(f); The type text
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.
Pointer types
Pascal supports the use of pointers:
type pNode = ^Node; Node = record a : integer; b : char; c : pNode end; var NodePtr : pNode; IntPtr : ^integer;
Here the variable NodePtr is a pointer to the data type Node, a record. Pointers can be used before they are declared. This is a forward declaration, an exception to the rule that things must be declared before they are used.
To create a new record and assign the value 10 and character A to the fields a and b in the record, and to initialise the pointer c to the null pointer ("NIL" in Pascal), the statements would be:
new(NodePtr); ... NodePtr^.a := 10; NodePtr^.b := 'A'; NodePtr^.c := nil; ...
This could also be done using the with
statement, as follows:
new(NodePtr);
...
with NodePtr^ do
begin
a := 10;
b := 'A';
c := nil
end;
...
Inside of the scope of the with statement, a and b refer to the subfields of the record pointer NodePtr and not to the record Node or the pointer type pNode.
Linked lists, stacks and queues 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 for
Some of these restrictions can be lifted in newer dialects.
Control structures
Pascal is a
while a <> b do WriteLn('Waiting'); if a > b then WriteLn('Condition met') {no semicolon allowed before else} else WriteLn('Condition not met'); for i := 1 to 10 do {no semicolon here as it would detach the next statement} WriteLn('Iteration: ', i); repeat a := a + 1 until a = 10; case i of 0 : Write('zero'); 1 : Write('one'); 2 : Write('two'); 3,4,5,6,7,8,9,10: Write('?') end;
Procedures and functions
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.
program Printing(output); var i : integer; procedure PrintAnInteger(j : integer); begin ... end; function triple(x: integer): integer; begin triple := x * 3 end; 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 efficient
Semicolons as statement separators
Pascal adopted many language syntax features from the ALGOL language, including the use of a semicolon as a statement separator. This is in contrast to other languages, such as PL/I and C, which use the semicolon as a statement terminator. No semicolon is needed before the end
keyword of a record type declaration, a block, or a case statement; before the until
keyword of a repeat statement; and before the else
keyword of an if statement.
The presence of an extra semicolon was not permitted in early versions of Pascal. However, the addition of ALGOL-like empty statements in the 1973 Revised 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 the else
keyword in an if statement, because the else
follows a single statement, not a statement sequence. In the case of nested ifs, a semicolon cannot be used to avoid the dangling 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 explicit begin
...end
block must be used.[29]
Resources
Compilers and interpreters
Several Pascal compilers and interpreters are available for general use:
- Delphi is Embarcadero's (formerly Borland/CodeGear) flagship rapid application development (RAD) product. It uses the Object Pascal language (termed 'Delphi' by Borland), descended from Pascal, to create applications for Windows, macOS, iOS, and Android. 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 years Unicode support and generics were added (D2009, D2010, Delphi XE).
- Free Pascal is a cross-platform compiler written in Object Pascal (and is self-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 the GNU General Public License (GNU GPL), while packages and runtime library come under a modified GNU Lesser General Public License (GNU LGPL). In addition to compatibility modes for Turbo Pascal, Delphi, and Mac Pascal, it has its own procedural and object-oriented syntax modes with support for extended features such as operator overloading. It supports many platforms and operating systems. Current versions also feature an ISO mode.
- Intel 8051 family of microcontrollers, with Turbo Pascal7 syntax.
- Oxygene (formerly named Chrome) is an Object Pascal compiler for the .NET and Mono platforms. It was created and is sold by RemObjects Software, and sold for a while by Embarcadero as the backend compiler of Prism.
- 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 the GNU Compiler Collection (GCC). The compiler is written in C, the runtime library mostly in Pascal. Distributed under the GNU 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-P4compiler, the basis for many subsequent Pascal-implemented-in-Pascal compilers. It implements a subset of full Pascal.
- Pascal-P5compiler 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.
- Smart Mobile Studio is a Pascal to HTML5/JavaScript compiler
- floppy disk driveswere 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.
- Pascal'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.
- Pascal-XT was created by Siemens for their mainframe operating systems BS2000 and SINIX.
- PocketStudio is a Pascal subset compiler and RAD tool for source code editor.
- MIDletPascal – A Pascal compiler and IDE that generates small and fast Java bytecode specifically designed to create software for mobiles.
- Vector Pascal is a language for SIMD instruction sets such as the MMX and the AMD 3d Now, supporting all Intel and AMD processors, and Sony's PlayStation 2 Emotion Engine.
- Morfik Pascal allows the development of Web applications entirely written in Object Pascal (both server and browser side).
- WDSibyl – Visual Development Environment and Pascal compiler for Win32 and OS/2.
- PP Compiler, a compiler for Palm OS that runs directly on the handheld computer.
- CDC 6000 Pascal compiler is the source code for the first (CDC 6000) Pascal compiler.
- Pascal-S[30]
- AmigaPascal is a free Pascal compiler for Amiga systems.
- VSI Pascal for OpenVMS (formerly HP Pascal for OpenVMS, Compaq Pascal, DEC Pascal, VAX Pascal and originally VAX-11 Pascal
- 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.
IDEs
- Dev-Pascal is a Pascal IDE that was designed in Borland Delphi and which supports Free Pascal and GNU Pascal as backends.
- Lazarus is a free Delphi-like visual cross-platform IDE for rapid application development (RAD). Based on Free Pascal, Lazarus is available for numerous platforms including Linux, FreeBSD, macOS and Microsoft Windows.
- Fire (macOS) and Water (Windows) for the Oxygene and the Elements Compiler
Libraries
- WOL Library for creating GUI applications with the Free Pascal Compiler.
Standards
ISO/IEC 7185:1990 Pascal
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 of
Niklaus Wirth himself referred to the 1974 language as "the Standard", for example, to differentiate it from the machine specific features of the
On the large machines (mainframes and minicomputers) Pascal originated on, the standards were generally followed. On the IBM 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.
ISO/IEC 10206:1990 Extended Pascal
![]() | This section needs expansion. You can help by adding 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 in
Variations
Niklaus Wirth's Zürich version of Pascal was issued outside
UCSD Pascal, under Professor Kenneth 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,
Borland-like Pascal compilers
Borland's Turbo Pascal, written by Anders 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.
The
Software products (
- Turbo Pascal – "TURBO.EXE" up to version 7, and Turbo Pascal for Windows ("TPW") and Turbo Pascal for Macintosh.
- Pure Pascal and HiSPeed Pascal 2 Pascal language Environment for the Atari ST range of computers.
- Borland Pascal 7 – A professional version of Turbo Pascal line which targeted both DOS and Windows.
- Apple Computer by a team led by Larry Tesler in consultation with Niklaus Wirth, the inventor of Pascal; its features were added to Borland's Turbo Pascal for Macintoshand in 1989 for Turbo Pascal 5.5 for DOS.
- 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 a Linux version of the Borland Delphi software development environment and C++Builder.
- Lazarus – similar to Kylix in function, is a free cross-platform visual IDE for RAD using the Free Pascal compiler, which supports dialects of Object Pascalto 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] for Microsoft Windows and OS/2, a commercial Borland Pascal compatible environment released by a company named Speedsoft that was later developed into a Delphi-like rapid 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, an open 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 is IBM System Object Model (SOM), WPS and OpenDoc.[44]
List of related standards
- ISO 8651-2:1988 Information processing systems – Computer graphics – Graphical Kernel System (GKS) language bindings – Part 2: Pascal
Reception
Pascal generated a wide variety of responses in the computing community, both critical and complimentary.
Early criticism
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 for data types, ranges, structures, and goto.[45] Later, Brian Kernighan, who popularized the C 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 of static 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 using forward declarations to define pointer types, or when record declarations led to mutual recursion, or when an identifier may or may not have been used in an enumeration list. Another difficulty was that, like ALGOL 60, the language did not allow procedures or functions passed as parameters to predefine the expected type of their parameters.
Rising popularity in the 1970s and 1980s
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's Turbo 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]
Notes
- a device that we now classify as a digital computer."[4]
See also
- Ada (programming language)
- Concurrent Pascal
- Comparison of Pascal and Delphi
- Comparison of Pascal and C
- Modula-2
- Oberon (programming language)
- Object Pascal
- PascalCase
- Standard ML
References
- ^ "About Microsoft's "Delegates"". Archived from the original on 2012-06-27.
We looked very carefully at Delphi Object 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 Delphi Object Pascal.
- ^ TechMetrix Research (1999). "History of Java" (PDF). Java Application Servers Report. Archived from the original (PDF) on 2010-12-29. Retrieved 2009-10-16.
The project went ahead under the name "green" and the language was based on an old model of UCSD Pascal, which makes it possible to generate interpretive code
- ^ "A Conversation with James Gosling – ACM Queue". Archived from the original on 16 July 2015. Retrieved 11 August 2015.
- (PDF) from the original on 2024-05-20. Retrieved 2024-08-13.
- ISBN 978-3-540-67958-5.
- .
- ISBN 0-201-89502-1.
- ^ Hertzfeld, Andy. "Hungarian folklore.org Archived 2015-11-18 at the Wayback Machine: Macintosh Stories. Retrieved 2012-03-06.
- ^ https://www.computerhistory.org/atchm/adobe-photoshop-source-code/ Archived 2014-05-07 at the Wayback Machine, Adobe Photoshop Source Code
- ^ "RAD Studio Application Showcase". 2021-10-29.
- ^ tiobe.com Archived 2012-03-15 at the Wayback Machine, Programming Community Index for January 2011.
- ^ "Antique Software: Turbo Pascal v5.5". Archived from the original on 2010-11-24. Retrieved 2018-05-17.
- ^ Computers and Computing. A Personal Perspective. Archived 2017-05-10 at the Wayback Machine by Niklaus Wirth
- ^ cbi.umn.edu, "An Interview with John Brackett and Doug Ross"[permanent dead link ], p15, Charles Babbage Institute, 2004
- ^ Australian Atomic Energy Commission Research Establishment, Lucas Heights, Nuclear Science and Technology Branch Report, Divisional Research (PDF). International Atomic Energy Agency (IEAE) (Report). 1977. p. 22.
- ^ Jon Udell, Crash of the Object-Oriented Pascals, BYTE, July, 1989.
- ^ M. I. Trofimov, The End of Pascal?, BYTE, March, 1990, p. 36.
- .
- IDG Business Media GmbH. Archived from the originalon 2016-05-30. Retrieved 2016-05-30.
- ^ "Pascal-XSC: Pascal for Extended Scientific Computing". Archived from the original on 2014-01-05.
- ^ "XSC Software". Archived from the original on 1 November 2015. Retrieved 11 August 2015.
- ^ "Universitaet Wuppertal: Wissenschaftliches Rechnen / Softwaretechnologie". Archived from the original on 6 November 2015. Retrieved 11 August 2015.
- ISBN 0-471-92437-7.
- ^ Michel Gien, "The SOL Operating System", in Usenix Summer '83 Conference, Toronto, ON, (July 1983), pp. 75–78
- ^ "Overview of the CHORUS Distributed Operating Systems" (PDF). Chorus systems. 1991. Archived from the original (PDF) on February 7, 2015 – via cs.berkeley.edu.
- ^ Pascal ISO 7185:1990 Archived 2012-06-17 at the Wayback Machine 6.10
- ISBN 978-0-314-33935-5.
- ^ a b J. Welsh, W. J. Sneeringer, and C. A. R. Hoare, "Ambiguities and Insecurities in Pascal", Software: Practice and Experience 7, pp. 685–696 (1977)
- ^ Pascal, Nell Dale and Chip Weems, "Dangling Else", p. 160–161 Archived 2017-03-18 at the Wayback Machine
- ^ "Pascal-S: A Subset and Its Implementation", N. Wirth in Pascal – The Language and Its Implementation, by D.W. Barron, Wiley 1979.
- ^ "VAX-11 Pascal V1.0 User's Guide" (PDF).
- ^ a b "VSI Pascal for OpenVMS Software Product Description" (PDF). VSI. 2017. Archived from the original (PDF) on 2021-04-18. Retrieved 2022-02-07.
- ^ "Interview with a Pascal Architect - Compaq Pascal". Archived from the original on 2021-10-19. Retrieved 2022-05-28.
- ^ "Compaq Pascal Version 5.8 for Tru64 UNIX Software Product Description". Archived from the original on 2020-07-25. Retrieved 2022-05-28.
- ^ "VSI's John Reagan Interview on GEM vs. LLVM for X86/64". eCube Systems. 2019-03-12. Archived from the original on 2020-08-12. Retrieved 2022-02-07.
- ^ ISO/IEC 7185:1990 Pascal (PDF). Archived from the original (PDF) on 27 January 2016. Retrieved 16 September 2014.
- .
- ^ Extended Pascal: ISO/IEC 10206:1990. Archived from the original on 2016-03-27. Retrieved 16 September 2014.
- ^ "Language standards: Pascal, Extended Pascal, Fortan". Archived from the original on 2014-07-14. Retrieved 16 September 2014.
- ISBN 978-0-7381-4247-0.
- ^ "Extended Pascal - Free Pascal wiki". wiki.freepascal.org.
- ^ "Virtual Pascal for OS/2". Archived from the original on 30 August 2011. Retrieved 3 April 2016.
- ^ Wolfgang (October 15, 2020). "WDSibyl: Visual Development Environment". WDSibyl.org. Archived from the original on 2020-02-12. Retrieved 2020-04-20.
- ^ "netlabs.org – Project: Open Sibyl". Archived from the original on 4 March 2016. Retrieved 3 April 2016.
- )
- ^ Brian W. Kernighan (1981). "Why Pascal is Not My Favorite Programming Language". Archived 2009-04-28 at the Wayback Machine
- .
- ^ Crespo, Diego. "Pascal: The language that almost took over the world part 1". www.deusinmachina.net. Retrieved 4 January 2025.
- ^ "Extended Pascal". Archived from the original on 2015-10-18. Retrieved 2015-10-17.
- ^ Crespo, Diego. "Pascal: The language that almost took over the world part 2". www.deusinmachina.net. Retrieved 4 January 2025.
Further reading
- Niklaus Wirth: The Programming Language Pascal. 35–63, Acta Informatica, Volume 1, 1971.
- 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.
- Kathleen Jensen and Niklaus Wirth: Pascal – User Manual and Report. Springer-Verlag, 1974, 1985, 1991, ISBN 3-540-97649-3.
- Niklaus Wirth: ISBN 0-13-022418-9.
- Niklaus Wirth: An assessment of the programming language Pascal. 23–30 ACM SIGPLAN Notices Volume 10, Issue 6, June 1975.
- N. Wirth, and A. I. Wasserman, ed: Programming Language Design. IEEE Computer Society Press, 1980
- D. W. Barron (Ed.): Pascal – The Language and its Implementation. John Wiley 1981, ISBN 0-471-27835-1
- Peter Grogono: Programming in Pascal, Revised Edition, Addison-Wesley, 1980
- Richard S. Forsyth: Pascal in Work and Play, Chapman and Hall, 1982
- N. Wirth, M. Broy, ed, and E. Denert, ed: Pascal and its Successors in Software Pioneers: Contributions to Software Engineering. Springer-Verlag, 2002, ISBN 3-540-43081-4
- N. Wirth: Recollections about the Development of Pascal. ACM SIGPLAN Notices, Volume 28, No 3, March 1993.