[TUHS] Proliferation of options is great simplification of pipes, really?

Warner Losh imp at bsdimp.com
Tue Feb 23 02:02:40 AEST 2021


On Mon, Feb 22, 2021 at 8:50 AM John P. Linderman <jpl.jpl at gmail.com> wrote:

> I can imagine a simple perl (or python or whatever) script that would run
> through groff input, determine which preprocessors are *actually* needed,
> and set up a pipeline to run through (only) the needed preprocessors in the
> proper order. I wouldn't have to tell groff what preprocessors I think are
> needed, and groff wouldn't have to change (although my script would) when
> another preprocessor comes into existence. Modern processors are fast
> enough, and groff input small enough, that the "extra" pass wouldn't be
> burdensome. And it would take the burden off me to remember exactly which
> preprocessors are essential. -- jpl
>

Yea, that's the main benefit of extra flags to commands: you can optimize
the number of filters that data passes through, or you can do things with
'hidden state' that's hard to do in another phase of the output. ls is a
good example. ls -lt is relatively easy to do the sorting of times and the
formatting of times inside ls, but harder to do as a filter since times are
hard to sort...

Warner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20210222/52c107d5/attachment.htm>


More information about the TUHS mailing list