The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Adam Thornton <athornton@gmail.com>
To: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: [TUHS] Re: [COFF] Re: On Bloat and the Idea of Small Specialized Tools
Date: Sun, 12 May 2024 12:34:20 -0700	[thread overview]
Message-ID: <CAP2nic1zeJG7tkDbUnEMjxUG_TmYLwCQJhfS6Yt+E1w5s2s4cw@mail.gmail.com> (raw)
In-Reply-To: <20240511213532.GB8330@mit.edu>

[-- Attachment #1: Type: text/plain, Size: 2362 bytes --]

On Sat, May 11, 2024 at 2:35 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.  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

[-- Attachment #2: Type: text/html, Size: 2961 bytes --]

  parent reply	other threads:[~2024-05-12 19:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10 16:36 [TUHS] " Clem Cole
     [not found] ` <CAGg_6+Ov6hYTxQ5M-hEBoOiUQ0UVRP0V+aVi0STKAALLDUGY7g@mail.gmail.com>
     [not found]   ` <CAEoi9W7FbGZFhiddHWWqdivGFfgFAj9nsUApomswfP56rqTMpQ@mail.gmail.com>
     [not found]     ` <20240511213532.GB8330@mit.edu>
2024-05-12 19:34       ` Adam Thornton [this message]
2024-05-12 19:47         ` [TUHS] Re: [COFF] " Larry McVoy
2024-05-12 20:13           ` [TUHS] Re: forking, " John Levine
2024-05-12 22:56             ` Dan Cross
2024-05-12 23:34               ` Larry McVoy
2024-05-13  1:34                 ` Dave Horsfall
2024-05-13 13:21                   ` Larry McVoy
2024-05-13  3:29               ` Andrew Warkentin
2024-05-12 20:43         ` [TUHS] " Dave Horsfall
2024-05-13  2:33         ` Alexis
2024-05-13  2:57           ` Warner Losh
2024-05-13  5:23         ` markus schnalke
2024-05-13  6:18           ` Andrew Warkentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP2nic1zeJG7tkDbUnEMjxUG_TmYLwCQJhfS6Yt+E1w5s2s4cw@mail.gmail.com \
    --to=athornton@gmail.com \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).