John Cowan <
co...@ccil.org> wrote:
First, I’d like to say that I’m happy to see this discussion about the
language. It’s like a breath of fredh air.
> On Sunday, September 11, 2022 at 8:27:55 PM UTC-4, Robin Vowels wrote:
>
>>> conditions: name, stringrange, stringsize, subscriptrange
>
>> Again, the committee had no idea what it was doing to exclude these.
>> SUBSTR is essential in any program using arrays.
>> STRINGSIZE and STRINGRANGE are essential for the same reason
>> in string-handling.
>
> Appendix D, which my post is a precis of, excludes them as "debugging
> conditions", which are useful in testing code that may be buggy, but not
> useful in production code.
IMNSHO, as a long-time PL/I programmer, STRINGSIZE is completely useless.
The good thing about PL/I string handling, as opposed to C
et.al. is the
ability to move strings around without considerations of size, and have
generated code truncate or pad as necessary. I don’t use STRINGRANGE and
SUBSCRIPTRANGE very often. Where necessary I’ll code my own subscript
checks.
>
>> Their omissions would take us back to the says of FORTRAN IV,
>> when stepping past the bounds of an array went undetected
>> and difficult to find.
>
> Not at all. It is one thing to detect an error, another to provide a way
> to intercept the error and take corrective action, which is why you need
> a CONDITION. Compilers have two possibilities in the absence of these
> conditions: one is to raise an ERROR condition with a suitable ONCODE,
> and another is to log the error and have the program fail. A third is
> to let the program dance the fandango on core, but that is certainly not a requirement.
>
> (That said, I have never been happy with the idea of having such tests in
> debug mode but removing them from production code: I think it was Fred
> Brooks who said it was like carrying lifeboats while you were tooling
> around the harbor and leaving them behind when you headed out to sea.)
Probably not so much with these conditions, but I’m occasionally burned
when I pull out some debug code and discover it did something necessary.
>
>>> get/put keyword: data
>
>> Obviously the Committee had no idea what the facility was used for.
>
> The Committee's job was not to remove useless features: every feature is
> useful to some programmer for writing some program, and generally more
> than one of each, or it wouldn't have been included. Their job was to
> remove features that, in their expert judgement, cost more (implicitly:
> under the conditions of programming 35 years ago) than the benefits they
> provided to the PL/I community as a whole. I assume the cost in question
> was runtime memory, something that isn't nearly as expensive as it was then.
>
> Note also that the motivation for the 1987 revision of Subset G, which is
> what I'm working from, was primarily to add back features omitted from
> the original 1981 version that made the language excessively spare.
> Perhaps a later revision, if there had been one, would have added back
> GET/PUT DATA as memory restrictions loosened over time. That no such
> revision ever happened is beyond anyone's control today.
GET/PUT DATA without a data list is a nightmare. The program had to know
all the variables that are “known” at that point in the program and keep
the text of all fully-qualified names. I’ve seen “GET DATA;” used once or
twice, to good effect, but the scope has to be carefully limited.
>
>>> attributes: complex, controlled, generic, like, local, position
>> .
>> Omitting COMPLEX and CONTROLLED would produce a mickey-mouse
>> language of little practical value.
>
> To say that is to ignore the history of the last 45 years, my entire
> career in the trenches as a professional programmer, during which time I
> have used many, many languages and never needed either feature.
> Scientific programming is a niche, and in a relative sense is a smaller
> niche than ever. See above concerning costs and benefits. As for
> private stack allocation, which is what makes CONTROLLED unique, AREA
> seems to me to subsume much of that. (If this is not so, or anything
> else I say is wrong, please let me know.)
Robin has a scientific programming bias, so I can see where he’d need
COMPLEX. I’m still playing around with re-compiling IBM’s Scientific
Subroutine Package, and I’m adding the features it uses - COMPLEX and iSub
being the two major ones remaining. I now have all the math builtins done.
This is going fairly well. Within the limits of accuracy of FLOAT values
I’m getting the same results, with only minimal source changes. Working on
this, I’ve seen the usefulness of these features.
>
> That said, I certainly do not scorn complex numbers, even if they
> represent half the arithmetic types of PL/I, which is why I proposed
> adding back COMPLEX FLOAT, far and away the typical use case.
>
--
Pete