Penguin
Note: You are viewing an old revision of this page. View the current version.

A ProgrammingLanguage by NicolasWirth. Once very popular in schools before students started whining that they wanted to learn C.

A Sample

function plural (noun : string) : string;

{ Returns the plural version of a noun. }

var

i : integer;

begin

case noun[length(noun)? of

's': if noun[length(noun)-1? = 'e' then

plural := noun

else

plural := noun + 'es';

'y': begin

delete(noun, length(noun), 1); plural := noun + 'ies';

end;

else plural := noun + 's';

end;

end; {plural}

(This is in the TurboPascal dialect of Pascal.)

History

Pascal became popular very quickly because the original compiler was designed to be very easy to port?. It was written in Pascal and compiled to ByteCodes, called P-Code. All anyone had to do to get a Pascal compiler working on a new machine was to write the simple P-Code VirtualMachine for it -- they could hack the compiler around to generate proper MachineCode later. This meant that Pascal spread very quickly through the world's Universities. They began teaching in Pascal, because it was a very good language to demonstrate structured programming in -- a new idea and as such a hot topic at the time.

Standard Pascal was a nice language with terrible limitations: Pascal programs could not open files by name, could barely handle strings and could only pass arrays of predetermined sizes to functions. BrianKernighan famously described Pascal's problems in Why Pascal is Not My Favorite Programming Language. It has to be noted that NicolasWirth had already addressed most of Pascal's problems in his follow-up language Modula2 before BrianKernighan wrote this paper. In some places BrianKernighan seems to be just complaining that Pascal is not C. At any rate, these limitations meant that Pascal splintered into dialects as people hacked in missing features in incompatible ways. C did not have this problem, so it gradually took over from the Pascal dialects.

Implementations

The online book Pascal Implementation: A Book and Sources walks you through the source code to the original Pascal compiler. It's educational to read just as an extended critique of a non-trivial program.

The most successful Pascal dialect has been Borland's TurboPascal. Further extended with Modula2-like modules and C++-like OOP it became Delphi, which exists on Linux nowadays under the name Kylix.

There are two OpenSource Pascal compilers for Linux:

Free Pascal tends more towards TurboPascal compatability.

If you check out the Borland website and dig deeply you can get a free copy of TurboPascal 5.5 for DOS and also I believe version 1.0 .


CategoryProgrammingLanguages

lib/BlockParser.php:505: Notice: Undefined property: _tight_top (...repeated 2 times)