Home >> Computers >> Programming >> Languages >> Pascal


  Comparison and Review
       

  Compilers
Personal Pages
  Source Code
Standards
  Tools
Tutorials

  Borland
Component Pascal
  Delphi
GNU Pascal
   


Pascal is an imperative computer programming language, developed in 1970 by Niklaus Wirth as a language particularly suitable for structured programming.

Pascal is according to a Algol programming language & known as inside honor of mathematician and philosopher Blaise Pascal. Wirth likewise developed Modula-2 and Oberon, languages similar to Pascal. Oberon likewise supports object-oriented programming.

At first, Pascal was the language meant to teach students integrated programming, & generations of students use "cut their teeth" around Pascal as an introductory language in undergrad courses. Variants of Pascal come however widely utilized within todays world, each in education & computer software development.

Very much of the original Macintosh operating system was written inside Pascal. A popular typesetting system TeX is written in the language known as WEB for which Donald Knuth borrowed heavily from either Pascal.

Language
Whole Pascal software begin by owning a "Program" keyword, an optional list of external file descriptors so the block of code is indicated with a "Begin" & "End" keywords. Semicolons separate statements, and a full stop ends the program (or even unit). Letter case is ignored in Pascal source.

program HelloWorld(output); begin
writeln('Hullo, Globe!')
prevent.

Pascal, within its original form, occurs as strictly procedural language with the standard array of whenever, spell, for, & related constructs.

Pascal occurs as structured programming language, meaning that the flow of control is structured into standard statements, ideally while forgoing 'go to' commands.

spell the <> b do WriteLn('Waiting'); whenever the > b then writeln('Trouble met') else writeln('Problem treacherously'); for we := 1 to 10 launder writeln('Iteration: ', i:1); repetition the := the + Ace until the = X;

Pascal structures software into procedures & functions.

program mine(output); procedure print(volt-ampere we: whole number); work next(we: whole number): whole number;
begin
next := i personally + 1
prevent; begin
writeln('A aggregate is: ', we); i personally := next(i personally)
prevent; begin
we := I; spell i <= 10 do print(i)
prevent.

Procedures & functions potty nest to any depth, & a 'program' construct is the logical outmost prevent.

To each one prevent could use its have declarations of goto labels, constants, types, variables, & more procedures & functions, which must whole exist as therein sequentially.

Pascal hwhen whole number, character & boolean as the elementary types, + enumerations, a newly nature and severity introduced by having Pascal.

program myprog; var the: whole number; b: char; c: boolean; d: (of these, deuce, threesome, quatern, 5);

The "subrange" of any of the above types may be manufactured.

var x: Ace..Tenner; y: 'the'..'z'; z: ii..tetrad;

Types may be built from either more types per nature and severity declaration.

program myotherprog; type x = whole number; y = x; ...

Farther, complex types may be constructed from either elementary types:

type the = array [1..10] of whole number; b = record the: whole number; b: char prevent; c = file of the;

Strings come packed arrays that run using an whole number stock of Single.

As well, Pascal supports a have of pointers: type the = ^b; b = record the: whole number; b: char; c: a prevent; var pb : a

On text a variable pb occurs as pointer to the information nature and severity b, the record. To produce a fresh record & assign the values Tenner & The to the fields the & b in a record, the commands would become; newly(pb); pb^.the := X; pb^.b := 'The'; pb^.c := zippo; ... Linked lists can be created by including a pointer nature and severity field (100) in the record.

Hello World
program HelloWorld(output); begin
WriteLn('How-do-you-do, Globe!')
prevent.

Implementations
A number one Pascal compiler was designed inside Zurich for the CDC 6000 computer family, & it became operational within 1970.

A number 1 Pascal compiler written inside Northward America was constructed at a University of Illinois under Donald B. Gillies for the PDP-11 and generated native machine code.

Sequentially to chop-chop propagate the language, a compiler "porting kit" was created around Zurich that involved the compiler for the "virtual" machine language (or even thomas more properly an average code), & the simulator for that equivalent code. This became a P-models. Although this rules was meant to enable avowedly machine code compilers to be created, at least 1 body, a notable UCSD implementation, listed it to produce an interpretive system UCSD p-System. A P-body compilers were termed P1-P4, using P1 existence a 1st version, & P4 existence a endure.

IP Pascal was an implementation of the Pascal programming language applying Micropolis DOS, however was moved chop-chop to CP/M running off on the Z80.

In the early 1980s, UCSD Pascal was ported to the Apple II and Apple III computers to provide a integrated option to the BASIC interpreters that came by owning a machines.

