Computer Old Farts Forum
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Dan Cross <crossd@gmail.com>
Cc: coff@tuhs.org
Subject: [COFF] Re: [TUHS] On Bloat and the Idea of Small Specialized Tools
Date: Sat, 11 May 2024 17:35:32 -0400	[thread overview]
Message-ID: <20240511213532.GB8330@mit.edu> (raw)
In-Reply-To: <CAEoi9W7FbGZFhiddHWWqdivGFfgFAj9nsUApomswfP56rqTMpQ@mail.gmail.com>

On Sat, May 11, 2024 at 09:12:33AM -0400, Dan Cross wrote:
> On Fri, May 10, 2024 at 7:23 PM Nevin Liber <nliber@gmail.com> wrote:
> > A lot of "bloat" comes because our systems really aren't focused on "discoverability".
> >
> > While I probably have used "pr" in the past, I've totally forgotten, the name "pr" doesn't really help me understand what it is for, and it's just one of 982 files in my /usr/bin directory alone.  How does one discover it?
> 
> This is a fantastic question. At one point, I went through every
> command in /bin and /usr/bin and figured out what it did. That was a
> tremendously useful exercise, but that was in the days when the total
> number of commands in those directories numbered in the low hundreds;
> 982 is a lot.

Yeah, I think that a lot of this goes back to scalability.  What might
work well in the simpler world of V7 Unix might be more challenging
probem space today.  One example of this is how many people got
started with Kernel programming.  When I first started working on
Linux, which was back in 1991, I could print out all of the kernel
source (heh, using "enscrpt -2rGh") and that was less than an inch
think of paper, and I could read it all.  I'm sure people had done
similar things with the Unix source code, or via the underground
photocopied of the Lyons book (AT&T copyright be d*mned :-).  But
today, that's really not a practical way for people to get started
with Unix/Linux systems programming.

Another example of this is if you want to do something with more
complex data than just plain text files with fixed data fields that
you could manipulate using sort, awk, and Unix pipes.  What if you
>need more complex structured data, stored say in JSON?  Sure, you can
do something with pipes and jq.  So sure, I can do something that is
more true to the Unix philosphy like this:

	    gcloud compute instances describe \
			--zone "$z" "$i" --format=json > "$inst_info"
	    kver=$(jq < "$inst_info" 2> /dev/null \
		'.metadata.items[] | select(.key == "kernel_version") | .value' | \
			sed -e 's/^"//' -e 's/"$//' \
			    -e 's/^Linux xfstests-[0-9A-Za-z-]* //' -e 's/ .*//')
`	    gce_status=$(jq < "$inst_info" .status | \
			    sed -e 's/^"//' -e 's/"$//')
	    status=$(jq < "$inst_info" 2> /dev/null \
		'.metadata.items[] | select(.key == "status") | .value' | \
			    sed -e 's/^"//' -e 's/"$//')
	    ip=$(jq < "$inst_info" 2> /dev/null \
		    '.networkInterfaces[] | .accessConfigs[] | select(.name == "external-nat") | .natIP' | \
			sed -e 's/^"//' -e 's/"$//')


...  but arguably, this is at the limit at what you can do using Unix
pipes as opposed to using Perl or Python.... but commands like:

	jq '.metadata.items[] | select(.key == "kernel_version") | .value'

is doing a huge amount of the heavy lifting.

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.

Cheers,

     	      		       	     - Ted

  parent reply	other threads:[~2024-05-11 21:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10 16:36 [COFF] " Clem Cole
2024-05-10 23:02 ` [COFF] Re: [TUHS] " Steffen Nurpmeso
2024-05-11  9:18   ` [COFF] " Ralph Corderoy
2024-05-11 21:18     ` Steffen Nurpmeso
2024-05-11 21:33       ` Larry McVoy
2024-05-10 23:22 ` [COFF] Re: [TUHS] " Nevin Liber
2024-05-11  9:31   ` [COFF] " Ralph Corderoy
2024-05-11 12:51   ` [COFF] Re: [TUHS] " John P. Linderman
2024-05-11 13:12   ` Dan Cross
2024-05-11 14:41     ` Bakul Shah via COFF
2024-05-11 15:45     ` Grant Taylor via COFF
2024-05-11 17:18       ` [COFF] " Ralph Corderoy
2024-05-11 21:35     ` Theodore Ts'o [this message]
2024-05-12  7:13       ` [COFF] Re: [TUHS] " Gergely Buday
2024-05-12  7:29       ` [COFF] " Ralph Corderoy
2024-05-12 22:23         ` Dave Horsfall
2024-05-11 19:24   ` [COFF] Re: [TUHS] " Clem Cole
2024-05-13  6:20   ` [COFF] " Arno Griffioen via COFF

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=20240511213532.GB8330@mit.edu \
    --to=tytso@mit.edu \
    --cc=coff@tuhs.org \
    --cc=crossd@gmail.com \
    /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).