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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9362 invoked from network); 3 Aug 2021 15:02:17 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 3 Aug 2021 15:02:17 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 8D5B39CA90; Wed, 4 Aug 2021 01:02:13 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 7C24C9CA63; Wed, 4 Aug 2021 01:01:41 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=dartmouth.edu header.i=@dartmouth.edu header.b="cTBYipTp"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 027FF9CA63; Wed, 4 Aug 2021 01:01:39 +1000 (AEST) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by minnie.tuhs.org (Postfix) with ESMTPS id B0B709CA60 for ; Wed, 4 Aug 2021 01:01:37 +1000 (AEST) Received: by mail-wm1-f44.google.com with SMTP id a192-20020a1c7fc90000b0290253b32e8796so2085555wmd.0 for ; Tue, 03 Aug 2021 08:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dartmouth.edu; s=google1; h=mime-version:from:date:message-id:subject:to; bh=qVKyY3/TxbP+VS04YP74LPKluP2G2c2K+WdnuXqBNeA=; b=cTBYipTpbtEBE2os7fr3ez9bGvLDOX8XuBtJwlf7l9EQZpHnnFxxnjD3MDLpysbspe QaH1jvfrOuS7g9m2s0L0+eU5yWuFsmvnhxzkT+IaDGO3cltmUm/FTcR4yw2xlJPNJq08 iDY7jcUivMY672y9HIG5M/ydy6ZYP3vZKreaMUb61Cs2sP5bDwhx03Qo/wXMdzUOp6nv wFlZ9X9humrAR+P1IKiBiOijQHP6S7zYEBkBQrse4hjcJBzU7uwdQJ7vt1OLBmYsYaLn GMfX8rt/6ksPhBIrznqALF4tikBlwLLMlkvnaMIMMpFSK6o0u8mA2tAuWyg3PrElIm3g Waew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=qVKyY3/TxbP+VS04YP74LPKluP2G2c2K+WdnuXqBNeA=; b=dhdvRYmaTCsVMoM8cBedOGT78a1NeQtvOPdmjsz0aQjM+KF44MIfoOWdH/HMt7TF4u 2Ekr8gjrE3zouoIgZRL5rH7F/b58odVpFIemr74Z4PUGEJDRwsVeyZkaPZHSl5YfW6hN JoHbKaTcOvuuIoOr1ZL+hAEQDgEUVob06KA3mWQyoAlDgXvg1NoWopl3/uVJuSjjeYb9 rLuOYVP94jmwwDq4VjekcNfxLWNao4I7TminQNS3To5n6tIaAEFHEZoE2H4jpg4Ui16E ulCpiXYa9vDAz+/1E2QKqlAZr43URJbDCpQmRZkYvLyaTWn6ag1Ulet4Vcn35Z5+4EpY AEcg== X-Gm-Message-State: AOAM531PNDXqJPPWGKFoasX+Tgp/ZYSucTZPc8qetWePKrbBdL9Pvl9z gHa9lXFoRNEW+C+g1F4z4ncSYzlF8RumFZ7Iklq90AgSSzSqtQ== X-Google-Smtp-Source: ABdhPJwaPC1UHBeYEC9P45acxPTM0AqFj/kvaF+Qw2Fj38Af075MgPPEy7T0N/w+K/fWzkAjpQH2NNPM25Idw96HAk4= X-Received: by 2002:a7b:c94c:: with SMTP id i12mr4832401wml.148.1628002895369; Tue, 03 Aug 2021 08:01:35 -0700 (PDT) MIME-Version: 1.0 From: Douglas McIlroy Date: Tue, 3 Aug 2021 11:01:20 -0400 Message-ID: To: The Eunuchs Hysterical Society Content-Type: text/plain; charset="UTF-8" Subject: [TUHS] Systematic approach to command-line interfaces 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: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" > fork() is a great model for a single-threaded text processing pipeline to do > automated typesetting. (More generally, anything that is a straightforward > composition of filter/transform stages.) Which is, y'know, what Unix is *for*. > It's not so great for a responsive GUI in front of a multi-function interactive program. "Single-threaded" is not a term I would apply to multiple processes in a pipeline. If you mean a single track of data flow, fine, but the fact that that's a prevalent configuration of cooperating processes in Unix is an artifact of shell syntax, not an inherent property of pipe-style IPC. The cooperating processes in Rob Pike's 20th century window systems and screen editors, for example, worked smoothly without interrupts or events - only stream connections. I see no abstract distinction between these programs and "stuff people play with on their phones." It bears repeating, too, that stream connections are much easier to reason about than asynchronous communication. Thus code built on streams is far less vulnerable to timing bugs. At last a prince has come to awaken the sleeping beauty of stream connections. In Go (Pike again) we have a widely accepted programming language that can fully exploit them, "[w]hich is, y'know, what Unix is 'for'." (If you wish, you may read "process" above to include threads, but I'll stay out of that.) Doug