In the 1980s Anders Hejlsberg wrote the Blue Label Pascal compiler for the Nascom-2. Late he went to operate for Borland and rewrote his compiler to become Turbo Pascal for the IBM PC. This fresh compiler sold for $49.95, which was very much to a lesser degree a price Hejlsberg originally asked for the Blue Label Pascal compiler.

the cheap Borland compiler experienced a big influence on the Pascal community that began concentrating chiefly on the IBM PC in the late 1980s. Several PC hobbyists within look for of the integrated replacement for BASIC used this product.

Very Pascal wwhen the variant which added non-numeric labels, the link to statement & expressions as list of types.

Using Turbo Pascal version Quintuplet.Little phoebe Borland added object orientation to Pascal.

Notwithstanding, Borl& late decided it wanted sir thomas more elaborate object-oriented features, and began all over inside Delphi using the Object Pascal draft standard projected by Apple as a basis. (This Apple draft is however non the formal standard.) Borland too known as this Object Pascal in a 1st Delphi versions, however changed the title to Delphi programming language in later versions. the independent additions in comparison a older OOP extensions were a information-depending object model, virtual builder & destructors, & properties. There are many more compilers implementing this idiom: understand Delphi programming language.

Turbo Pascal, and more derivatives sustaining units or even module conception come modular languages. Turbo Pascal copied these conception from the draft of the Extended Pascal standard or even Pascal's successor Modula-2. Yet, it doesn't provide the nested module conception or even experienced enough import & exportation of specific symbols.

Standards
Within 1983, a language wwhen standardized, in a international standard ISO/IEC 7185, also as many local united states specific standards, including the Our contries ANSI/IEEE770X3.97-1983. Inside 1990, a long Pascal standard wwhen created as ISO/IEC 10206.

the ISO 7185 was stated to exist as a clarification of Wirth's 1974 language equally detailed per User Manual & Report [Jensen and Wirth], however was too notable for adding "Conformant Array Parameters" as a level 1 to a standard, level 0 existence Pascal while forgoing Conformant Arrays.

in a big machines (mainframes & minicomputers) Pascal originated on, the standards were typically followed. On the IBM-PC, it were does'nt. In IBM-PCs, a Borl& standards Turbo Pascal and Delphi develop a greatest total of users. So, these are usually significant to know whether the particular implementation corresponds to the original Pascal language, or even the Borland idiom of it.

