Differences between version 19 and predecessor to the previous major change of Pascal.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 19 | Last edited on Thursday, March 31, 2005 11:36:47 am | by GlynWebster | Revert |
Older page: | version 1 | Last edited on Wednesday, February 26, 2003 6:55:32 pm | by GlynWebster | Revert |
@@ -1,26 +1,43 @@
-A
ProgrammingLanguage by Nicolas [Wirth]
. Once very popular in schools before students started whining they wanted to learn [C].
+An imperative
ProgrammingLanguage designed
by NicolasWirth as a teaching language
. Once very popular in schools before students started whining that
they wanted to learn [C]. The ancestor of the language in [Borland]'s [Delphi] and [Kylix] [GUI] development environments, which added ObjectOrientation
.
!!! A Sample
-''(I
'm off finding one right now.
)''
+ __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}
-!!! History
+(This is in the TurboPascal dialect of Pascal.)
-Pascal became popular very quickly because the original compiler[3] 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 a simple P-Code VirtualMachine for it -- they could hack the compiler around to general proper MachineCode later.
+!!! History
-This meant that Pascal spread very quickly through the world's Universities. They began teaching in Pascal, because
it was a very good langauge to demonstate StructuredProgramming in --
a topic that was in vogue
at the time[1]
.
+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 [ByteCode]s, 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 soon
began teaching in Pascal --
it was a very good language for demonstrating structured programming,
a hot
topic at the time.
-Standard Pascal was nice language with terrible limitations: Pascal programs could not open files by name and
could barely handle strings. BrianKernighan famously described Pascal's problems in [Why Pascal is Not My Favorite Programming Language |http://www.lysator.liu.se/c/bwk-on-pascal.html][2
]. These
limitations mean
that Pascal immediately
splintered into dialects as people hacked in these
missing features in incompatible ways. [C] did not have this problem, so it gradually took over from the Pascal dialects.
+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 |http://www.lysator.liu.se/c/bwk-on-pascal.html]. (It has to be noted that NicolasWirth had already addressed most of Pascal's problems in his follow-up language
[Modula2] ''before'' Kernighan wrote this paper, and in some places Kernighan 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 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].
+The most successful Pascal dialect has been Borland's TurboPascal. There are two OpenSource Pascal compilers for
[Linux]:
-The two OpenSorce Pascal compilers for [Linux] are:
[GNU Pascal | http://www.gnu-pascal.de/] and
[Free Pascal | http://www.freepascal.org/]. Free Pascal tend more towards TurboPascal compatability.
+*
[GNU Pascal | http://www.gnu-pascal.de/]
+*
[Free Pascal | http://www.freepascal.org/]
-----
-[1] it hasn't gone away: programmers just take it for granted that code should be structured now
.
+Free Pascal tends more towards TurboPascal compatibility
.
-[2] Take this with a little grain of salt
: Nicolas [Wirth
] had already addressed most of
Pascal's problems in his next langauge [Modula2] ''before'' BrianKernighan wrote this paper, and in some places BrianKernighan seems
to be
just complaining that Pascal is not [C]
.
+The online book
[Pascal Implementation
: A Book and Sources | http://www.cwi.nl/~steven/pascal/
] walks you through the source code to the original
Pascal compiler (implemented in Pascal as a RecursiveDescentParser). It
's educational
to read
just as an extended critique of a non-trivial program
.
-[3] The online book [Pascal Implementation: A Book and Sources | http://www.cwi.nl/~steven/pascal/] walks you through the source code to this compiler. It's educational to read just as an extended critique of a non
-trivial program.
+-----
+Part of CategoryProgrammingLanguages, CategoryImperativeProgrammingLanguages, CategoryMachineOrientedProgrammingLanguages