Content deleted Content added
m Changing casing of keywords in code blocks to be more consistent |
+cat. |
||
(92 intermediate revisions by 41 users not shown) | |||
Line 3:
{{Infobox programming language
| name = Pascal
| logo =
| paradigm = {{hlist |[[Imperative programming|Imperative]] |[[Structured programming|structured]]}}
Line 13 ⟶ 12:
| typing = {{hlist |[[Static typing|Static]] |[[Strong and weak typing|strong]] |[[type system#Type safety and memory safety|safe]]}}
| scope = [[Scope (computer science)|Lexical]]
| implementations = {{hlist |[[Berkeley Software Distribution|BSD]] |
[[CDC 6000]] |[[Delphi (software)|Embarcadero Delphi]] |[[ICT 1900 series|ICL 1900]] |[[Pascal-P]] |[[PDP-11]] |[[PDP-10]] |[[IBM System/370]] |[[VSI Pascal]] |[[Free Pascal]] |[[GNU Pascal]]}} | dialects = {{hlist |[[Delphi (software)|Delphi]] |[[Turbo Pascal]] |[[UCSD Pascal]]}}
| influenced by = {{startflatlist}}
* [[ALGOL W]]
* [[Simula]] 67
{{endflatlist}}
| influenced = {{startflatlist}}
* [[Ada (programming language)|Ada]]
* [[C/AL]]
* [[C Sharp (programming language)|C#]]
* [[Component Pascal]]
* [[Go (programming language)|Go]]
* [[Java (programming language)|Java]]<ref>{{cite web| url=http://java.sun.com/docs/white/delegates.html |title=About Microsoft's "Delegates" |archive-url=https://web.archive.org/web/20120627043929/http://java.sun.com/docs/white/delegates.html |archive-date=2012-06-27 |quote=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]].}}</ref><ref>{{cite web |url=http://www.fscript.org/prof/javapassport.pdf |quote=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 |title=History of Java |work=Java Application Servers Report |author=TechMetrix Research |date=1999 |url-status=dead |archive-url=https://web.archive.org/web/20101229090912/http://www.fscript.org/prof/javapassport.pdf |archive-date=2010-12-29 |access-date=2009-10-16 }}</ref><ref>{{cite web|url=http://queue.acm.org/detail.cfm?id=1017013|title=A Conversation with James Gosling – ACM Queue|access-date=11 August 2015|url-status=live|archive-url=https://web.archive.org/web/20150716194245/http://queue.acm.org/detail.cfm?id=1017013|archive-date=16 July 2015}}</ref>
* [[Modula]]{{\}}[[Modula-2|-2]]{{\}}[[Modula-3|-3]]
* [[Oberon (programming language)|Oberon]]{{\}}[[Oberon-2
* [[Object Pascal]]
* [[Oxygene (programming language)|Oxygene]]
Line 36 ⟶ 38:
| operating system =
| license =
| website =
| file_ext = .pas
| wikibooks = Pascal Programming
}}
'''Pascal''' is an [[Imperative programming|imperative]] and [[Procedural programming|procedural]] [[programming language]], designed by [[Niklaus Wirth]] as a small, efficient language intended to encourage good programming practices using [[structured programming]] and [[data structure|data structuring]]. It is named
Pascal was developed on the pattern of the [[ALGOL 60]] language. Wirth was involved in the process to improve the language as part of the [[ALGOL X]] efforts and proposed a version named [[ALGOL W]]. This was not accepted, and the ALGOL X process bogged down. In 1968, Wirth decided to abandon the ALGOL X process and further improve ALGOL W, releasing this as Pascal in 1970.
On top of ALGOL's [[variable (computer science)|scalar]]s and [[array (data type)|
Pascal became very successful in the 1970s, notably on the burgeoning [[minicomputer]] market. [[Compiler]]s were also available for many [[microcomputer]]s as the field emerged in the late 1970s. It was widely used as a teaching language in [[university]]-level programming courses in the 1980s, and also used in production settings for writing commercial software during the same period. It was displaced by the [[C (programming language)|C programming language]] during the late 1980s and early 1990s as [[UNIX]]-based systems became popular, and especially with the release of [[C++]].
A derivative named [[Object Pascal]] designed for [[object-oriented programming]] was developed in 1985. This was used by [[Apple Inc.|Apple Computer]] (for the [[Apple Lisa|Lisa]] and [[Mac (computer)|Macintosh]] machines) and [[Borland]] in the late 1980s and later developed into [[Delphi (software)|Delphi]] on the [[Microsoft Windows]] platform. Extensions to the Pascal concepts led to the languages [[Modula-2]] and [[Oberon (programming language)|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
Shortly after its introduction, in 1962 Wirth began working on his dissertation with Helmut Weber on the [[Euler (programming language)|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 (programming language)|Lisp]]. The language was published in 1965.
Line 60 ⟶ 63:
===Pascal===
Pascal was influenced by the ALGOL W efforts, with the explicit goals of teaching programming in a [[structured programming|structured fashion]] and for the development of system software.<ref>{{Cite book|chapter-url=https://link.springer.com/chapter/10.1007/10722581_1|doi = 10.1007/10722581_1|chapter = The Development of Procedural Programming Languages Personal Contributions and Perspectives|title = Modular Programming Languages|series = Lecture Notes in Computer Science|year = 2000|last1 = Wirth|first1 = Niklaus|volume = 1897|pages = 1–10|isbn = 978-3-540-67958-5}}</ref> 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,<ref>{{cite journal |last1=Wirth |first1=N. |title=The Programming Language Pascal |journal=Acta Informatica |date=1971 |volume=1 |issue=1 |pages=35–63 |doi=10.1007/BF00264291|hdl=20.500.11850/68712 |hdl-access=free }}</ref> and bridging the canyon between scientific and commercial programming, as represented by the then-widespread languages Fortran and COBOL, with a general-purpose language.<ref>{{cite book |last1=Wirth |first1=N. |chapter=Recollections about the development of Pascal |title=History of programming languages---II |date=January 1996 |pages=97–120 |doi=10.1145/234286.1057812|isbn=0-201-89502-1 }}</ref>
One of the early successes for the language was the introduction of [[UCSD Pascal]], a version that ran on a custom [[operating system]] that could be ported to different platforms. A key platform was the [[Apple II]], where it saw widespread use as [[Apple Pascal]]. This led to Pascal becoming the primary [[high-level language]] used for development in the [[Apple Lisa]], and later, the [[Mac (computer)|Macintosh]]. Parts of the original [[Classic Mac OS|Macintosh operating system]] were hand-translated into [[Motorola 68000]] [[assembly language]] from the Pascal [[source code]].<ref>Hertzfeld, Andy. "[http://www.folklore.org/StoryView.py?project=Macintosh&story=Hungarian.txt&topic=Software%20Design&sortOrder=Sort%20by%20Date&detail=medium Hungarian folklore.org] {{webarchive|url=https://web.archive.org/web/20151118082558/http://www.folklore.org/StoryView.py?project=Macintosh&story=Hungarian.txt&topic=Software%20Design&sortOrder=Sort%20by%20Date&detail=medium |date=2015-11-18}}: Macintosh Stories. Retrieved 2012-03-06.</ref>
The [[typesetting]] system [[TeX]] by [[Donald
Variants of Pascal have also been used for everything from research projects to [[PC game]]s and [[embedded system]]s. Newer Pascal compilers exist which are widely used.<ref>[http://www.tiobe.com/index.php/content/paperinfo/tpci/ tiobe.com] {{webarchive|url=https://web.archive.org/web/20120315012717/http://www.tiobe.com/index.php/content/paperinfo/tpci |date=2012-03-15}}, Programming Community Index for January 2011.</ref>
===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:
[https://www.standardpascal.org/pug.html 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 [[Programming paradigm|
The Object Pascal extensions were added to [[Turbo Pascal]] with the release of version 5.5 in 1989.<ref>{{cite web|title=Antique Software: Turbo Pascal v5.5|url=http://edn.embarcadero.com/article/20803|access-date=2018-05-17|archive-date=2010-11-24|archive-url=https://web.archive.org/web/20101124090934/http://edn.embarcadero.com/article/20803|url-status=dead}}</ref> Over the years, Object Pascal became the basis of the [[Delphi (software)|Delphi]] system for [[Microsoft Windows]], which is still used for developing Windows applications, and can [[cross-compile]] code to other systems. [[Free Pascal]] is an open source, cross-platform alternative with its own graphical [[integrated development environment|IDE]] called [[Lazarus (IDE)|Lazarus]].
==Implementations==
===Early
The first Pascal [[compiler]] was designed in [[Zürich]] for the [[CDC 6000 series]] [[mainframe computer]] family. [[Niklaus Wirth]] reports that a first attempt to implement it in [[Fortran|FORTRAN 66]] in 1969 was unsuccessful due to FORTRAN 66's inadequacy to express complex data structures. The second attempt was implemented in a C-like language (Scallop by Max Engeli) and then translated by hand (by R. Schild) to Pascal itself for boot-strapping.<ref>[https://www.inf.ethz.ch/personal/wirth/Miscellaneous/ComputersAndComputing.pdf Computers and Computing. A Personal Perspective.] {{webarchive|url=https://web.archive.org/web/20170510101203/https://www.inf.ethz.ch/personal/wirth/Miscellaneous/ComputersAndComputing.pdf |date=2017-05-10}} by Niklaus Wirth</ref> It was operational by mid-1970. Many Pascal compilers since have been similarly [[Self-hosting (compilers)|self-hosting]], that is, the compiler is itself written in Pascal, and the compiler is usually capable of recompiling itself when new features are added to the language, or when the compiler is to be [[porting|ported]] to a new environment. The [[GNU Pascal]] compiler is one notable exception, being written in C.
The first successful port of the CDC Pascal compiler to another mainframe was completed by Welsh and Quinn at the [[Queen's University of Belfast]] (QUB) in 1972. The target was the [[International Computers Limited]] (ICL) [[ICT 1900 series|1900 series]]. This compiler, in turn, was the parent of the Pascal compiler for the Information Computer Systems (ICS) [[Multum]] minicomputer. The Multum port was developed – with a view to using Pascal as a systems programming language – by Findlay, Cupples, Cavouras and Davis, working at the Department of Computing Science in [[Glasgow University]]. It is thought that Multum Pascal, which was completed in the summer of 1973, may have been the first [[16-bit computing|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.
The first Pascal [[compiler]] written in North America was constructed at the [[University of Illinois at Urbana–Champaign|University of Illinois]] under [[Donald B. Gillies#Later career|Donald B. Gillies]] for the [[PDP-11]] and generated native machine code. Microsoft had Pascal compilers for IBM PCs, see [[Microsoft Pascal]].
==={{anchor|Pascal-P}}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 [[p-code machine|p-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. The P-system compilers were named Pascal-P1, Pascal-P2, Pascal-P3, and Pascal-P4. Pascal-P1 was the first version, and Pascal-P4 was the last to come from Zürich. The version termed Pascal-P1 was coined after the fact for the many different sources for Pascal-P that existed. The compiler was redesigned to enhance [[software portability|portability]], and issued as Pascal-P2. This code was later enhanced to become Pascal-P3, with an intermediate code [[backward compatible]] with Pascal-P2, and Pascal-P4, which was not backward compatible.
The Pascal-P4 compiler–interpreter can still be run and compiled on systems compatible with original Pascal (as can Pascal-P2). However, it only accepts a subset of the Pascal language.
Pascal-P5, created outside the Zürich group, accepts the full Pascal language and includes ISO 7185 compatibility.
Pascal-P6 is a follow on to Pascal-P5 that along with other features, aims to be a compiler for specific CPUs, including AMD64.
[[UCSD Pascal]] branched off Pascal-P2, where [[Kenneth Bowles]] used it to create the [[Interpreter (computing)|interpretive]] UCSD p-System. It was one of three operating systems available at the launch of the original [[IBM Personal Computer]].<ref>[http://www.cbi.umn.edu/oh/pdf/oh392jb.pdf cbi.umn.edu], "An Interview with John Brackett and Doug Ross"{{dead link |date=March 2018 |bot=InternetArchiveBot |fix-attempted=yes}}, p15, Charles Babbage Institute, 2004</ref> 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 [[OS/360 Object File Format|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.<ref>{{cite report |url=http://www.iaea.org/inis/collection/NCLCollectionStore/_Public/10/477/10477561.pdf |date=1977 |title=Australian Atomic Energy Commission Research Establishment, Lucas Heights, Nuclear Science and Technology Branch Report, Divisional Research |page=22 |website=International Atomic Energy Agency (IEAE)}}</ref>
===Object Pascal and Turbo Pascal===
Line 108 ⟶ 123:
==={{anchor|Pascal-SC|Pascal-XSC}}Other variants===
[[Super Pascal]]
TMT Pascal was the first [[Borland]]-compatible compiler for [[32-bit computing|32-bit]] [[MS-DOS]] compatible [[protected mode]], [[OS/2]], and [[Win32]]
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).<ref>Michel Gien, "The SOL Operating System", in Usenix Summer '83 Conference, Toronto, ON, (July 1983), pp. 75–78</ref> The Sol team later on moved to the [[ChorusOS]] project to design a [[distributed operating system]].<ref>{{Cite web|url=http://www.cs.berkeley.edu/~prabal/resources/osprelim/RAA+92.pdf|archiveurl=https://web.archive.org/web/20150207194433/http://www.cs.berkeley.edu/~prabal/resources/osprelim/RAA+92.pdf|url-status=dead|title=Overview of the CHORUS Distributed Operating Systems|year=1991|work=Chorus systems|via=cs.berkeley.edu|archivedate=February 7, 2015}}</ref>
[[IP Pascal]]
==Language constructs==
Line 128 ⟶ 143:
program HelloWorld(output);
begin
{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.}
Line 148 ⟶ 163:
| floating-point numbers
|-
| [[
| the values True or False
|-
Line 155 ⟶ 170:
|-
| [[set (computer science)|set]]
| equivalent to an array of [[
|-
| [[Array data type|array]]
| a countable group of any of the preceding data types,
|-
| [[Record (computer science)|record]]
| A collection of any of the preceding data types or of other records
|-
| [[string (computer science)|string]]
Line 167 ⟶ 182:
|}
The range of values allowed for the basic types (except
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
Line 180 ⟶ 195:
Often-used types like byte and string are already defined in many implementations.
Normally the system will use a [[Word (computer architecture)|word]] to store the data. For instance, the {{code|byte}} type may be stored in a machine integer - 32 bits perhaps - rather than an [[8-bit computing|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 {{code|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 (computer architecture)|word]] for each element. Packing may slow access on machines that do not offer easy access to parts of a word.
Line 222 ⟶ 237:
For these examples, which involve sets over small domains, the improved performance is usually achieved by the compiler representing set variables as [[bit vector]]s. The set [[Operator (programming)|operators]] can then be implemented efficiently as bitwise machine code operations.
===
An example of a Pascal record type:
:<syntaxhighlight lang="pascal">
type
car = record
length: integer;
width: integer
end;
</syntaxhighlight>
An example of a variant record type:
:<syntaxhighlight lang="pascal">
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;
</syntaxhighlight>
Variant records allow several fields of the record to overlap each other to save space.
===Type declarations===
Line 245 ⟶ 284:
end;
c = file of a;
</syntaxhighlight>
Further, complex types can be constructed from other complex types recursively:
:<syntaxhighlight lang="pascal">
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;
</syntaxhighlight>
===File type===
:<syntaxhighlight lang="pascal">
type
a = file of integer;
b = record
x : integer;
y : char
end;
c = file of b;
</syntaxhighlight>
As shown in the example above, Pascal [[Computer file|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 {{code|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===
Line 331 ⟶ 410:
:<syntaxhighlight lang="pascal">
program Printing(output);
var i : integer;
Line 340 ⟶ 419:
end;
function triple(
begin
triple := x * 3
Line 369 ⟶ 448:
Several Pascal compilers and interpreters are available for general use:
* [[Delphi (software)|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 [[Microsoft Windows|Windows]], [[macOS]], [[iOS]], and [[Android (operating system)|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 [[Generic programming|generics]] were [[Generic programming#In Delphi|added]] (D2009, D2010, Delphi XE).
* [[Free Pascal]] is a [[Cross-platform software|cross-platform]] compiler written in [[Object Pascal]] (and is [[Self-hosting (compilers)|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 (computing)|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.
* [[Turbo51]] is a free Pascal compiler for the [[Intel 8051]] family of microcontrollers, with [[Turbo Pascal]] 7 syntax.
* [[Oxygene (programming language)|Oxygene]] (formerly named ''Chrome'') is an Object Pascal compiler for the [[
* [[Kylix (software)|Kylix]] was a descendant of [[Delphi (software)|Delphi]], with support for the [[Linux]] 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-P4]] compiler, the basis for many subsequent Pascal-implemented-in-Pascal compilers. It implements a subset of full Pascal.
* [[Pascal-P5]] compiler is an ISO 7185 (full Pascal) adaption of Pascal-P4.
* Pascal-P6 compiler is an extended version of Pascal adaption of Pascal-P5 according to the Pascaline language specification.
* Smart Mobile Studio is a Pascal to [[HTML5]]/[[JavaScript]] compiler
* [[Turbo Pascal]] was the dominant Pascal compiler for PCs during the 1980s and early 1990s, popular both because of its powerful extensions and extremely short compilation times. Turbo Pascal was compactly written and could compile, run, and debug all from memory without accessing disk. Slow [[floppy disk drive]]s were common for programmers at the time, further magnifying Turbo Pascal's speed advantage. Currently, older versions of Turbo Pascal (up to 5.5) are available for free download from Borland's site.
* [[IP Pascal]] implements the language "Pascaline" (named 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.
* Pascal-XT was created by [[Siemens]] for their [[mainframe computer|mainframe]] operating systems [[BS2000]] and [[SINIX]].
*
*
* Vector Pascal is a language for [[SIMD]] instruction sets such as the [[MMX (instruction set)|MMX]] and the [[AMD]] [[3DNow!|3d Now]], supporting all [[Intel]] and AMD processors, and [[Sony]]'s [[PlayStation 2]] [[Emotion Engine]].
* Morfik Pascal allows the development of [[Web
* 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.
* {{anchor|[[Pascal-S]]}}Pascal-S<ref>"Pascal-S: A Subset and Its Implementation", N. Wirth in Pascal – The Language and Its Implementation, by D.W. Barron, Wiley 1979.</ref>
* AmigaPascal is a free Pascal compiler for
* VSI Pascal for OpenVMS (formerly HP Pascal for OpenVMS, Compaq Pascal, DEC Pascal, VAX Pascal and originally VAX-11 Pascal<ref>{{
* 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.
Line 397 ⟶ 477:
* [[Dev-Pascal]] is a Pascal [[integrated development environment|IDE]] that was designed in Borland [[Object Pascal|Delphi]] and which supports Free Pascal and GNU Pascal as backends.
* [[Lazarus (software)|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 (programming language)|Oxygene]] and the
===Libraries===
Line 417 ⟶ 497:
===ISO/IEC 10206:1990 Extended Pascal===
{{Expand section|date=February 2018}}
In 1990, an extended Pascal standard was created as ISO/IEC 10206,<ref>{{cite book|title=Extended Pascal: ISO/IEC 10206:1990|url=http://www.dcs.gla.ac.uk/~wpc/reports/compilers/compilerindex/iso10206.ps|access-date=16 September 2014|url-status=dead|archive-url=https://web.archive.org/web/20160327025949/http://www.dcs.gla.ac.uk/%7Ewpc/reports/compilers/compilerindex/iso10206.ps|archive-date=2016-03-27}}</ref> which is identical in technical content<ref name="ISO/ANSI identical">{{cite web|title=Language standards: Pascal, Extended Pascal, Fortan|url=http://www.prosperosoftware.com/std.html|access-date=16 September 2014|ref=identical|archive-url=https://web.archive.org/web/20140714024231/http://www.prosperosoftware.com/std.html|archive-date=2014-07-14|url-status=dead}}</ref> to IEEE/ANSI 770X3.160-1989<ref>{{cite book
As of 2019, Support of Extended Pascal in [[FreePascal]] Compiler is planned.<ref>{{Cite web|url=https://wiki.freepascal.org/Extended_Pascal|title=Extended Pascal - Free Pascal wiki|website=wiki.freepascal.org}}</ref>
<!-- WHAT FOLLOW APPEARS FACTUALLY WRONG AND IS COMMENTED OUT FOR FUTURE REFERENCE
Line 437 ⟶ 517:
Software products ([[compiler]]s, and IDE/[[Rapid Application Development]] (RAD)) in this category:
* [[Turbo Pascal]] – "TURBO.EXE" up to version 7, and Turbo Pascal for Windows ("TPW") and [[Turbo Pascal#Apple Macintosh|Turbo Pascal for Macintosh]].
*
* [[Turbo Pascal|Borland Pascal 7]] – A professional version of Turbo Pascal line which targeted both DOS and Windows.
* [[Object Pascal]] – an extension of the Pascal language that was developed at [[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#Apple Macintosh|Turbo Pascal for Macintosh]] and in 1989 for Turbo Pascal 5.5 for DOS.
* [[Delphi (software)|Delphi]] – Object Pascal is essentially its underlying language.
* [[Free Pascal]] compiler (FPC) – Free Pascal adopted the
* [[PascalABC.NET]] – a new generation Pascal programming language including compiler and IDE.
* [[Kylix (software)|Borland Kylix]] is a compiler and IDE formerly sold by Borland, but later discontinued. It is a [[Linux]] version of the [[Delphi (software)|Borland Delphi]] software development environment and [[C++Builder]].
* [[Lazarus (IDE)|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 Pascal]] to varying degrees.
* [[Virtual Pascal]] – VP2/1 is a fully Borland Pascal– and Borland Delphi–compatible 32-bit Pascal compiler for OS/2 and Windows 32 (with a Linux version "on the way").<ref>{{cite web |title=Virtual Pascal for OS/2 |url=http://www.pascal-central.com/vpascal.html |access-date=3 April 2016 |url-status=dead |archive-url=https://web.archive.org/web/20110830023208/http://pascal-central.com/vpascal.html |archive-date=30 August 2011 }}</ref>
* Sybil is an open source Delphi-like IDE and compiler; implementations include:
** WDSibyl<ref>{{cite web |url=http://www.wdsibyl.org/ |title=WDSibyl: Visual Development Environment |author=Wolfgang |date=October 15, 2020 |website=WDSibyl.org |access-date=2020-04-20 |url-status=live |archive-url=https://web.archive.org/web/20200212174135/https://www.wdsibyl.org/ |archive-date=2020-02-12}}</ref> 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;
Line 457 ⟶ 537:
===Early criticism===
===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.<ref>{{cite web |last1=Crespo |first1=Diego |title=Pascal: The language that almost took over the world part 1 |url=https://www.deusinmachina.net/p/pascal-the-language-that-almost-took?utm_source=publication-search |website=www.deusinmachina.net |access-date=4 January 2025 |language=en}}</ref>
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 (<code>otherwise</code>) clauses for case statements.<ref>{{Cite web |url=http://pascal-central.com/ppl/chapter3.html#Extended |title=Extended Pascal |url-status=dead |archive-url=https://web.archive.org/web/20151018023934/http://www.pascal-central.com/ppl/chapter3.html |archive-date=2015-10-18 |access-date=2015-10-17 }}</ref>
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.<ref>{{cite web |last1=Crespo |first1=Diego |title=Pascal: The language that almost took over the world part 2 |url=https://www.deusinmachina.net/p/pascal-the-language-that-almost-took-56a?utm_source=publication-search |website=www.deusinmachina.net |access-date=4 January 2025 |language=en}}</ref>
==Notes==
{{notelist}}
==See also==
Line 482 ⟶ 570:
* 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: ''[https://web.archive.org/web/20050314152247/http://www.cs.inf.ethz.ch/~wirth/books/Pascal/ Pascal – User Manual and Report]''. Springer-Verlag, 1974, 1985, 1990, 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.
Line 501 ⟶ 589:
[[Category:Pascal (programming language)| ]]
[[Category:Academic programming languages]]
[[Category:
[[Category:Educational programming languages]]
[[Category:High-level programming languages]]
Line 507 ⟶ 595:
[[Category:Programming languages with an ISO standard]]
[[Category:1970 software]]
<!-- Hidden categories below -->
[[Category:Articles with example Pascal code]]
[[Category:Compiled programming languages]]
|