Jump to content

Pascal: Difference between revisions

From EDM2
Line 42: Line 42:
====Local articles====
====Local articles====
* [[Free Pascal Compiler Review]], by Yuri [[Prokushev]]
* [[Free Pascal Compiler Review]], by Yuri [[Prokushev]]
* A review of [[Virtual Pascal 2.1]] by [[Robert Basler]]


====Tutorials and other learning material====
====Tutorials and other learning material====
* [http://www.tutorialspoint.com/pascal/ A Pascal tutorial] from Tutorials Point - Delphi oriented but works with the [[Turbo Pascal|/Borland Pascal/Delphi]] compatible OS/2 tools.
* A very simple [http://www.taoyue.com/tutorials/pascal/ beginners tutorial] by TaoYue.com


==Standards==
==Standards==

Revision as of 12:53, 22 December 2014

Structured procedural language introduced by Niklaus Wirth in 1970, based partially on his earlier Algol-W language that had been proposed in 1966 to the Algol commitee but rejected in favour of the much more complex Algol 68.


A list of OS/2 implementations of Pascal

A list of DOS implementations of Pascal

A list of Pascal implementations that support Win-OS/2

A list of Pascal implementations that run under Java

Publications

Local articles

Tutorials and other learning material

Standards

Early on most Pascal implementations were based on code from ETH so even if they derived from the original "The Programming Language Pascal" book, code remained fairly portable as most changes were additions rather than base changes. UCSD Pascal, an extended interpreter based on an earlier ETH version became very influential especially in the USA, initially a commercial system but was later found to be in the Public Domain as it had been developed with funds from the public purse and was therefore taken on by a number of companies as the base for their systems, most notably Apple that used it and home built derivatives as the main development tools for the Apple III, Lisa and Macintosh.

The main obstacle to the propagation of Pascal standards has been Turbo Pascal, it was originally a CP/M compiler that implements a Pascal subset in assembly code in order to work with the extreme memory constraints of the 8 bit Z80, cutting a lot of corners to make the system faster to work with. When it was ported to DOS it was more or less a straight port that took no advantage of the larger memory capabilities of the IBM PC. This is in some ways understandable since the 8088 equipped PC/XT, although capable of directly addressing a much larger memory space than the Z80, is really an 8 bit processor in disguise and was a dog speedwise, in real terms slower than many of the Z80 systems it replaced so sacrificing code quality for compilation speed made some sense on these early systems.

Due to its low price in addition to good support and marketing by developer Borland it became not only by far the best selling Pascal implementation on the planet but the best selling development system of any sort for the next decade. In order to leverage its position in the market Borland decided to scrap the development of the next generation multi language system that they had been working on for some time that featured an ISO compliant Pascal (although it resurfaced later as TopSpeed Pascal and was the basis for the other TopSpeed compilers as well) and continue with the Turbo Pascal line that had established itself as a de-facto standard, and add some extensions taken from Apple's Object Pascal and some changes that allowed better compatibility with C headers and development systems.

This left us with Borland Pascal and Delphi, that manage to be both Pascal subsets and supersets at the same time, lack portability and have become somewhat muddled, with inconsistent syntax, lacking the coherence and simplicity of the ISO standards in addition to imports from C/C++ that look out of place and should really have been implemented as libraries rather than language features. This "divide and rule" strategy was initially successful as both systems sold well for a time and almost all commercial and open source developed since ape the Turbo Pascal/Delphi syntax rather than ISO Pascal, but in the long term it became a disaster, especially the decision to scrap the multi-language compiler which was a tool the company had to recreate later at a considerable cost and it is one of the reasons the Borland company no longer exists.

  • A list of Pascal standards from the Pascal Central site, the site also has the texts of most of them.
  • Initial "standard" was simply the 1973 edition of the book "The Programming Language Pascal" by Niklaus Wirth.
  • UCSD and ETH P4 interpreters become de-facto standards with most Pascal implementation following the one or the other.
  • ISO 7185 Pascal is basically ETH P4 with some clarifications and minor changes, it was ratified in 1982 and received some further changes in 1990 primarily to enhance compatibility with ISO 10206, and is in common usage referred to as "Standard Pascal". It had a strong following for a while but ISO compliant programming tools are getting thin on the ground these days due to the popularity of TP compatible tools.
  • ANSI ratified a standard in 1983 that was based on the "home grown" UCSD Pascal but deferred to ISO Pascal in regards to the base language, this was largely ignored and no-one appears to have released tools based on this standard, but the ANSI standards group merged with an IEEE Pascal standards group and they collaborated with the ISO standards committee over the next few years resulting in the "Extended Pascal" standard below.
  • ISO 10206 was ratified in 1990 and is commonly known as "Extended Pascal", it adds expressions, the module system and separate compilation from Modula-2, non-static types, mathematical types and a whole host of other primarily minor goodies but also makes some of the syntax more flexible.
  • The Object Pascal variant that was used in Apple Pascal and Borland Pascal/Delphi has never been standardised and most implementations simply ape the Apple syntax and later Borland additions. There was an attempt in the early 90's to create a standard but as Apple was switching to C in wake of their collaboration with IBM on PINK and Borland had no interest in what they saw as a tool to help their competitors create compatible systems, so the attempt floundered due to lack of industry support.