From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31787 invoked from network); 25 Nov 2021 16:37:46 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 25 Nov 2021 16:37:46 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id ABF179C778; Fri, 26 Nov 2021 02:37:41 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 2B26993D54; Fri, 26 Nov 2021 02:35:17 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bA1v9NFY"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 8A83C93D42; Fri, 26 Nov 2021 02:35:15 +1000 (AEST) Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) by minnie.tuhs.org (Postfix) with ESMTPS id B394793D1B for ; Fri, 26 Nov 2021 02:35:14 +1000 (AEST) Received: by mail-ua1-f43.google.com with SMTP id ay21so13386528uab.12 for ; Thu, 25 Nov 2021 08:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1b5GUur0MURYnNKXiDCnO3xliLwItj+QFe89ajAz1uQ=; b=bA1v9NFYGTdb/XWnpUr4AW3rgGNhZa7TnMo0Tu0ba2VrILaaXYgQcWYeaLZtdquqTN D4feBSwUz5E04wCqdpun8XDvcmnIAcd2xP+WopLs+sMf6aKQPaV/vlKZ+Fx/yQGp03xU 6tgjhSFs8wJsDFwMAH3EzBpypCSf2N2R1Cp629FcOHbLUEggVS0hxWLuVUB+uGgD4Nhv DzbAWG1ZWuOeXk+ZVLeUfzvA7rEXInHMnQZwWKB3milzYfY1cQouFqDoajnbaww7cQ3s X77bomFQqzbXlH3FedELh7kZWSnoeyZieI3PjlvhPjFFNqfHHNulywk0/Mp8LzsqjUOP vduA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1b5GUur0MURYnNKXiDCnO3xliLwItj+QFe89ajAz1uQ=; b=OgxIfdnsVquyV8Dw/aZJ2aB5V35oXilrtxmpXHvtFbToWPW2VWML6EhKpWIb6bJoU2 JBYIqqAP5icBedd6IAJMZbOMHhdqqJlyojWLhbvts6opNNEq4FFMFM5WL6O4iSEipi8Z xDax6lGjnYSEQPglbmOLk9MPwTnomGM1LLEDRb11S2cs/1zC1tdO8TBSa++Dyq0TFAgO sWtEBtgxifm1dSmG03RfdRCNDnN7MXSiorPwG7z4hr//Z1qegLyZuDFrJfqiHc9/XWcp 7j0l9UVitR0SMQ32NkSb9nBPXdgmALXbSm4AcaVcG3+PNicSeZ5Tua0APEnTsyvrpfI+ nh9w== X-Gm-Message-State: AOAM531a9rNzxmD7CSLzcy+t7l5KfzGSYdhz70gO/8h+NTQ+KurP232M qc9nCl1l0or0buNg/ByEroEFDynDGKaLHcskx/52ANXg2YA= X-Google-Smtp-Source: ABdhPJwwzAexBuVSAtfvotqrKZEwAMdf58alfcWghSVDjEypUhvWPYiS9toQk427KPgMKvPrtBorBoQYhrjj6KlIm10= X-Received: by 2002:a05:6102:304d:: with SMTP id w13mr11152506vsa.81.1637858113573; Thu, 25 Nov 2021 08:35:13 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ab0:71d0:0:0:0:0:0 with HTTP; Thu, 25 Nov 2021 08:35:13 -0800 (PST) In-Reply-To: References: From: Paul Winalski Date: Thu, 25 Nov 2021 11:35:13 -0500 Message-ID: To: Douglas McIlroy Content-Type: text/plain; charset="UTF-8" Subject: Re: [TUHS] PL/I stuff - was: Book Recommendation X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" On 11/24/21, Douglas McIlroy wrote: >> What, if any, features does PL/I have that are not realized in a modern >> language? > > 7. Astonishingly complete set of implicit data conversions. E.g. if X > is floating-point and S is a string, the assignment X = S works when S > = "2" and raises an exception (not PL/I terminology) when S = "A". This could definitely be a buzz saw without safety shields. Some of the implicit conversion rules, particularly those dealing with fixed point decimal arithmetic of mixed precision, had edge conditions that yielded non-intuitive results. I had a bug once that was due to a typo causing an unwanted implicit conversion. I had meant to type "IF A ~= B" (I'm using ~ here in place of the PL/I "not" operator--the EBCDIC angle character), meaning "IF A is not equal to B". What I actually typed is "IF A =~ B". (if A equals not-B). Both A and B were character strings. To apply the NOT operator, B was converted to a bit string with '0' converted to a zero bit and '1' to a one bit. The NOT was performed, then the bit string was converted back to a character string so that it could be compared to A. My clue as to the bug was a warning diagnostic from the compiler: "data conversion will be done by subroutine call". This almost always meant you'd accidentally invoked some kinky implicit type conversion, as was the case here. Here are some other PL/I features you don't see in modern languages. Some of these were present in the early IBM PL/I compilers but dropped from the ANSI standard: 1. Sterling pictures. These provided a convenient way to do math on and to display numbers representing pre-decimal British currency. They had pounds, shillings, and pence fields. This feature was dropped even from the IBM compilers some years after the Commonwealth nations all went decimal. 2. The DEFAULT statement. This was Forran's IMPLICIT on steroids. It let you say things like "data items with names beginning with A-G are decimal, I-N are binary, and O-Z are decimal". There could also be overlap between DEFAULT declarations. So in addition to the rule I just mentioned, you could say "A-J are fixed point and K-Z are floating point." With both of these rules in effect, identifier FOO would be implicitly "fixed decimal", J would be "fixed biary, and KOOL would be "float binary". At our PL/I shop we considered DEFAULT to be a toxic language feature that was banned. The problem is that in the presence of a complicated nest of DEFAULTs, when you see the declaration for an identifier it can be next to impossible to tell what its complete data type actually is. 3. PL/I declarations cover the entire scope of the innermost BEGIN/END block that contains them, regardless of where within that block the declaration occurs. Thus you can use variables before they are declared. This was mildly useful if you were composing a program at the keypunch. Some programmers would write down the declarations for their variables as they punched the cards, then when they came to the END statement for a block they would punch out the declarations. At our shop this, again, was considered a toxic language feature--we required all declarations to be at the start of their containing block. -Paul W.