From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from minnie.tuhs.org (minnie.tuhs.org [50.116.15.146]) by inbox.vuxu.org (Postfix) with ESMTP id 7AF0626641 for ; Sun, 12 May 2024 21:34:52 +0200 (CEST) Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 54D8343349; Mon, 13 May 2024 05:34:46 +1000 (AEST) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by minnie.tuhs.org (Postfix) with ESMTPS id 2BFC943347 for ; Mon, 13 May 2024 05:34:34 +1000 (AEST) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a59a8f0d941so868366566b.2 for ; Sun, 12 May 2024 12:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715542472; x=1716147272; darn=tuhs.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=pAuGrPi4c/Zi7R1D8XoDyy/4otf67pTwl8hGjljyqUI=; b=aJVb91ccq9/eYj+HOLwOXaz1aviPGnjIlig4SitHHVfma+bnAXeP+k5x40i8fwaf70 7l3S2vbPAgElO0m3dl5yVM2zENTAZC2uNdroDu+eKqO6mpZRZF6UtGNfEnFu8O8OgLUs c92VNinLKIDfe4skvu8fq58pi6PdDEyCHf5kyuE/g6DS+mJYuYXQpukONsFzAiXJOM05 HYZlcpewOJvpabpXkKfrwrLTYq8r/EQQPtK5CNshk35e1C6hYXfZgx5cB45pHmI7KSvn 0g0sLq9OiB5TIaCqmXxEdyVZd3eyprQtyqrQyp9WFZQlqIHx89R6iPRWZPMWU7Mg1rua b2kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715542472; x=1716147272; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pAuGrPi4c/Zi7R1D8XoDyy/4otf67pTwl8hGjljyqUI=; b=O+1/8xDnUypW4QR13snemOyn6SheVIoTthD2Fhj+Fe/iEuSyJaKlg/O96XmzB9nnO4 /4GWUmGrd4bCaJJ6GYxfehFNbXbtt3fkH2WHq9CmgVQbXfx9N6seywrix+CLqBQ3gWGu iRsE8tij2ICvW0atldkelJE8M2vsS0Yfg41DwzWfzJW6HMkwYZVvYgnJxxeeSk2wBPnk +Rpo2B17T7MQwVWA7VO1VVOyLd3YDy2XN+FwjQJBvposvXZBwxwhUYvIhM873s4Ircpp inZBUg5brk9VYd60QIrpVqxhQ3yhQCQl+VbensBRKJnzf1lXVgm+xgHkI3P8ComYcDK5 4Szg== X-Gm-Message-State: AOJu0Yw+XMghElocl2T+g5EVu3/Yy0tOJIORmbJGJ4CGHyrL6h9hgoP/ bmcEZF+VdG+l02IU4I6fi+09OIQOQM6oHrrgUm+hGXCMJJHF3v8ZKEC6ytKgBkQkXkw/HcONAjP TNEXMqcUUbZwMWtIhLGN/LlrWfZlCf9qN060= X-Google-Smtp-Source: AGHT+IFEZbAEKhX3cDDisodinnAMG3s81VwhMqyjBu/wTzDbVHO7Y0DWw8nR2uFSXFKbbUVE4lhQqWO55v3xoYddVhw= X-Received: by 2002:a50:d503:0:b0:56e:215b:75c2 with SMTP id 4fb4d7f45d1cf-5734d5c137amr5132822a12.17.1715542472299; Sun, 12 May 2024 12:34:32 -0700 (PDT) MIME-Version: 1.0 References: <20240511213532.GB8330@mit.edu> In-Reply-To: <20240511213532.GB8330@mit.edu> From: Adam Thornton Date: Sun, 12 May 2024 12:34:20 -0700 Message-ID: To: The Eunuchs Hysterical Society Content-Type: multipart/alternative; boundary="000000000000a8a158061846dbea" Message-ID-Hash: V4T3KHMPRKVD52BXHUC4OBC4FASREEUR X-Message-ID-Hash: V4T3KHMPRKVD52BXHUC4OBC4FASREEUR X-MailFrom: athornton@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: [COFF] Re: On Bloat and the Idea of Small Specialized Tools List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --000000000000a8a158061846dbea Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, May 11, 2024 at 2:35=E2=80=AFPM Theodore Ts'o wrote= : > > I bet most of the young'uns would not be trying to do this as a shell > script, but using the Cloud SDK with perl or python or Go, which is > *way* more bloaty than using /bin/sh. > > So while some of us old farts might be bemoaning the death of the Unix > philosophy, perhaps part of the reality is that the Unix philosophy > were ideal for a simpler time, but might not be as good of a fit > today I'm finding myself in agreement. I might well do this with jq, but as you point out, you're using the jq DSL pretty extensively to pull out the fields. On the other hand, I don't think that's very different than piping stuff through awk, and I don't think anyone feels like _that_ would be cheating. And jq -L is pretty much equivalent to awk -F, which is how I would do this in practice, rather than trying to inline the whole jq bit. But it does come down to the same argument as https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.= pdf And it is true that while fork() is a great model for single-threaded pipeline-looking tasks, it's not really what you want for an interactive multithreaded application on your phone's GUI. Oddly, I'd have a slightly different reason for reaching for Python (which is probably how I'd do this anyway), and that's the batteries-included bit. If I write in Python, I've got the gcloud api available as a Python module, and I've got a JSON parser also available as a Python module (but I bet all the JSON unmarshalling is already handled in the gcloud library), and I don't have to context-switch to the same degree that I would if I were stringing it together in the shell. Instead of "make an HTTP request to get JSON text back, then parse that with repeated calls to jq", I'd just get an object back from the instance fetch request, pick out the fields I wanted, and I'd be done. I'm afraid only old farts write anything in Perl anymore. The kids just mutter "OK, Boomer" when you try to tell them how much better CPAN was than PyPi. And it sure feels like all the cool kids have abandoned Go for Rust, although Go would be a perfectly reasonable choice for this task as well (and would look a lot like Python: get an object back, pick off the useful fields). Adam --000000000000a8a158061846dbea Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, May 11, 2024 at 2:35=E2=80=AF= PM Theodore Ts'o <tytso@mit.edu= > wrote:

I bet most of the young'uns would not be trying to do this as a shell script, but using the Cloud SDK with perl or python or Go, which is
*way* more bloaty than using /bin/sh.

So while some of us old farts might be bemoaning the death of the Unix
philosophy, perhaps part of the reality is that the Unix philosophy
were ideal for a simpler time, but might not be as good of a fit
today

I'm finding myself in agreement.= =C2=A0 I might well do this with jq, but as you point out, you're using= the jq DSL pretty extensively to pull out the fields.=C2=A0 On the other h= and, I don't think that's very different than piping stuff through = awk, and I don't think anyone feels like _that_ would be cheating.=C2= =A0 And jq -L is pretty much equivalent to awk -F, which is how I would do = this in practice, rather than trying to inline the whole jq bit.

<= div>

--000000000000a8a158061846dbea--