The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Paul Winalski <paul.winalski@gmail.com>
To: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] PL/I stuff - was: Book Recommendation
Date: Fri, 26 Nov 2021 11:59:35 -0500	[thread overview]
Message-ID: <CABH=_VQpRTMz+=7dFbZFD16qt6h_p54xU93Km77F54QdCR76Bg@mail.gmail.com> (raw)
In-Reply-To: <CABH=_VQL1+WnaR4Dn44o_vOvKLrVonx0POU6g5CG-fVckp6Znw@mail.gmail.com>

Back in the pre-virtual-memory days of the System/360, IBM offered its
compilers in at least three variants:  F, G, and H.  They differed in
the amount of memory required and in features and especially the
sophistication of the optimizations they performed.  IBM PL/I H
required the most memory and performed the highest levels of
optimization.

There were some source language features to aid in optimization.

My shop used PL/I F on DOS/360.  It had one optimization-related
source feature:  the RECURSIVE  and REORDER keywords on the PROCEDURE
statement.

A procedure that may be called recursively, either directly or
indirectly, must have the RECURSIVE attribute.  This tells the
compiler to allocate local variables and temporaries on a call stack
as opposed to statically.  The ABIs for modern OSes always maintain a
stack for procedure calls--not so with S/360/70 OS and DOS.

The REORDER attribute tells the compiler that it is permitted to
execute statements or pieces of statements in an order other than that
explicitly specified in the program, as long as the end result has the
same semantics.  This is taken as a given in modern compilers.

The higher-optimizing versions of IBM S/360 PL/I also had two
PROCEDURE attributes USES and SETS that allowed the programmer to warn
the compiler of side effects.  The USES attribute lists identifiers
global to the procedure that the procedure may read from, either
explicitly or implicitly.  The SETS attribute similarly lists
identifiers that may be modified by the procedure.  If USES is
specified, the compiler can assume that no other global data are
accessed, ans similarly if SETS is specified the compiler can assume
that no other global data will be modified.

Modern compilers perform global data flow analysis for all parts of
the program accessible to the current compilation.  While USES and
SETS even today can potentially be helpful in describing obscure side
effects, they were a very error-prone feature in their day and a real
maintenance nightmare.  They never made it into the ANSI standard and
I think they've been dropped from modern IBM PL/I compilers.

-Paul W.

  parent reply	other threads:[~2021-11-26 17:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 23:54 Douglas McIlroy
2021-11-25 16:35 ` Paul Winalski
2021-11-25 18:15   ` Steve Nickolas
2021-11-26 16:59   ` Paul Winalski [this message]
2021-11-26 20:30     ` Tom Ivar Helbekkmo via TUHS
2021-11-26 21:22       ` John Cowan
2021-11-27  0:01         ` George Michaelson
2021-11-27 16:12           ` Paul Winalski
  -- strict thread matches above, loose matches on Subject: below --
2021-11-27 15:25 Noel Chiappa
2021-11-27 15:53 ` Charles H Sauer
2021-11-16 14:57 [TUHS] " Douglas McIlroy
2021-11-23  2:28 ` Mary Ann Horton
2021-11-23 21:54   ` Thomas Paulsen
2021-11-24 15:18     ` Richard Salz
2021-11-24 22:19       ` Charles Anthony
2021-11-24 22:29         ` [TUHS] PL/I stuff - was: " Will Senn
2021-11-24 23:00           ` Rob Pike
2021-11-24 23:13             ` Richard Salz
2021-11-25  1:48           ` Nelson H. F. Beebe
2021-11-25  2:03             ` George Michaelson
2021-11-25 14:47               ` Clem Cole
2021-11-26 22:20                 ` Alan Glasser
2021-11-26 22:33               ` Alan Glasser
2021-11-27  0:23               ` Dennis Boone
2021-11-27  0:30                 ` Larry McVoy
2021-11-27  0:47                   ` Charles H. Sauer
2021-11-27  2:43                     ` Alan Glasser
2021-11-27  0:56                   ` Warner Losh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABH=_VQpRTMz+=7dFbZFD16qt6h_p54xU93Km77F54QdCR76Bg@mail.gmail.com' \
    --to=paul.winalski@gmail.com \
    --cc=douglas.mcilroy@dartmouth.edu \
    --cc=tuhs@minnie.tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).