Pascal (programming language): Difference between revisions

Content deleted Content added
No edit summary
m copyedit
Line 1:
[[de:Pascal (Programmiersprache)]][[es:Lenguage de programacion Pascal]] [[pl:Pascal]] [[nl:Programmeertaal Pascal]] [[ja:Pascal]] [[sv:Pascal]] [[fr:Langage Pascal]]
In [[computer science]], '''Pascal''' is one of the landmark [[programming language]]s which has defined [[computer program]]sming and is still in use today.
 
It was developed by [[Niklaus Wirth]] indeveloped orderit to make possibleenable [[structured programming]] that would be relatively easyeasier for a [[compiler]] to process. Pascal is based on the [[Algol programming language]] and is named in honor of mathematician [[Blaise Pascal]]. Wirth also developed [[Modula programming language|Modula-2]], a language similar to Pascal which also supports object -oriented programming.
 
== Unique Features ==
Unlike programming languages descended from C, Pascal uses <tt>:=</tt> for assignment instead of <tt>=</tt>. This is an advantage in differentiating comparisons and assignments. In C <tt>==</tt> is comparison, but <tt>=</tt> is an assignment. These can be easily interchanged resulting in an inline assignment instead of a comparison. This syntax leads to many hard -to -track bugs in C-style code. Since Pascal does not allow inline assignments, and makes use ofuses distinct syntax for assignments vs.and comparisons, theseit bugsdoes cannotnot occursuffer infrom Pascalthese bugs.
 
Another major difference is that Pascal is strongly typed. This means that all variables must be defined with a specific type before they can be used. Also, incompatible variable assignments are not allowsallowed without an explicit type-cast. This prevents common errors where variables are used incorrectly because the type is unknown. ThisIt also alleviates the need for [[Hungarian notation]] - the practice of suffixing variable names with type identifing-identifying letters.
 
== Implementations ==
Early approaches (most notably the [[UCSD p-System]]) translated Pascal code into a machine-independent [[p-Code machine|p-Code]] representation. This intermediate code was then interpreted by a program specific to each architecture. As a consequence, only the small interpreter part had to be ported over to many architectures.
 
In the [[1980s]] [[Anders Hejlsberg]] wrote the Blue Label Pascal compiler for the [[Nascom|Nascom-2]]. Later he went to work for [[Borland]] and rewoterewrote his compiler to become ''[[Turbo Pascal]]'' for the [[IBM PC]]. This new compiler sold for $49, which was much cheaperless than the price Hejlsberg originally asked for the Blue Label Pascal compiler.
 
The inexpensive Borland compiler had a large influence foron the Pascal community that began concentrating mainly on the IBM PC in the late 1980s. Many PC hobbyists in search forof a structured replacement for [[BASIC programming language|BASIC]] used this product. ''Turbo Pascal'', being available only on one architecture, translated directly to [[Intel 8088]] [[machine language|machine code]], making it much faster than interpreted schemes.
 
During the [[1990s]] compilers that cancould be re-targeted to different hardware architectures became more prevalent. This allowed for Pascal translation to native machine code that iswas at the same time easily ported to new hardware.
 
With ''Turbo Pascal'' version 5 Borland added [[Object Oriented Programming|Objectobject Orientationorientation]] to Pascal.
 
However later, Borland later decided it wanted a more elaborate object -oriented features, and started over in Delphi using the ''Object Pascal'' Pascaldraft standards draftstandard proposed by Apple as a basis. (thisThis Apple draft still isn't a formal standard yet.) Borland also called this ''Object Pascal'' in the first Delphi versions, but changed the name to [[Delphi programming lanugage]] in later versions. The main changes compared to the older OOP extensions were a reference -based Objectobject model, virtual constructors and destructors, and properties. There are several other compilers implementing this dialect,: see [[Delphi programming lanugage]].
 
== Publicly available compilers ==
Line 36:
Many uninformed people still subscribe to the old belief that Pascal is not for "serious" programming and do not realize the benefits it currently offers. This stigma, more than any actual deficiency, is Pascal's biggest liability.
 
=== Further reading ===
*[[Brian W. Kernighan]], Why Pascal is Not My Favorite Programming Language http://www.lysator.liu.se/c/bwk-on-pascal.html
*How To Code: Pascal http://www.allegro.com/papers/htpp.html
 
---------
See also: [[Algol programming language]], [[C programming language]].