It was developed by Niklaus Wirth in order to make possible structured programming that would be relatively easy 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-2, a language similar to Pascal which also supports object oriented programming.
|
Unique Features Unlike programming languages descended from C, Pascal uses := for assignment instead of =. This is an advantage in differentiating comparisons and assignments. In C == is comparison, but = 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 of distinct syntax for assignments vs. comparisons these bugs cannot occur in Pascal.
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 allows without an explicit type-cast. This prevents common errors where variables are used incorrectly because the type is unknown. This also alleviates the need for Hungarian notation - the practice of suffixing variable names with type identifing letters.
Implementations Early approaches (most notably the UCSD system) translated Pascal code into a machine-independent 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-2. Later he went to work for Borland and rewote his compiler to become Turbo Pascal for the IBM PC. This new compiler sold for $49, which was much cheaper than the price Hejlsberg originally asked for the Blue Label Pascal compiler.
The inexpensive Borland compiler had a large influence for the Pascal community that began concentrating mainly on the IBM PC in the late 1980s. Many PC hobbyists in search for a structured replacement for BASIC used this product. Turbo Pascal, being available only on one architecture, translated directly to Intel 8088 machine code, making it much faster than interpreted schemes.
During the 1990s compilers that can be re-targeted to different hardware architectures became more prevalent. This allowed for Pascal translation to native machine code that is at the same time easily ported to new hardware.
With Turbo Pascal version 5 Borland added Object Orientation to Pascal forming the Object Pascal dialect. Their main language from 1996 on, Delphi, is in turn based on this. A version of Delphi for Linux is known as Kylix.
Publicly available compilers Several Pascal compilers are available for the use of general public:
While very popular (although more so in the 1980s and early 1990s than at the time of writing), early versions of Pascal have been widely criticised for being unsuitable for "serious" use outside of teaching. Brian Kernighan, co-creator of the C programming language, outlined his most notable criticisms of Pascal as early as 1981, in his paper Why Pascal Is Not My Favourite Programming Language (http://www.lysator.liu.se/c/bwk-on-pascal). Since that time Pascal has continued to evolve and most of his points do not apply to current implementations. The summary of Kernighan's criticism of early Pascal in that paper is as follows:
As mentioned above, the currently available compilers address most of these issues. 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.
Search Encyclopedia
|
Featured Article
|