John Reagan wrote:
> scott moore wrote:
>> john wrote:
>>
>>> Which is the latest Pascal ANSI/ISO standard? Any free compliant
>>> implementations (I suppose gcc provides one)?
>>
>>
>> http://www.standardpascal.com
>
> BTW, the Scott's sight heavily mentions ISO 7185, you can also find
> copies of ISO 10206 (Extended Pascal) there as well if you dig around.
> I'm not sure which one you really want.
>
> The Extended Pascal standard was written as an evolution to the
> "classic" Pascal standard. The fact that ISO 7185 still even exists as
> a standard was more of a political move than a technical one.
>
> Personally, I wanted ISO 10206 to be called Pascal, not Extended Pascal.
> and to remove ISO 7185. We (well some of us) wanted to have "levels" in
> the new standard such that compilers that conformed to the old standard
> could fit into the new standard. Others found that too confusing and
> eventually went with multiple standards (which I find counter)
>
I respect you and your work a lot, but I disagree. ISO 10206 and
ISO 7185 are fundamentally different types of standards. The ISO 7185
standard was created to finalize an existing, good design. ISO 10206
was effectively "design by committee", and had no existing
implementation at the time it went to standards. ISO 7185 was
effectively certified by its designer, Niklaus Wirth. ISO 10206 was not.
I don't wish to get into issues over the appropriateness of the standard
ISO 10206, but let me say that, as a 10 year Pascal compiler designer
and implementor, I was quite shocked when I saw the 10206 standard,
shocked and dismayed. Instead of addressing the common goals and issues
of Pascal designers, the extended standard instead went on a wild spree
of useless and extensions to Pascal. It also placed things in the
language that inherently affected its efficiency. I'll go over my
complaints briefly:
1. Strings. Should never been made part and parcel of the language. The
problem at hand was dealing with dynamic arrays, and the proper solution
to that would automatically solve any need for strings. The language
C never had built in strings, and for good reason. Overgeneral strings
are an im****t from Basic, and must have so many features and overhead
to satisfy all users that they become inefficient for most purposes.
ISO 10206 "solves" dynamic arrays, but the need was felt for strings
as well. Why?
2. Modularity. Uses the convention of "prototypes" vs. "actual" modules,
that is a different, and duplicate definition of the module for use by
other modules, and for the implementation of the module. These module
definitions must be implemented and maintained separately, and
constantly reconciled. Wirth himself wrote against that scheme, noting
that if it was needed to ex****t a module defintion from an actual module
to a ****table prototype, a simple utility would suffice.
In addition, ISO 10206 uses a complex system of individually specifying
each symbol to be im****ted or ex****ted from a module, including renaming
such symbols! In no means was this complexity justified, and in fact it
points out that ISO 10206 completely lacks a namespace control system
(a la C++), which is what that was (apparently) designed to get around.
3. Promotion of function results to variables. Pascal has two major
fundamental design faults from day one. The first was lack of dynamics
(which Wirth fixed in his later languages). The second was arguably
function result assignments, which should have been pinned to the bottom
of the function as:
function x: integer;
begin
end returning <expr>
Having the compiler track function results as a pseudo variable by
allowing multiple assignments is annoying enough, but at least allows
reasonable optimization to its proper place, which is to load it into
a register at completion.
The ISO 10206 implementation of function results reminds me of a Woody
Allen joke about a man who falls out of a balcony in a theater, and
being very proud and stubborn, comes back on successive nights to jump
off the balcony again and again to try and show that he actually meant
to do that. It has no use except to try and make the language "rhyme",
as in "look, function results are really variables". No they are not.
Not funny. Move along.
4. Schemas. I have to admit, I saved this for last, deliberately. When
read the description of schemas, I frankly got mad. The problem that
NEEDED solving was dynamic arrays. What ISO 10206 gave was this new,
incredibly complex and obscure feature that nobody asked for. "lets
make it so that you can place multiple types in one variable, and select
them by a state variable". Pascal ALREADY HAD THAT. Its called a
"variant record". The only apparent reason for adding schemas is that
dynamic arrays needed a method to describing them, and instead of just
solving that case, the ISO 10206 committee decided to expand the concept
to cover all types. Most people can't even understand what the hell
ISO 10206 is saying about schemas. It is one of the most obscure,
complex, and least understandable notions of any standard I have ever
read.
Aside from just the description of schemas, the implementation of
schemas for dynamic arrays is expensive. Every dynamic array must carry
both its low and high limits along with it. There are odd cases in the
standard that I am convinced require the use of templates to solve,
which brings back one of the major design errors of Algol (basically
the use of a table that describes the in-memory format of an array).
Finally, I don't see any real way that such dynamic arrays can be
made interchangable with standard Pascal strings (arrays of characters),
meaning that users would be basically forced to start using dynamic
arrays for everything, further increasing the total cost to the
program.
To sum up, I know that you are proud of the ISO 10206 standard. But it
describes a new language aside from Pascal, with new concepts. And
frankly I don't think it shares the goals of Pascal, but rather replaces
them, and I believe that Wirth has written several papers on languages
since Pascal that show he would not think of ISO 10206 as a language
in the Pascal line of thought.
Was ISO 10206 is, is one possible extension to Pascal, one possible
way forward for the language. It is not THE way, it is not a replacement
for Pascal, and I am sorry, but getting together and getting an
international agency to publish your work does not give you any more
rights to the name "Pascal" than anyone else.
By the way, while I am annoying everyone, the removal of the ANSI
standard and replacement by ISO 7185 was, in my opinion, an undeserved
slap in the face of the creators of the ANSI standard. They created
that standard in contravention to the ISO standard for a specific
reason: that conformant arrays was, in fact, an extension to Pascal
and not part of the language proper. In fact, conformant arrays
should have been handled by a proper dynamic array facility instead
of the very limited capability they provided. Conformant arrays
should have been left to an extended standard, and indeed, even
ISO 10206 has another duplicate method to handle this (schemas).
Scott Moore


|