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.0 required=5.0 tests=MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20890 invoked from network); 27 Feb 2022 15:04:16 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 27 Feb 2022 15:04:16 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 935099CC41; Mon, 28 Feb 2022 01:04:13 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 7047B945A5; Mon, 28 Feb 2022 01:02:01 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 70D61944BA; Mon, 28 Feb 2022 01:01:57 +1000 (AEST) Received: from mcvoy.com (mcvoy.com [192.169.23.250]) by minnie.tuhs.org (Postfix) with ESMTPS id 029EC93D6E for ; Mon, 28 Feb 2022 01:01:55 +1000 (AEST) Received: by mcvoy.com (Postfix, from userid 3546) id A428C35E424; Sun, 27 Feb 2022 07:01:55 -0800 (PST) Date: Sun, 27 Feb 2022 07:01:55 -0800 From: Larry McVoy To: Rob Pike Message-ID: <20220227150155.GG21168@mcvoy.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [TUHS] run commands at login in v6 and stty 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 Sun, Feb 27, 2022 at 10:12:39AM +1100, Rob Pike wrote: > Cpp was definitely in v6, and I'm pretty sure it was in earlier editions. > The first pass of the C compiler would invoke it if the first byte of the > source file was a '#'. However, the early version only did #define and > #include. It was rewritten for v7, I believe, introducing the catastrophe > of #ifdef, while the existential horror of #if was later still, foisted on > us by someone not in Research. > > -rob As someone who has lived through a lot of #if / #ifdef et al, I've got mixed feelings. SGI definitely abused it, Dave Cutler was asked to make NT work on MIPS and was given the IRIX kernel source as a guide. That source was riddled with #ifdef WAR where "WAR" stood for "work around" (I might have the details wrong but definitely have the idea correct). All of those work arounds were kernel code that had to be different because various MIPS chips had bugs. Cutler's response was "Send me the kernel code when you have MIPS chips that actually work". He was disgusted and I don't blame him. On the other hand, I grew up in the era that X11 was sort of new, all the vendors had their own windowing system (Sunview comes to mind), and while they all had something to be said for them (the Sunview API was really nice), they all were different. So people like me carried around an X11 source tree and built it on whatever platform I happened to be running on today (I was a contractor early on, worked on lots of different boxes). The X11 tree was a heavily ifdef-ed. And it needed to be, I don't have an answer as to how you would reuse all that code on different hardware in a better way. Yep, ugly, but having N copies of the same code, all almost the same but a little different, yeah, that's a formula for having bugs fixed in one of those copies but not the others. So while I understand (I think) Rob's distaste for #ifdef, I've been very grateful for it when I needed it. I ran ctwm on X11 for decades and everything "just worked" on Suns, SGIs, PowerPC, PARISC, etc. --lm