In computer science, imperative programming is a programming paradigm that describes computation in terms of statement s that change a program state .... and procedural
Procedural programming
Procedural programming can sometimes be used as a synonym for imperative programming , but can also refer to a programming paradigm based upon the concept of the procedure call.... programming language
Programming language
A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer.... , designed in 1968/9 and published in 1970 by Niklaus Wirth
Niklaus Wirth
Niklaus Emil Wirth is a Switzerland computer science, best known for designing several programming languages, including Pascal , and for pioneering several classic topics in software engineering.... as a small and efficient language intended to encourage good programming practices using structured programming
Structured programming
Structured programming can be seen as a subset or subdiscipline of procedural programming, one of the major programming paradigms. It is most famous for removing or reducing reliance on the GOTO Statement .... and data structuring
Data structure
A data structure in computer science is a way of storing data in a computer so that it can be used efficiently. It is an organization of mathematical and logical concepts of data.... .
Object Pascal refers to a branch of Object-oriented programming derivatives of Pascal , mostly known as the primary programming language of CodeGear Delphi.... was designed for object oriented programming
Object-oriented programming
Object-oriented programming is a programming paradigm that uses "Object_" and their interactions to design applications and computer programs.... . al is based on the ALGOL
Algol
Algol , known colloquially as the Demon Star, is a bright star in the constellation Perseus . It is one of the best known eclipsing binary, the first such star to be discovered, and also one of the first variable stars to be discovered.... programming language and named in honor of the French
France
France , officially the French Republic , is a country whose Metropolitan France is located in Western Europe and that also comprises various Overseas departments and territories of France.... mathematician and philosopher Blaise Pascal
Blaise Pascal
Blaise Pascal , was a France mathematician, physicist, and religion philosopher. He was a child prodigy who was educated by his father, a civil servant.... . Wirth subsequently developed the Modula-2
Modula-2
Modula-2 is a computer programming language invented by Niklaus Wirth at ETH, around 1978, as a successor to his intermediate language Modula. Modula-2 was implemented in 1980 for the Lilith computer, which was commercialized in 1982 by startup company DISER as MC1 and MC2.... and Oberon, languages similar to Pascal.
Discussion
Ask a question about 'Pascal (programming language)'
Start a new discussion about 'Pascal (programming language)'
In computer science, imperative programming is a programming paradigm that describes computation in terms of statement s that change a program state .... and procedural
Procedural programming
Procedural programming can sometimes be used as a synonym for imperative programming , but can also refer to a programming paradigm based upon the concept of the procedure call.... programming language
Programming language
A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer.... , designed in 1968/9 and published in 1970 by Niklaus Wirth
Niklaus Wirth
Niklaus Emil Wirth is a Switzerland computer science, best known for designing several programming languages, including Pascal , and for pioneering several classic topics in software engineering.... as a small and efficient language intended to encourage good programming practices using structured programming
Structured programming
Structured programming can be seen as a subset or subdiscipline of procedural programming, one of the major programming paradigms. It is most famous for removing or reducing reliance on the GOTO Statement .... and data structuring
Data structure
A data structure in computer science is a way of storing data in a computer so that it can be used efficiently. It is an organization of mathematical and logical concepts of data.... .
Object Pascal refers to a branch of Object-oriented programming derivatives of Pascal , mostly known as the primary programming language of CodeGear Delphi.... was designed for object oriented programming
Object-oriented programming
Object-oriented programming is a programming paradigm that uses "Object_" and their interactions to design applications and computer programs.... .
Algol , known colloquially as the Demon Star, is a bright star in the constellation Perseus . It is one of the best known eclipsing binary, the first such star to be discovered, and also one of the first variable stars to be discovered.... programming language and named in honor of the French
France
France , officially the French Republic , is a country whose Metropolitan France is located in Western Europe and that also comprises various Overseas departments and territories of France.... mathematician and philosopher Blaise Pascal
Blaise Pascal
Blaise Pascal , was a France mathematician, physicist, and religion philosopher. He was a child prodigy who was educated by his father, a civil servant.... . Wirth subsequently developed the Modula-2
Modula-2
Modula-2 is a computer programming language invented by Niklaus Wirth at ETH, around 1978, as a successor to his intermediate language Modula. Modula-2 was implemented in 1980 for the Lilith computer, which was commercialized in 1982 by startup company DISER as MC1 and MC2.... and Oberon, languages similar to Pascal. Before, and leading up to Pascal, Wirth developed the language Euler, followed by Algol-W.
Initially, Pascal was largely, but not exclusively, intended to teach students structured programming
Structured programming
Structured programming can be seen as a subset or subdiscipline of procedural programming, one of the major programming paradigms. It is most famous for removing or reducing reliance on the GOTO Statement .... . Generations of students have "cut their teeth" on Pascal as an introductory language in undergraduate courses. Variants of Pascal have also frequently been used for everything from research projects to PC games and embedded systems. Newer Pascal compilers exist which are widely used.
Pascal was the primary high-level language used for development in the Apple Lisa
Apple Lisa
The Apple Lisa was a personal computer designed at Apple Computer, Inc. during the early 1980s.The Lisa project was started at Apple in 1978 and evolved into a project to design a powerful personal computer with a graphical user interface that would be targeted toward business customers.... , and in the early years of the Mac; parts of the original Macintosh operating system were hand-translated into Motorola 68000
Motorola 68000
The Motorola 68000 is a 16/32-bit Complex instruction set computer microprocessor core designed and marketed by Freescale Semiconductor .... assembly language
Assembly language
An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture.... from the Pascal sources. The popular typesetting
Typesetting
Typesetting involves the presentation of textual material in graphic form on paper or some other Recording medium. Before the advent of desktop publishing, typesetting of printed material was produced in print shops by compositors or typesetters working by hand, and later with machines.... system TeX
TeX
TeX is a typesetting system designed and mostly written by Donald Knuth. Together with the METAFONT language for font description and the Computer Modern typefaces, it was designed with two main goals in mind: to allow anybody to produce high-quality books using a reasonable amount of effort, and to provide a system that would give the exact... by Donald E. Knuth was written in WEB
Literate programming is an approach to programming which was introduced by Donald Knuth. Knuth conceived literate programming as an alternative to the structured programming paradigm of the 1970s.... system, based on DEC
Digital Equipment Corporation
Digital Equipment Corporation was a pioneering United States company in the computer industry. It is often referred to within the computing industry as DEC .... PDP-10
PDP-10
The PDP-10 was a mainframe computer manufactured by Digital Equipment Corporation from the late 1960s on; the name stands for "Programmed Data Processor model 10".... Pascal, while an application like Total Commander
Total Commander
Total Commander is a shareware Orthodox file manager for Microsoft Windows. Some features include a built-in File Transfer Protocol client, file compare, archive file navigation, and a multi-rename tool.... was written in Delphi (i.e. Object Pascal
Object Pascal
Object Pascal refers to a branch of Object-oriented programming derivatives of Pascal , mostly known as the primary programming language of CodeGear Delphi.... ).
Brief description
Wirth's intention was to create an efficient language (regarding both compilation speed and generated code) based on so-called structured programming
Structured programming
Structured programming can be seen as a subset or subdiscipline of procedural programming, one of the major programming paradigms. It is most famous for removing or reducing reliance on the GOTO Statement .... , a concept which had recently become popular. Pascal has its roots in the Algol 60 language, but also introduced concepts and mechanisms which (on top of Algol's scalars and arrays) enabled programmers to define their own complex (structured) datatypes, and also made it easier to build dynamic and recursive data structures such as lists, trees and graphs. Important features included for this were records, enumerations, subranges, dynamically allocated variables with associated pointers, and sets. To make this possible and meaningful, Pascal has a strong typing on all objects, which means that one type of data cannot be converted or interpreted as another without explicit conversions. Similar mechanisms are standard in many programming languages today. Other languages that influenced Pascal's development were COBOL
COBOL
COBOL is one of the oldest programming languages still in active use. Its name is an acronym for COmmon Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments.... , Simula 67, and Wirth's own Algol-W .
Pascal, like many scripting languages of today (but unlike most languages in the C family), allows nested procedure definitions to any level of depth, and also allows most kinds of definitions and declarations inside procedures and functions. This enables a very simple and coherent syntax where a complete program is syntactically nearly identical to a single procedure or function (except for the keyword itself, of course).
A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program.... was designed in Zurich for the CDC 6000 series
CDC 6000 series
The CDC 6000 series was a family of mainframe computers manufactured by Control Data Corporation in the 1960s. It consisted of CDC 6400, CDC 6500, CDC 6600 and CDC 6700 computers, which all were extremely rapid and efficient for their time.... mainframe computer
Mainframe computer
Mainframes are computers used mainly by large organizations for critical applications, typically bulk data processing such as census, industry and consumer statistics, Enterprise Resource Planning, and financial transaction processing.... family. Niklaus Wirth reports that a first attempt to implement it in Fortran
Fortran
Fortran is a general-purpose programming language, procedural programming language, imperative programming language programming language that is especially suited to numerical analysis and scientific computing.... in 1969 was unsuccessful due to Fortran's inadequacy to express complex data structures. The second attempt was formulated in the Pascal language itself and was operational by mid-1970. Many Pascal compilers since have been similarly self-hosting
Self-hosting
The term self-hosting was coined to refer to the use of a computer program as part of the toolchain or operating system that produces new versions of that same program?for example, a compiler that can compile its own source code.... , 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 be ported
Porting
In computer science, porting is the process of adapting software so that an executable Computer program can be created for a computing environment that is different from the one for which it was originally designed .... to a new environment. The GNU Pascal
GNU Pascal
GNU Pascal is a Pascal programming language compiler comprised of a frontend to GNU Compiler Collection, similar to the way Fortran and other languages were added to GCC.... 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 the QUB
Queen's University of Belfast
Queen's University Belfast is a university in Belfast, Northern Ireland. The university's official title, per its charter, is "The Queen's University of Belfast".... in 1972. The target was the ICL 1900
ICT 1900
ICT 1900 is the name given to a series of mainframe computers released by International Computers and Tabulators in the 1960s.... series. This compiler in turn was the parent of the Pascal compiler for the 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 in Glasgow University. It is thought that Multum Pascal, which was completed in the summer of 1973, may have been the first 16-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 the ICL 2900 series by a team based at Southampton University and Glasgow University. The Standard Pascal Model Implementation was also based on this compiler, having been adapted, by Welsh and Hay at Manchester University in 1984, to check rigorously for conformity to the BSI 6192/ISO 7185 Standard and to generate code for a portable abstract machine.
A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program.... written in North America was constructed at the University of Illinois
University of Illinois at Urbana-Champaign
The University of Illinois at Urbana-Champaign is a public university research university in the state of Illinois, United States. It is the oldest and largest campus in the University of Illinois system.... under Donald B. Gillies
Donald B. Gillies
Donald Bruce Gillies was a Canadian mathematician and computer scientist, known for his work in game theory, computer design, and minicomputer programming environments.... for the PDP-11
PDP-11
The PDP-11 was a series of 16-bit minicomputers sold by Digital Equipment Corporation from 1970 into the 1990s. Though not explicitly conceived as successor to DEC's PDP-8 computer in the Programmed Data Processor series of computers , the PDP-11 replaced the PDP-8 in many Real-time computing.... and generated native machine code. Pascal enjoyed great popularity throughout the 1970s and the 1980s.
In order to rapidly propagate the language, a compiler "porting kit" was created in Zurich that included a compiler that generated code for a "virtual" stack machine (i.e. code that lends itself to reasonably efficient interpretation), along with an interpreter for that code - the Pascal-P system. Although the SC (Stack Computer) code was primarily intended to be compiled into true machine code, at least one system, the notable UCSD implementation, utilized it to create the interpretive
Interpreter (computing)
In computer science, an interpreter normally means a computer program that execution , i.e. performs, instructions written in a programming language.... UCSD p-System. The P-system compilers were termed P1-P4, with P1 being the first version, and P4 being the last to come from Zurich.
The P4 compiler/interpreter can still be run and compiled on systems compatible with original Pascal. However, it only itself accepts a subset of the Pascal language. A version of P4 that accepts the full Pascal language and includes ISO 7185 compatibility was created and termed the P5 compiler, which is available in source form.
A version of the P4 compiler, which created native binaries, was released for the IBM System/370 mainframe computer
Mainframe computer
Mainframes are computers used mainly by large organizations for critical applications, typically bulk data processing such as census, industry and consumer statistics, Enterprise Resource Planning, and financial transaction processing.... by the Australian Atomic Energy Commission
Australian Atomic Energy Commission
The Australian Atomic Energy Commission was a statutory body of the Australian government.It was established in 1952, replacing the Atomic Energy Policy Committee.... ; it was called the "AAEC Pascal Compiler" after the abbreviation of the name of the Commission. A version of P4 from 1975-6 including source and binaries for the compiler and run-time library files for the PDP-10
PDP-10
The PDP-10 was a mainframe computer manufactured by Digital Equipment Corporation from the late 1960s on; the name stands for "Programmed Data Processor model 10".... mainframe may be downloaded from [ftp://pdp-10.trailing-edge.com/pub/pdp10freewarev2/lib20/0003/ this link].
Watcom International Corporation was founded in 1981 by three former employees of the Computer Systems Group at the University of Waterloo, in Waterloo, Ontario, Ontario, Canada.... Pascal was developed, also for the IBM System 370.
IP Pascal is an implementation of the Pascal programming language using the IP portability platform, a multiple machine, operating system and language implementation system.... was an implementation of the Pascal programming language using Micropolis DOS, but was moved rapidly to CP/M
CP/M
CP/M is an operating system originally created for Intel 8080/Intel 8085 based microcomputers by Gary Kildall of Digital Research. Initially confined to single tasking on 8-bit processors and no more than 64 kilobytes of memory, later versions of CP/M added multi-user variations, and were migrated to 16-bit processors.... running on the Z80
Zilog Z80
The Zilog Z80 is an 8-bit microprocessor designed and sold by Zilog from July 1976 onwards. It was widely used both in desktop and embedded computer designs as well as for military purposes.... . It was moved to the 80386 machine types in 1994, and exists today as Windows/XP and Linux implementations. In 2008, the system was brought up to a new level and the resulting language termed "Pascaline" (after Pascal's calculator). It includes objects, namespace controls, dynamic arrays, along with many other extensions, and generally features the same functionality and type protection as C#. It is the only such implementation which is also compatible with the original Pascal implementation (which is standardized as ISO 7185).
In the early 1980s, UCSD Pascal was ported to the Apple II and Apple III
Apple III
The Apple III was a personal computer aimed at business users, manufactured and sold by Apple Inc. from May, 1980 until its discontinuation on April 24, 1984.... computers to provide a structured alternative to the BASIC
BASIC
In computer programming, BASIC is a family of high-level programming languages. The Dartmouth BASIC was designed in 1964 by John George Kemeny and Thomas Eugene Kurtz at Dartmouth College in New Hampshire, United States to provide computer access to non-science students.... interpreters that came with the machines.
Apple Computer created its own Lisa Pascal for the Lisa Workshop in 1982 and ported this compiler to the Apple Macintosh and MPW
MPW
MPW might stand for:* Macintosh Programmer's Workshop* Multi Project Wafer * Michinoku Pro Wrestling... 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.
Anders Hejlsberg is a prominent Denmark software engineer who co-designed several popular and commercially successful programming languages and development tools.... wrote the Blue Label Pascal compiler for the Nascom-2
Nascom
The Nascom 1 and 2 were single-board computer kits issued in 1977 and 1979, respectively, based on the Zilog Z80 and including a computer keyboard and video interface, a serial port that could be used for storing data on a compact audio cassette using the Kansas City standard, and two 8-bit parallel communications.... . A reimplementation of this compiler for the IBM PC
IBM PC
The IBM Personal Computer, commonly known as the IBM PC, is the original version and progenitor of the IBM PC compatible hardware platform .... was marketed under the names Compas Pascal and PolyPascal before it was acquired by Borland
Borland
Borland Software Corporation is a Computer software company headquartered in Austin, Texas. It was founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn.... . Renamed to Turbo Pascal
Turbo Pascal
Turbo Pascal is a complete software development system that includes a compiler and an Integrated Development Environment for the Pascal programming language running under CP/M, CP/M-86, and MS-DOS, developed by Borland under Philippe Kahn's leadership.... it became hugely popular, thanks in part to an aggressive pricing strategy and in part to having one of the first full-screen Integrated development environment
Integrated development environment
An integrated development environment also known as integrated design environment or integrated debugging environment is a software application that provides comprehensive facilities to computer programmers for software development.... s. Additionally, it was written and highly optimized entirely in assembly language
Assembly language
An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture.... , making it smaller
Memory footprint
Memory footprint refers to the amount of main Random access memory that a program uses or references while running.This includes all sorts of active memory regions like code, static data sections , heap, as well as all the stacks, plus memory required to hold any additional data structures, such as symbol tables, constant tables, debugging... 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.
The inexpensive Borland compiler had a large influence on the Pascal community that 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 adoption by professional developers. Around the same time a number of concepts were imported from C
C (programming language)
C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system.... in order to let Pascal programmers use the C-based API
Application programming interface
An application programming interface is a set of subroutine, data structures, class and/or Protocol provided by library and/or operating system Service s in order to support the building of applications.... of Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces .... directly. These extensions included null-terminated string
String (computer science)
In computer programming and some branches of mathematics, a string is an ordered sequence of symbols. These symbols are chosen from a predetermined set or alphabet.... s, pointer arithmetic, function pointer
Function pointer
A function pointer is a type of pointer in C , C++, D programming language, and other C-like programming languages. When Dereference operator, a function pointer invokes a subroutine, passing it zero or more arguments just like a normal function.... s, an address-of operator and unsafe typecasts
Type conversion
In computer science, type conversion or typecasting refers to changing an entity of one data type into another. This is done to take advantage of certain features of type hierarchies.... .
However, Borland later decided it wanted more elaborate object-oriented features, and started over in Delphi
Borland Delphi
Delphi is a software development environment for Microsoft Windows applications. It has always supported development of native Windows applications in the Delphi programming language, a further development of Object Pascal.... using the Object Pascal
Object Pascal
Object Pascal refers to a branch of Object-oriented programming derivatives of Pascal , mostly known as the primary programming language of CodeGear Delphi.... draft standard proposed by Apple
Apple Computer
Apple Inc., formerly Apple Computer Inc., is an United States multinational corporation which designs and manufactures consumer electronics and software products.... as a basis. (This Apple draft is still not a formal standard.) The first versions of the Delphi Programming Language were accordingly named Object Pascal. The main additions compared to the older OOP extensions were a reference-based object model, virtual constructors and destructors, and properties. Several other compilers also implement this dialect.
Turbo Pascal is a complete software development system that includes a compiler and an Integrated Development Environment for the Pascal programming language running under CP/M, CP/M-86, and MS-DOS, developed by Borland under Philippe Kahn's leadership.... , and other derivatives with units or module concepts are modular languages
Modularity (programming)
Modular programming is a software design technique that increases the extent to which software is composed from separate parts, called modules. Conceptually, modules represent a separation of concerns, and improve maintainability by enforcing logical boundaries between components.... . However, it does not provide a nested module concept or qualified import and export of specific symbols.
Super Pascal was a variant which added non-numeric labels, a return statement and expressions as names of types.
Karlsruhe is a city in the south west of Germany, in the States of Germany Baden-W?rttemberg, located near the France-German border.Founded in 1715 as Karlsruhe Palace, the surrounding town became the seat of two of the highest courts in Germany, the Federal Constitutional Court of Germany whose decisions have the force of a law, and the... and Wuppertal
Wuppertal
||-||}Wuppertal is a city in North Rhine-Westphalia, Germany. It is located on the Wupper river south of the Ruhr area. Population 361,333 .... have developed an EXtension for Scientific Computing (Pascal XSC), which provides a free solution for programming numerical computations with controlled precision.
Morfik Technology Pty Ltd., an Australian company, is the developer of WebOS AppsBuilder, an Integrated development environment aimed at developing Ajax applications in a high-level language such as Java , C Sharp , BASIC or Object Pascal.... Technology introduced a tool which allowed the development of Web applications entirely written in Morfik Pascal. Morfik Pascal is a dialect of Object Pascal, very close to Delphi.
Language constructs
Pascal, in its original form, is a purely procedural language and includes the traditional array of Algol-like control structures with reserved words such as if, then, else, while, for, and so on. However, Pascal also has many data structuring facilities and other abstractions which were not included in the original Algol60, like type definitions
Type system
In computer science, a type system may be defined as "a tractable syntactic method for proving the absence of certain program behaviors by classifying phrases according to the kinds of values they compute.".... , record
Record (computer science)
In computer science, a record type or struct is a type whose values are records, i.e. aggregates of several items of possibly different types.... s, pointers, enumeration
Enumerated type
In computer programming, an enumerated type is a data type consisting of a set of named constants called enumerators. The act of creating an enumerated type defines an enumeration.... s, and set
Set
A set is a collection of distinct objects, considered as an object in its own right. Sets are one of the most fundamental concepts in mathematics.... s. Such constructs were in part inherited or inspired from Simula67, Algol68, Niklaus Wirth
Niklaus Wirth
Niklaus Emil Wirth is a Switzerland computer science, best known for designing several programming languages, including Pascal , and for pioneering several classic topics in software engineering.... 's own AlgolW and suggestions by C. A. R. Hoare
C. A. R. Hoare
Sir Charles Antony Richard Hoare , commonly known as Tony Hoare or C.A.R. Hoare, is a United Kingdom computer science, probably best known for the development in 1960 of Quicksort , one of the world's most widely used sorting algorithms.... .
In computer programming, a keyword is a word or identifier that has a particular meaning to the programming language. The meaning of keywords ? and, indeed, the meaning of the notion of keyword ? differs widely from language to language.... with a list of external file descriptors as parameters; then follows the main statement block
Statement block
In computer programming, a statement block is a section of computer code which is grouped together, much like a paragraph; such blocks consist of one, or more, statement .... encapsulated by the begin and end keywords. Semicolon
Semicolon
A semicolon is a conventional punctuation mark with several uses, mainly for pauses in sentences. The Italy printer Aldus Manutius the Elder established the practice of using the semicolon mark to separate words of opposed meaning, and to indicate interdependent statements.... s separate statements, and the full stop
Full stop
A full stop or period , is the punctuation mark commonly placed at the end of several different types of Sentence s in English language and many other languages.... ends the whole program (or unit). Letter case
Letter case
In orthography and typography, letter case is the distinction between majuscule and Lower case letters. The term originated with the shallow Drawer s called type cases still used to hold the movable type for letterpress printing.... is ignored in Pascal source. Some compilers, Turbo Pascal among them, have made the program keyword optional.
Here is an example of the source code in use for a very simple "Hello world" program:
Program HelloWorld(output);
begin
writeLn('Hello, World!')
end.
Data types
A type in Pascal, and in several other popular programming languages, defines a variable in such a way that it defines a range of values which the variable is capable of storing, and it also defines a set of operations that are permissible to be performed on variables of that type. The types and a very brief description follows;
Data type
Range of values which the variable is capable of storing
In computer science, the term integer is used to refer to a data type which represents some finite subset of the mathematical integers. These are also known as integral data types....
A byte is a basic unit of measurement of Computer storage in computer science. In many computer architectures it is a Byte addressing memory address space....
In computing, floating point describes a system for numerical representation in which a String of digits represents a rational number.The term floating point refers to the fact that the radix point can "float": that is, it can be placed anywhere relative to the Significant figures of the number....
In computer and machine-based telecommunications terminology, a character is a unit of information that roughly corresponds to a grapheme, grapheme-like unit, or symbol, such as in an alphabet or syllabary in the written language form of a natural language....
In computing, floating point describes a system for numerical representation in which a String of digits represents a rational number.The term floating point refers to the fact that the radix point can "float": that is, it can be placed anywhere relative to the Significant figures of the number.... , integer
Integer (computer science)
In computer science, the term integer is used to refer to a data type which represents some finite subset of the mathematical integers. These are also known as integral data types.... , character
Character (computing)
In computer and machine-based telecommunications terminology, a character is a unit of information that roughly corresponds to a grapheme, grapheme-like unit, or symbol, such as in an alphabet or syllabary in the written language form of a natural language.... , boolean and enumeration
Enumerated type
In computer programming, an enumerated type is a data type consisting of a set of named constants called enumerators. The act of creating an enumerated type defines an enumeration.... s, a new type constructor introduced with Pascal:
Subranges of any ordinal type (any simple type except real) can be made:
var
x: 1..10;
y: 'a'..'z';
z: pear..orange;
In contrast with other programming languages from its time, Pascal supports a set type:
var
set1: set of 1..10;
set2: set of 'a'..'z';
set3: set of pear..orange;
A set is fundamental concept for modern mathematics, and they may be used in a great many algorithms. Such a feature is highly 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
...
is faster, than
if (i>4) and (i<11) then
...
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
end;
c = File of a;
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable computer storage.... 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 to inspect the next character that would be used (check for a digit before reading an integer), this concept lead to serious problems with interactive programs with early implementations, but was solved later with the "lazy I/O" concept.
In Jensen & Wirth Pascal, strings are represented as packed arrays of chars; they therefore have fixed length and are usually space-padded. Some dialects have a custom string type.
Pointers
Pascal supports the use of pointers:
type
a = ^b;
b = record
a: Integer;
b: Char;
c: a
end;
var
pointertob: a;
Here the variable pointer_to_b is a pointer to the data type b, 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 nil, the commands would be:
This could also be done using the with statement, as follows
new(pointer_to_b);
with pointertob^ do
begin
a := 10;
b := 'A';
c := nil
end;
...
Note that inside of the scope of the with statement, the compiler knows that a and b refer to the subfields of the record pointer pointertob and not to the record b or the pointer type a.
In computer science, a linked list is one of the fundamental data structures, and can be used to implement other data structures. It consists of a sequence of node s, each containing arbitrary data Field s and one or two reference s pointing to the next and/or previous nodes.... s, stacks
Stack (data structure)
In computer science, a stack is an abstract data type and data structure based on the principle of LIFO . Stacks are used extensively at every level of a modern computer system.... and queues can be created by including a pointer type field (c) in the record (see also nil
Nil
Nil is a word commonly used to mean nothing or 0 . It is one of several names for the number 0. See also null.Specific uses of Nil include:... and null (computer programming)).
Structured programming can be seen as a subset or subdiscipline of procedural programming, one of the major programming paradigms. It is most famous for removing or reducing reliance on the GOTO Statement .... language, meaning that the flow of control is structured into standard statements, ideally without 'go to' commands.
while a <> b do writeln('Waiting');
if a > b then writeln('Condition met')
else writeln('Condition not met');
for i := 1 to 10 do writeln('Iteration: ', i:1);
repeat
a := a + 1
until a = 10;
case i of
0: write('zero');
1: write('one');
2: write('two')
end;
Procedures and functions
Pascal structures programs into procedures and functions.
program mine(output);
var i : integer;
procedure print(var j: integer);
function next(k: integer): integer;
begin
next := k + 1
end;
begin
writeln('The total is: ', j);
j := next(j)
end;
begin
i := 1;
while i <= 10 do print(i)
end.
Procedures and functions can nest to any depth, and the 'program' construct is the logical outermost block.
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 single-pass compilation. However, in some dialects the strict ordering requirement of declaration sections is not required.
Resources
Compilers and interpreters
Several Pascal compilers and interpreters are available for the use of general public:
Rapid application development is a software development methodology, which involves iterative development and the construction of prototypes.... ) product. It uses the Object Pascal language (Dubbed the 'Delphi programming language' by Borland), descended from Pascal, to create applications for the windows platform. 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 backwards compatible. The most recent iteration of the win32 range (D2009) adds unicode and generics support. A version of Delphi (D2006), , is available for free download.
Free Pascal is a free software, Portability , open source, Pascal programming language and Object Pascal compiler. The 32/64-bit multi-CPU architecture and cross-platform compiler implements the Borland Pascal programming language dialects as well as some MacPascal constructs, and is available for... () is a multi-platform compiler written in Pascal (it is Self-hosting
Self-hosting
The term self-hosting was coined to refer to the use of a computer program as part of the toolchain or operating system that produces new versions of that same program?for example, a compiler that can compile its own source code.... ). It is aimed at providing a convenient and powerful compiler, both able to compile legacy applications and to be the means of developing new ones. It is distributed under the GNU GPL. Apart from compatibility modes for Turbo Pascal, Delphi and Mac Pascal, it also 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.
Lazarus is a cross platform Visual programming Integrated development environment which provides a Delphi programming language Clone for Pascal programming language and Object Pascal developers.... () is a Delphi-like visual cross-platform IDE for RAD (Rapid Application Development
Rapid application development
Rapid application development is a software development methodology, which involves iterative development and the construction of prototypes.... ). Based on FreePascal, Lazarus is available for numerous platforms including Linux
Linux
Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed by anyone under the terms of the GNU GPL license... , FreeBSD
FreeBSD
FreeBSD is a Unix-like free software operating system descended from AT&T Unix via the Berkeley Software Distribution branch through the 386BSD and Berkeley Software Distribution#4.4BSD and descendants operating systems.... , Mac OS X
Mac OS X
Mac OS X is a line of computer operating systems developed, marketed, and sold by Apple Inc., and since 2002 has been included with all new Macintosh computer systems.... and Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces .... .
An integrated development environment also known as integrated design environment or integrated debugging environment is a software application that provides comprehensive facilities to computer programmers for software development.... that was designed in Borland Delphi
Borland Delphi
Delphi is a software development environment for Microsoft Windows applications. It has always supported development of native Windows applications in the Delphi programming language, a further development of Object Pascal.... and which supports both Free Pascal and GNU Pascal as backend. Contrary to its C++ sibling, it has not seen a significant release in years
Oxygene (formerly known as Chrome) is a Next Generation Object Pascal compiler for the .NET
.NET Framework
The Microsoft .NET Framework is a software framework that is available with several Microsoft Windows operating systems. It includes a large Library of coded solutions to prevent common programming problems and a virtual machine that manages the execution of programs written specifically for the Software framework.... and Mono
Mono (software)
Mono is a project led by Novell to create an Ecma International standard compliant, .NET Framework-compatible set of tools, including among others a C Sharp compiler and a Common Language Runtime.... Platforms. It was created and is sold by , and recently by Codegear/Emarcadero as Prism
Prism
Prism may refer to:... It tries to carry the spirit of Pascal to .NET, but is not very compatible to other Pascals.
was a descendant of Delphi, with support for the Linux
Linux
Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed by anyone under the terms of the GNU GPL license... operating system and an improved object library. The compiler and the IDE are available now for non-commercial use. The product is no longer supported by Borland.
GNU Pascal is a Pascal programming language compiler comprised of a frontend to GNU Compiler Collection, similar to the way Fortran and other languages were added to GCC.... Compiler (GPC) is the Pascal compiler of the GNU Compiler Collection
GNU Compiler Collection
The GNU Compiler Collection is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain.... (GCC). The compiler itself is written in C, the runtime library mostly in Pascal. Distributed freely under the GNU General Public License
GNU General Public License
The GNU General Public License is a widely used free software license, originally written by Richard Stallman for the GNU project. The GPL is the most popular and well-known example of the type of strong copyleft license that requires derived works to be available under the same copyleft.... , it runs on many platforms and operating systems. It supports the ANSI/ISO standard languages and partial Borland/Turbo Pascal language support. One of the more painful omissions is the absence of a 100% TP compatible string type. Support for Borland Delphi and other language variations is quite limited, except maybe for Mac Pascal, the support for which is growing fast.
Virtual Pascal is a freeware 32-bit Pascal programming language compiler, IDE and debugger for OS/2 and Microsoft Windows, with some limited Linux support.... 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 on this compiler was canceled on April 4, 2005.
, the basis for many subsequent Pascal-implemented-in-Pascal compilers, including the UCSD p-System. It implements a subset of full Pascal.
Turbo Pascal is a complete software development system that includes a compiler and an Integrated Development Environment for the Pascal programming language running under CP/M, CP/M-86, and MS-DOS, developed by Borland under Philippe Kahn's leadership.... was the dominant Pascal compiler for PCs during the 80s and early 90s, 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. Slow floppy 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.
Turbo51 () is a free Pascal compiler for the 8051 family
Intel 8051
The Intel 8051 is a Harvard architecture, single chip microcontroller which was developed by Intel in 1980 for use in embedded systems. Intel's original versions were popular in the 1980s and early 1990s, but has largely been superseded by a vast range of faster and/or functionally enhanced 8051-compatible devices manufactured by more th... of microcontrollers (uses Turbo Pascal
Turbo Pascal
Turbo Pascal is a complete software development system that includes a compiler and an Integrated Development Environment for the Pascal programming language running under CP/M, CP/M-86, and MS-DOS, developed by Borland under Philippe Kahn's leadership.... 7 syntax)
is an interpreter that runs Standard Pascal. Notable are the "visible execution" mode that shows a running program and its variables, and the extensive runtime error checking. Runs programs but does not produce a separate executable binary. Runs on MS-DOS, Windows in DOS window, and old Macintosh.
tested on DOS, Windows 3.1, 95, 98, NT.
Implements the language "Pascaline" (named after 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.
PocketStudio is an Integrated development environment for Palm OS and Garnet OS by Winsoft. In some regard similar to Borland Delphi and Lazarus it has a visual form designer and a source code editor.... is a Pascal subset compiler/RAD targeting Palm / MC68xxx with some own extensions to assist interfacing with the Palm OS API.
MIDletPascal is a Object Pascal compiler and IDE specifically designed to create software for mobiles. It generates Java bytecode that runs on any J2ME device.... - A Pascal compiler and IDE that generates small and fast Java bytecode specifically designed to create software for mobiles
In computing, SIMD is a technique employed to achieve data level parallelism.... instruction sets such as the MMX and the AMD 3d Now, supporting all Intel and AMD processors, as well as the Sony Playstation 2 Emotion Engine.
allows the development of Web applications entirely written in Object Pascal (both server and browser side).
web Pascal () is an online IDE and Pascal compiler.
- Visual Development Environment and Pascal compiler for Win32 and OS/2
The source code for the first (CDC 6000) Pascal compiler.
- "Pascal-S: A Subset and Its Implementation", N. Wirth in Pascal - The Language and Its Implementation, by D.W. Barron, Wiley 1979.
A very extensive list can be found on . The site is in French, but it is basically a list with URLs to compilers; there is little barrier for non-Francophones. The site, , a Mac centric Pascal info and advocacy site with a rich collection of article archives, plus links to many compilers and tutorials, may also be of interest.
Standards
In 1983, the language was standardized, in the international standard ISO/IEC 7185, as well as 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, 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.
In 1990, an extended Pascal standard was created as ISO/IEC 10206. In 1993 the ANSI standard was replaced by the ANSI organization with a "pointer" to the ISO 7185:1990 standard, effectively ending its status as a different standard.
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.
Note that Niklaus Wirth himself referred to the 1974 language as "the Standard", for example, to differentiate it from the machine specific features of the CDC 6000 compiler. This language was documented in , 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 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.
Divisions
Niklaus Wirth's Zurich version of Pascal was issued outside of ETH
ETH Zurich
ETH Z?rich or Swiss Federal Institute of Technology Z?rich is a science and technology university in the Z?rich, Switzerland. Locals sometimes refer to it by the name Poly, derived from the original name Eidgen?ssisches Polytechnikum or Federal Polytechnic Institute.... 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. 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 or UCSD p-System was a portable, highly machine-independent operating system. The University of California, San Diego Institute for Information Systems developed it in 1978 to provide students with a common operating system that could run on any of the then available microcomputers as well as campus Digital Equipment Corpora... , 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.
Turbo Pascal is a complete software development system that includes a compiler and an Integrated Development Environment for the Pascal programming language running under CP/M, CP/M-86, and MS-DOS, developed by Borland under Philippe Kahn's leadership.... , written by Anders Hejlsberg
Anders Hejlsberg
Anders Hejlsberg is a prominent Denmark software engineer who co-designed several popular and commercially successful programming languages and development tools.... was written in assembly language independent of UCSD or the Zurich 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.
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.
Criticism
While very popular (although more so in the 1980s and early 1990s than now), early versions of Pascal have been widely criticized for being unsuitable for "serious" use outside of teaching. Brian Kernighan
Brian Kernighan
Brian Wilson Kernighan , is a computer scientist who worked at Bell Labs alongside Unix creators Ken Thompson and Dennis Ritchie and contributed greatly to Unix and its school of thought.... , who popularized the C programming language
C (programming language)
C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system.... , outlined his most notable criticisms of Pascal as early as 1981, in his paper Why Pascal Is Not My Favorite Programming Language. On the other hand, many major development efforts in the 1980s, such as for the Apple Lisa
Apple Lisa
The Apple Lisa was a personal computer designed at Apple Computer, Inc. during the early 1980s.The Lisa project was started at Apple in 1978 and evolved into a project to design a powerful personal computer with a graphical user interface that would be targeted toward business customers.... and Macintosh, heavily depended on Pascal (to the point where the C interface for the Macintosh operating system API had to deal in Pascal data types).
Reactions
In the decades since then, Pascal in fact has been continuing to evolve, and most of Kernighan's points do not apply to current implementations. Unfortunately, just as Kernighan predicted in his article, most of the extensions to fix these issues were incompatible from compiler to compiler. In the last decade, however, the varieties seem to have condensed into two categories, ISO and Borland like, a better eventual outcome than Kernighan foresaw.
Although Kernighan decried Pascal's lack of type escapes ("there is no escape" from "Why Pascal is not my Favorite Programming language"), the uncontrolled use of pointers and type escapes have become highly criticized features in their own right, and the languages Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java .... , C# and others feature a sharp turn-around to the Pascal point of view. What these languages call "managed pointers" were in fact foreseen by Wirth with the creation of Pascal.
Based on his experience with Pascal (and earlier with ALGOL) Niklaus Wirth
Niklaus Wirth
Niklaus Emil Wirth is a Switzerland computer science, best known for designing several programming languages, including Pascal , and for pioneering several classic topics in software engineering.... developed several more programming languages: Modula
Modula
The Modula programming language is a descendent of the Pascal . It was developed in Switzerland in the late 1970s by Niklaus Wirth, the same individual who designed Pascal.... , Modula-2
Modula-2
Modula-2 is a computer programming language invented by Niklaus Wirth at ETH, around 1978, as a successor to his intermediate language Modula. Modula-2 was implemented in 1980 for the Lilith computer, which was commercialized in 1982 by startup company DISER as MC1 and MC2.... and Oberon. These languages address some criticisms of Pascal, are intended for different user populations, and so on, but none has had the widespread impact on computer science and computer users as has Pascal, nor has any yet met with similar commercial success.
The aim of this list of programming languages is to include all notable programming languages in existence, both those in current use and historical ones, in alphabetical order....
Algol , known colloquially as the Demon Star, is a bright star in the constellation Perseus . It is one of the best known eclipsing binary, the first such star to be discovered, and also one of the first variable stars to be discovered....
This article is a comparison between Pascal and Borland Delphi because Borland uses the name "Delphi" exclusively for their version of the computer language....
Object Pascal refers to a branch of Object-oriented programming derivatives of Pascal , mostly known as the primary programming language of CodeGear Delphi....
IP Pascal is an implementation of the Pascal programming language using the IP portability platform, a multiple machine, operating system and language implementation system....
Concurrent Pascal was designed by Per Brinch Hansen for writing concurrent computing programs such asoperating systems and real-time monitoring systems on shared memory...
The computer programming languages C and Pascal are often compared to each other, sometimes heatedly, probably because the languages have similar times of origin, influences, and purposes, and so represent two philosophical approaches to a similar need....
C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system....
Real Programmers Don't Use Pascal is an essay about computer programming written by Ed Post, Tektronix, Inc., Wilsonville, Oregon USA. It was published as a letter to the editor in Datamation, volume 29 number 7, July 1983....
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 0-387-97649-3 and ISBN 3-540-97649-3
Niklaus Wirth: Algorithms + Data Structures = Programs. Prentice-Hall, 1975, 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: in Software Pioneers: Contributions to Software Engineering. Springer-Verlag, 2002, ISBN 3-540-43081-4
N. Wirth: ACM SIGPLAN Notices, Volume 28, No 3, March 1993.
External links
– Resources and history of original, standard Pascal