Pascal programming language Guide, Meaning , Facts, Information and Description
Pascal is one of the landmark computer programming languages on which generations of students cut their teeth and variants of which are still widely used today. TeX and much of the original Macintosh operating system were written in Pascal.The Swiss computer scientist Niklaus Wirth developed Pascal in 1970, first as a hypothetical language that would encourage students to write structured code. Pascal is based on the Algol programming language and is named in honor of mathematician and philosopher Blaise Pascal. Wirth also developed Modula-2 and Oberon, languages similar to Pascal which also support object-oriented programming.
| Table of contents |
|
2 Hello World 3 Pascal and C 4 Implementations 5 Publicly available compilers 6 Past criticism 7 Further reading 8 See also |
All Pascal programs start with the "Program" keyword, an optional list of internal filedescriptors and then a block of code is indicated with the "Begin" / "End" keywords. Letter case is ignored in the Pascal language. Semicolons separate statements, and the full stop ends the program (or unit). For some compilers the 'Program' line is optional.
Pascal, in its original form, is a purely procedural language with the standard array of if, while, for, and related constructs.
Turbo Pascal, and other derivatives with units or module concepts are modular languages. Turbo Pascal copied these concepts from either a draft of the Extended Pascal standard or Pascal's successor Modula-2, however doesn't provide a nested module concept.
Pascal was developed about the same time as C, and there are important similarities between the two. Both were strongly influenced by Algol 60 and incorporate many of its essential features, including its block structure and type system, although the approach to type safety is quite different.
Original Pascal and straight C are both small procedural languages implementing structured programming concepts. Both have functionality for the dynamic allocation of memory and some form of pointer manipulation. However, Pascal was designed, mainly, as a teaching language. Error-prone constructs were carefully avoided, and an effort was made to make the syntax easy to understand. The authors of C placed more emphasis on brevity, because C was designed for professional programmers.
The main differences between original Pascal and C are following:
In the 1980s Anders Hejlsberg wrote the Blue Label Pascal compiler for the Nascom-2. Later he went to work for Borland and rewrote his compiler to become Turbo Pascal for the IBM PC. This new compiler sold for $49.95, which was much less than the price Hejlsberg originally asked for the Blue Label Pascal compiler.
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. Turbo Pascal, being available only on one architecture, translated directly to Intel 8088 machine code, making it much faster than interpreted schemes.
Super Pascal was a variant which added non-numeric labels, a return statement and expressions as names of types.
During the 1990s compilers that could be re-targeted to different hardware architectures became more prevalent. This allowed for Pascal translation to native machine code that was at the same time easily ported to new hardware.
With Turbo Pascal version 5.5 Borland added object orientation to Pascal.
However, Borland later decided it wanted more elaborate object-oriented features, and started over in Delphi using the Object Pascal draft standard proposed by Apple as a basis. (This Apple draft isn't a formal standard yet.) Borland also called this Object Pascal in the first Delphi versions, but changed the name to Delphi programming language in later versions. The main additions compared to the older OOP extensions were a reference-based object model, virtual constructors and destructors, and properties. There are several other compilers implementing this dialect: see Delphi programming language.
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 Favorite Programming Language. On the other hand, many major development efforts in the 1980s, such as for the Apple Lisa and Macintosh, heavily depended on Pascal. In the decades since then, Pascal has continued to evolve and most of his points do not apply to current implementations. Unfortunately, most of the extensions to fix these issues are incompatible from compiler to compiler.
Many uninformed people still subscribe to the old belief that Pascal is not for "serious" programming and do not appreciate the benefits it currently offers. This stigma, more than any actual deficiency, is arguably Pascal's biggest liability.
This is an Article on Pascal programming language. Page Contains Information, Facts Details or Explanation Guide About Pascal programming language Overview
Hello World
program HelloWorld(input,output);
begin
Writeln('Hello, World!');
end.Notes: It is not nessesary to add 'input,output'Pascal and C
Together, these differences made Pascal significantly simpler and safer than C, but less useful (in fact, almost useless) for profesional programming. However, modern implementations of Pascal eliminate its flaws (and add means for object-oriented programming), making Pascal as useful as C or C++, but also as complicated as these.Implementations
Early approaches (most notably the UCSD p-System compiler, based on the Zürich P4 compiler, both of which were written in Pascal itself) 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 to many architectures.Publicly available compilers
Several Pascal compilers are available for the use of general public:
A very extensive list can be found on Pascaland. The site is in French, but it is basically a list with URLs to compilers, so that doesn't matter.Past criticism
Further reading
See also
