The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Jon Steinhart <jon@fourwinds.com>
To: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] Proliferation of options is great simplification of pipes, really?
Date: Mon, 22 Feb 2021 10:27:29 -0800	[thread overview]
Message-ID: <202102221827.11MIRTKQ4069723@darkstar.fourwinds.com> (raw)
In-Reply-To: <f039c049-add5-ee79-eb5a-84c56a6fc2d2@gmail.com>

Will Senn writes:
> This is a multi-part message in MIME format.
>
> All,
>
> So, we've been talking low-level design for a while. I thought I would 
> ask a fundamental question. In days of old, we built small 
> single-purpose utilities and used pipes to pipeline the data and 
> transformations. Even back in the day, it seemed that there was tension 
> to add yet another option to every utility. Today, as I was marveling at 
> groff's abilities with regard to printing my man pages directly to my 
> printer in 2021, I read the groff(1) page:
>
> example here: https://linux.die.net/man/1/groff
>
> What struck me (the wrong way) was the second paragraph of the description:
>
> The groff program allows to control the whole groff system by command 
> line options. This is a great simplification in comparison to the 
> classical case (which uses pipes only).
>
> Here is the current plethora of options:
> groff [-abcegilpstzCEGNRSUVXZ] [-d cs] [-f fam] [-F dir] [-I dir] [-L 
> arg] [-m name] [-M dir] [-n num] [-o list] [-P arg] [-r cn] [-T dev] [-w 
> name] [-W name] [file ...]
>
> Now, I appreciate groff, don't get me wrong, but my sensibilities were 
> offended by the idea that a kazillion options was in any way simpler 
> than pipelining single-purpose utilities. What say you? Is this the 
> perfected logical extension of the unix pioneers' work, or have we gone 
> horribly off the trail.
>
> Regards,
>
> Will

I'm 99% happy with groff and its many options.  Why?  Because the various
programs (troff, pic, tbl, eqn, ...) are still available and can be composed
into pipelines of my own choosing.  The 1% unhappiness is because I think
that groff should be a shell script which it doesn't appear to be.  In my
opinion, if groff was a bad thing then one would have to question things
like scripts and aliases in general.  Groff is a composer, and composability
is a core UNIXism to me.  It would be way wrong if it replaced all of the
programs that it invoked, but it doesn't.

As an interesting example of the composability of the troff system, I did
the diagrams for my book using pic because pic is awesome.  But, despite
what it says in the No Starch Press author guidelines, they really only
accept material in word format.  I could have rendered each image as a
bitmap, but that just seemed so 80s.  Turns out that while it doesn't do
a great job, word will accept vector graphics in SVG format.  So I ran
each image through pic, through groff, through ps2pdf (embedding fonts),
through pdf2svg, and finally through inkscape to crop the image.  A tad
cumbersome, but it works, and wouldn't be easy to do on any other system.

I also did my original draft in troff and wrote a script to convert it
into openoffice XML format so that it could be word-ified.  Only part
that I couldn't figure out was how to include the figures; I could
generate the XML but it didn't work and there were no useful diagnostics
so I had to import them by hand.

Since Rob is on the list and (in)famous for the "cat -v" argument, I would
agree with him that that is not the "right" way.  Being consistent with
my position on groff, I would go for a separate show-nonprinting utility
and then, if widely used, a script that composed that and cat.

Jon

  parent reply	other threads:[~2021-02-22 18:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22  2:34 Will Senn
2021-02-22  3:32 ` G. Branden Robinson
2021-02-22  4:32   ` Dan Stromberg
2021-02-22  4:34   ` Will Senn
2021-02-22  5:45     ` G. Branden Robinson
2021-02-22 15:49   ` John P. Linderman
2021-02-22 15:57     ` William Cheswick
2021-02-22 16:03       ` John P. Linderman
2021-02-22 21:16         ` G. Branden Robinson
2021-02-22 16:02     ` Warner Losh
2021-02-22 16:12     ` Robert Clausecker
2021-02-22 17:15       ` John Cowan
2021-02-23  0:24       ` Steffen Nurpmeso
2021-02-22 21:14     ` G. Branden Robinson
2021-02-22  7:20 ` Rich Morin
2021-02-22 18:27 ` Jon Steinhart [this message]
2021-02-22 19:30   ` Richard Salz
2021-02-23  2:47 M Douglas McIlroy
2021-02-23 10:42 ` Jaap Akkerhuis
2021-02-23 13:23   ` Brantley Coile
2021-02-23 13:49 ` Ralph Corderoy
2021-02-23 15:04 Steve Simon
2021-02-24  2:42 ` M Douglas McIlroy
2021-02-24 19:38 Norman Wilson

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=202102221827.11MIRTKQ4069723@darkstar.fourwinds.com \
    --to=jon@fourwinds.com \
    --cc=tuhs@minnie.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).