Publicly available compilers
Many Pascal compilers come available for the apply of general public: [http://homepages.cwi.nl/~steven/pascal/ P4 compiler], a basis for numerous subsequent Pascal-implemented-inside-Pascal compilers, including a UCSD p-System. Free Pascal is written in Pascal (then that it compiles itself), & is aimed at providing a handy & mighty compiler, respire two to compile bequest applications & to become the means of get newly ones. Too distributed freely under a GNU GPL. It could mix Turbo Pascal by having Delphi code, & supports very much of platforms & operating systems. Turbo Pascal was a dominant Pascal compiler for PCs when you took the 80s & early 90s, popular two because of its right extensions & super sale compilation days. Presently, older versions of Turbo Pascal (as much as Quint.Quintet) come available gratis download from either Borland's places (registration involved). [http://www.chromesville.com Chrome] occurs as next generation Object Pascal language for the .NET and Mono Platforms implemented by RemObjects Software. [http://www.gnu-pascal.org/ GNU Pascal Compiler] (GPC) is the Pascal compiler of the GNU Compiler Collection (GCC). A compiler itself is written inside C, a runtime library mostly inside Pascal. Distributed freely under a GNU General Public License, it runs in several platforms & operating systems. It supports a ANSI/ISO standard languages & a Borland/Turbo Pascal language largely. Trend lines for Borl& Delphi and more language variations is quite limited eventually. [http://www.borland.com/delphi/ Delphi] is Borland's flagship RAD (Rapid Application Development) product. It utilizes a Delphi programming language, descended from Pascal, to produce applications for the windows platform. A latest version likewise supports compiling to the .NET platform [http://www.borland.com/kylix/ Kylix] is Borland's fresh reduplication of the Pascal branch of their products. These are a descendent of Delphi, with trend lines for the Linux operating system & an improved object library. A compiler & a IDE come available currently for non-commercial have. A compiler (but not a library or even a IDE) is supposed to get Open Source software some instance presently. [http://www.visible-software.com/prod-dp.html Dr. Pascal] is an interpreter that diarrhea Standard Pascal. Guiding light come a "visible execution" mode that shows a going program & its variables, & the extensive run-time error checking. Diarrhethe computer software however doesn't make a separate practicable double star. Diarrhea around MS-DOS, Windows in DOS window, & old Macintosh. [http://www.vpascal.com/ Virtual Pascal] was created by Vitaly Miryanov within 1995 as a native OS/2 compiler compatible using Borland Pascal syntax. So it experienced been commercially developed by fPrint, adding Win32 trend lines, & inside 2000 it became freeware. In todays world it may compile for Win32, OS/2 & Linux, & is mostly compatible by using Borl& Pascal and Delphi. [http://www.moorecad.com/ippas/ IP Pascal] Originally the Z80/CP/M Pascal that was ported & recoded for Intel 80386/PC, IP Pascal has the built-inbuilt portability library that is custom tailored to the Pascal language. For instance, the standard text output application from either 1970's original Pascal may be recompiled to operate inside the window & possibly use in writing constructs added. IP Pascal supports a ISO 7185 standard & upgrades a language logically. E.g., original Pascal "padded right" strings come supported & integrated upwards seamlessly into dynamic strings. Standard Pascal electroelectrostatic arrays come enhanced sustaining dynamic arrays which are then fully downwards compatible by using static arrays, etc. [http://www.winsoft.sk/pstudio.htm Pocket Studio] occurs as Pascal subset compiler/RAD targeting Palm / MC68xxx by owning a select few have extensions to assist interfacing using a Palm OS API. [http://www.lazarus.freepascal.org Lazarus] occurs as cross platform Visual RAD IDE. Lazarus uses Free Pascal complier.

The super extensive listings may be discovered in [http://pascaland.org Pascaland]. the places is inside French, however these are au fond a listing by owning Web sites to compilers, thus that doesn't matter. You may besides prevent out [http://pascal-central.com Pascal Central], the Mackintosh centrical Pascal information & protagonism places by having rich collection of article archives, + links to several compilers & tutorials.

Past criticism
Patch super popular (although other therefore in a Eighties & early Nineties than at the instance of writing), early versions of Pascal use at times been widely criticised for existence unsuitable for "serious" utilise outside of teaching. Brian Kernighan, famed vulgariser of the C programming language, outlined his most notable criticisms of Pascal when early when 1981, around his paper [http://www.cs.virginia.edu/~evans/cs655-S00/readings/bwk-on-pascal.html Why Pascal Is Not My Favorite Programming Language]. Then again, several major development efforts in the Eighties, like for the Apple Lisa and Macintosh, heavily depended around Pascal (pertinent in which a C interface for the Mac OS API got to treat in Pascal information types). In the decades since so, Pascal has continued to develop & virtually all of Kernighan's points don't use to todays implementations. Regrettably, virtually all of the extensions to fix these issues come incompatible from either compiler to compiler, though in the survive decade this seems to condense into 2 categories, ISO or even Borland prefer.

According to his personal experience by having Pascal Niklaus Wirth developed two further programing language, Modula-2 and Oberon, which even though great deal improved did non meet a commercial profits of Pascal.

How To Code Pascal
A long paper on how to write good Pascal code based on the 4 P's of programming: philosophy, performance, problems, and portability.

Khaan's Place
Source code, tutorial, chat room, help page, and links to pages about Turbo Pascal.

Pascal Central
Technical information, source code, forums and links. Focuses on the Macintosh development platform, but includes some good information about Pascal in general.

PasScript (AstroScript)
An interpreter of a vast subset of the Object Pascal language which supports all Object Pascal data types except interfaces.

Turbo Pascal Programmers Page
A collection of links to tutorials, web sites, books, source code, newsgroups.

IRC #pascal.no
FAQ, people, operators, rules. Also contain sources and tools.

Pascal Starting Page
A good starting point for information about Pascal. Links to FAQs, random-number routines, and optimization, as well as information specific to the Turbo Pascal compiler.

Programmers Heaven - Pascal programming zone
Sourcecode, articles and discussionboards.

Klaus Hartnegg Pascal Page
Information about solving Runtime error 200 in Borland Pascal and breaking the 64KB limit. Also source code, mostly interfaces with hardware.

paxPascal
Implements a subset of Object Pascal and extends it with a few extra features, including namespaces, dynamic record and array types, inheritance for record types. It's one of the languages of the paxScript scripting engine which allows the cross-language integration.


Computers: Programming: Languages: Compiled: Procedural
Computers: Programming: Languages: Open Source
Computers: Programming: Languages: Procedural
Computers: Programming: Languages: Wirth





© 2005 GeneralAnswers.org