Pascal (programming language): Difference between revisions

Content deleted Content added
Tags: Reverted possibly inaccurate edit summary references removed Mobile edit Mobile web edit
m Reverted 3 edits by 5.90.230.75 (talk) to last revision by Wikipedialuva
Line 39:
| website =
}}
'''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 in honour of the French mathematician, philosopher and physicist [[Blaise Pascal]].
'''Pascal''' exist!
 
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|array]]s, Pascal enables defining complex datatypes and building dynamic and recursive data structures such as [[list (abstract data type)|list]]s, [[tree (data structure)|tree]]s and [[graph (abstract data type)|graph]]s. Pascal has [[strong typing]] on all objects, which means that one type of data cannot be converted to or interpreted as another without explicit conversions. Unlike C (and most languages in the [[C-family]]), Pascal allows [[nested procedure]] definitions to any level of depth, and also allows most kinds of definitions and declarations inside [[subroutines]] (procedures and functions). A program is thus syntactically similar to a single procedure or function. This is similar to the block structure of ALGOL 60, but restricted from arbitrary block statements to just procedures and functions.
 
Pascal became very successful in the 1970s, notably on the 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 Computer]] (for the Lisa and 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]].
Line 45 ⟶ 51:
==History==
===Earlier efforts===
Much of the history of [[computer language]] design during the 1960s can be traced to the [[ALGOL 60]] language. ALGOL was developed during the 1950s with the explicit goal of being able to clearly describe algorithms. It included a number of features for [[structured programming]] that remain common in languages to this day.
History of Pascal
 
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.
 
By this time, a number of problems in ALGOL had been identified, notably the lack of a standardized [[String (computer science)|string]] system. The group tasked with maintaining the language had begun the [[ALGOL X]] process to identify improvements, calling for submissions. Wirth and [[Tony Hoare]] submitted a conservative set of modifications to add strings and clean up some of the syntax. These were considered too minor to be worth using as the new standard ALGOL, so Wirth wrote a compiler for the language, which became named [[ALGOL W]].
 
The ALGOL X efforts would go on to choose a much more complex language, [[ALGOL 68]]. The complexity of this language led to considerable difficulty producing high-performance compilers, and it was not widely used in the industry. This left an opening for newer languages.
 
===Pascal===
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.
 
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 [[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 E. Knuth]] was written in [[WEB]], the original [[literate programming]] system, based on [[Digital Equipment Corporation|DEC]] [[PDP-10]] Pascal. Successful commercial applications like [[Adobe Photoshop]]<ref>https://www.computerhistory.org/atchm/adobe-photoshop-source-code/ {{Webarchive|url=https://web.archive.org/web/20140507131754/http://www.computerhistory.org/atchm/adobe-photoshop-source-code/ |date=2014-05-07}}, Adobe Photoshop Source Code</ref> were written in [[Macintosh Programmer's Workshop]] Pascal, while applications like [[Total Commander]], [[Skype]]<ref>{{cite web |url=https://www.embarcadero.com/products/rad-studio/application-showcase|title=RAD Studio Application Showcase|date=2021-10-29}}</ref> and Macromedia Captivate were written in Delphi ([[Object Pascal]]). [[Apollo Computer]] used Pascal as the systems programming language for its operating systems beginning in 1980.
 
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>
 
===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|Multi-paradigm programming language]]. This led initially to [[Clascal]], introduced in 1983. As the Lisa program faded and was replaced by the Macintosh, a further version was created and named [[Object Pascal]]. This was introduced on the Mac in 1985 as part of the [[MacApp]] [[application framework]], and became Apple's main development language into the early 1990s.
 
The Object Pascal extensions were added to [[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}}</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 IDE called [[Lazarus (IDE)|Lazarus]].
 
==Implementations==
 
===Early Pascal compilers===
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 Pascal [[compiler]] was designed in [[Zürich]].
 
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 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.
 
==={{anchor|Pascal-P}}The Pascal-P system===