From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: tuhs-bounces@minnie.tuhs.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 1ddf0340 for ; Sat, 3 Nov 2018 23:08:15 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id A8432A21C9; Sun, 4 Nov 2018 09:08:14 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 9D0D4A2042; Sun, 4 Nov 2018 09:07:55 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id A8F52A1FBA; Sun, 4 Nov 2018 08:21:50 +1000 (AEST) X-Greylist: delayed 454 seconds by postgrey-1.35 at minnie.tuhs.org; Sun, 04 Nov 2018 08:21:45 AEST Received: from insect.birch.relay.mailchannels.net (insect.birch.relay.mailchannels.net [23.83.209.93]) by minnie.tuhs.org (Postfix) with ESMTPS id 2337EA1FA4 for ; Sun, 4 Nov 2018 08:21:45 +1000 (AEST) X-Sender-Id: dreamhost|x-authsender|scj@yaccman.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 189435C3882; Sat, 3 Nov 2018 22:14:10 +0000 (UTC) Received: from pdx1-sub0-mail-a31.g.dreamhost.com (unknown [100.96.35.77]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id C2CFB5C3828; Sat, 3 Nov 2018 22:14:09 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|scj@yaccman.com Received: from pdx1-sub0-mail-a31.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sat, 03 Nov 2018 22:14:10 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|scj@yaccman.com X-MailChannels-Auth-Id: dreamhost X-Harbor-Befitting: 4c908f2e70be4338_1541283249925_752756670 X-MC-Loop-Signature: 1541283249924:4007399996 X-MC-Ingress-Time: 1541283249924 Received: from pdx1-sub0-mail-a31.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTP id 796B180290; Sat, 3 Nov 2018 15:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=yaccman.com; h=message-id :from:to:cc:in-reply-to:subject:date:content-type:mime-version; s=yaccman.com; bh=0JizYvrhoPaWSD2cg4Us1otBtOc=; b=SS5ZRHy8Pfkz3 28uQTB7PcAvbJLyUSFkHSIxyBmQJcGbIwzIYvci2FzIsMFSt0egcszAWJcHbWZxB BaKPEf/0Dhf8tg6aEZh4ycive54F/LpRTBDcVNkOnZIKT3dGzzYSE5zl/F5X4/5w YGEAKgaSx7/fmkH/yXX1KEZThnAbAY= Received: from localhost (ip-66-33-200-4.dreamhost.com [66.33.200.4]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: scj@yaccman.com) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTPSA id 8594A80287; Sat, 3 Nov 2018 15:14:08 -0700 (PDT) Message-Id: <135f4f9d6aa38aac485afb158ec1decd27922e67@webmail.yaccman.com> X-DH-BACKEND: pdx1-sub0-mail-a31 From: "Steve Johnson" To: "Larry McVoy" , "Steve Johnson" X-Mailer: Atmail 7.8.0.2 X-Originating-IP: 10.35.42.211 in-reply-to: <20181031005800.GA5670@mcvoy.com> Date: Sat, 03 Nov 2018 15:14:08 -0700 Content-Type: multipart/alternative; boundary="=_5f83d68035e0ee333a3d02a97d1395a9" MIME-Version: 1.0 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrjedugdduheekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkffhvffoihgjuffftgggsegrtderreertdejnecuhfhrohhmpedfufhtvghvvgculfhohhhnshhonhdfuceoshgtjheshigrtggtmhgrnhdrtghomheqnecukfhppeeiiedrfeefrddvtddtrdegpddutddrfeehrdegvddrvdduudenucfrrghrrghmpehmohguvgepshhmthhppdhhvghloheplhhotggrlhhhohhsthdpihhnvghtpeeiiedrfeefrddvtddtrdegpdhrvghtuhhrnhdqphgrthhhpedfufhtvghvvgculfhohhhnshhonhdfuceoshgtjheshigrtggtmhgrnhdrtghomheqpdhmrghilhhfrhhomhepshgtjheshigrtggtmhgrnhdrtghomhdpnhhrtghpthhtohepthhuhhhssehtuhhhshdrohhrghenucevlhhushhtvghrufhiiigvpedt Subject: Re: [TUHS] Archaic yacc C grammar X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --=_5f83d68035e0ee333a3d02a97d1395a9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =0A=0A=C2=A0=C2=A0=C2=A0 ----- Original Message -----=0A=C2=A0=C2=A0=C2= =A0 From:"Larry McVoy" =0A=0A=C2=A0=C2=A0=C2=A0 ...=0A=C2= =A0=C2=A0=C2=A0=C2=A0 I get that it doesn't scale but man, oh man, do I= love the=0Aearly Unix=0A=C2=A0=C2=A0=C2=A0 data structures that had one= namespace. I kinda wish you hadn't=0Afixed=0A=C2=A0=C2=A0=C2=A0 that St= eve.=0A=0AWhat was the push that made you fix it?=0A=0AIt came from Denn= is, so I can't say why he decided to change it.=C2=A0 The=0Aargument for= it is that many structures would have similar names and=0Asimilar funct= ions, such as "next" and "prev" in linked lists.=C2=A0=C2=A0=0AAdding a= new linked list action could be done much more easily by=0Acopying the= code and changing the declaration, instead of having to=0Achange ab_nex= t into cd_next, and then dealing with the inevitable=0Atypos that would= sneak a use of ab_next into code for cd.=0A=0AJust to clarify, from the= beginning I considered C to be Dennis'=0Alanguage.=C2=A0 I would make s= uggestions, and sometimes he adopted them=0A(I'm responsible for ^ as th= e exclusive OR, for example).=C2=A0 In one=0Acase, with casts, we were p= orting Unix to the 32-bit Interdata and=0Adesparately needed a cast oper= ator, but couldn't find a syntax that we=0Aliked that was general enough= to handle casts to, for example,=0Astructure pointers or function point= ers.=C2=A0 Matters were approaching a=0Acrisis, and one evening I played= with the yacc grammar and worked out=0Athe strengths and weaknesses of= the top three candidates.=C2=A0 I=0Asuggested the one that I felt was b= est, and that was what was adopted.=0A=C2=A0 The simple rule was that yo= u formed a cast by taking a declaration=0Aof what you wanted the result= to be, remove the variable being=0Adeclared, and enclose the rest in pa= rens.=C2=A0 I had implemented it and=0Asaw that it worked (because the p= ort was based on PCC, there wasn't=0Anearly the pressure to change the P= DP-11 compiler). =C2=A0 The fact that=0Awe could explain the syntax in o= ne sentence led us to feel like it=0Awould be reasonable. =C2=A0 The pro= blem, of course, is that we didn't put=0Aanything back where the variabl= e had been, so when you encounter a=0Anontrivial cast you have to enumer= ate all the possible places a=0Avariable might be and determine which on= e is syntactically correst=0Awhile your brain turns to mush... =0A=0ASte= ve=0A=0A --=_5f83d68035e0ee333a3d02a97d1395a9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


=C2=A0=C2=A0=C2=A0 ----- Original Message -----
=
=C2=A0=C2=A0=C2=A0 From:
"Larry McVoy" <lm@mcvoy.com><= /div>

=C2=A0=C2=A0=C2=A0 ...
=C2=A0=C2=A0=C2=A0=C2=A0 I get th= at it doesn't scale but man, oh man, do I love the early Unix
=C2=A0= =C2=A0=C2=A0 data structures that had one namespace. I kinda wish you ha= dn't fixed
=C2=A0=C2=A0=C2=A0 that Steve.

What was the push th= at made you fix it?


It came= from Dennis, so I can't say why he decided to change it.=C2=A0 The argu= ment for it is that many structures would have similar names and similar= functions, such as "next" and "prev" in linked lists.=C2=A0=C2=A0 Addin= g a new linked list action could be done much more easily by copying the= code and changing the declaration, instead of having to change ab_next= into cd_next, and then dealing with the inevitable typos that would sne= ak a use of ab_next into code for cd.

Just to c= larify, from the beginning I considered C to be Dennis' language.=C2=A0= I would make suggestions, and sometimes he adopted them (I'm responsibl= e for ^ as the exclusive OR, for example).=C2=A0 In one case, with casts= , we were porting Unix to the 32-bit Interdata and desparately needed a= cast operator, but couldn't find a syntax that we liked that was genera= l enough to handle casts to, for example, structure pointers or function= pointers.=C2=A0 Matters were approaching a crisis, and one evening I pl= ayed with the yacc grammar and worked out the strengths and weaknesses o= f the top three candidates.=C2=A0 I suggested the one that I felt was be= st, and that was what was adopted. =C2=A0 The simple rule was that you f= ormed a cast by taking a declaration of what you wanted the result to be= , remove the variable being declared, and enclose the rest in parens.=C2= =A0 I had implemented it and saw that it worked (because the port was ba= sed on PCC, there wasn't nearly the pressure to change the PDP-11 compil= er). =C2=A0 The fact that we could explain the syntax in one sentence le= d us to feel like it would be reasonable. =C2=A0 The problem, of course,= is that we didn't put anything back where the variable had been, so whe= n you encounter a nontrivial cast you have to enumerate all the possible= places a variable might be and determine which one is syntactically cor= rest while your brain turns to mush...

Ste= ve


--=_5f83d68035e0ee333a3d02a97d1395a9--