From: Dan Cross <crossd@gmail.com>
To: John Levine <johnl@taugh.com>
Cc: tuhs@tuhs.org
Subject: [TUHS] Re: Pipes (was Re: After 50 years, what has the Impact of Unix been?)
Date: Thu, 5 Dec 2024 21:21:49 -0500 [thread overview]
Message-ID: <CAEoi9W4Sy9G3pePPTk=zyh2n_UbWetNU+4c4yaVPgXX2UAacQw@mail.gmail.com> (raw)
In-Reply-To: <20241206020224.E59B3AB6EF07@ary.qy>
On Thu, Dec 5, 2024 at 9:02 PM John Levine <johnl@taugh.com> wrote:
> According to Dan Cross <crossd@gmail.com>:
> >> > diff <(old-program-version) <(new-program-version)
> >> >
> >> > to do simple regression testing.
> >>
> >> And fanout is simply
> >>
> >> ... | tee >(pipeline1) >(pipeline2)
> >
> >And indeed these things are pretty nifty, but don't they generate
> >trees, and not arbitrary dags? They don't quite capture the full
> >generality of Morrison-style networks since it doesn't seem like
> >there's a way to connect process substitution fan-out with fan-in; at
> >least, not conveniently.
>
> You can use mkfifo to make named pipes and then plumb them as wanted. It's
> not particularly beautiful but it's as general as you could want.
>
> That's worked since 4.4BSD which was quite a while ago.
Sure, but that's orthogonal since it's not really using shell syntax
to build the thing up in a canonical way. I mean, perhaps in some
literal sense it is (one types the commands into the interpreter...)
but nowhere near the expressiveness of `ls | grep foo | whatever`.
Fundamentally, the questions here are all about syntax. As I wrote in
my first email, the system calls are very general, and could be used
to build arbitrary directed graphs (not even limited to DAGs) of
processes connected by pipes in all sorts of configurations
(presumably those processes would be written to handle multiple input
and output streams), without having to resort to named pipes. One can
imagine some sort of DSL that describes such graphs of pipes and
processes (Bakul alluded to this), and an interpreter for that DSL
that creates the described set of pipes and processes, all
appropriately connected and running. One could even imagine such a
thing being used as part of a more traditional pipeline.
My claim is simply that extant shell syntax isn't really amenable to
this in a natural way. As Chet and Arnold pointed out, process
substitution as pioneered in ksh gets us a little closer, but it's not
quite as general (I believe any such graphs would have to be acyclic);
it's certainly not as syntactically pleasant.
There has been work along these lines; I was sent a reference off-list
to a paper by Spinellis and Fragkoulis about a DAG-oriented shell:
https://www.spinellis.gr/sw/dgsh/, which seems relevant.
- Dan C.
next prev parent reply other threads:[~2024-12-06 2:22 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 3:17 [TUHS] After 50 years, what has the Impact of Unix been? sjenkin
2024-12-04 13:05 ` [TUHS] " Marc Donner
2024-12-04 13:40 ` William Cheswick
2024-12-04 15:02 ` Rich Salz
2024-12-05 3:08 ` John Levine
2024-12-05 15:19 ` [TUHS] Re: Pipes (was Re: After 50 years, what has the Impact of Unix been?) Dan Cross
2024-12-05 16:00 ` John R Levine
2024-12-05 16:17 ` Heinz Lycklama
2024-12-05 17:06 ` Marc Rochkind
2024-12-05 17:53 ` John Cowan
2024-12-05 18:05 ` John Levine
2024-12-05 17:22 ` Paul Winalski
2024-12-05 18:19 ` Ron Natalie
2024-12-06 2:29 ` Adam Thornton
2024-12-07 20:38 ` Ron Natalie
2024-12-05 16:55 ` Adam Thornton
2024-12-05 17:35 ` Chet Ramey via TUHS
2024-12-05 20:55 ` arnold
2024-12-05 21:12 ` Dan Cross
2024-12-05 21:50 ` Marc Rochkind
2024-12-05 22:03 ` Warner Losh
2024-12-05 22:19 ` Chet Ramey via TUHS
2024-12-05 23:07 ` Marc Rochkind
2024-12-06 8:16 ` Diomidis Spinellis
2024-12-06 0:46 ` Alexis
2024-12-06 21:46 ` Chet Ramey via TUHS
2024-12-05 23:07 ` arnold
2024-12-06 1:09 ` G. Branden Robinson
2024-12-06 1:31 ` Greg A. Woods
2024-12-06 2:05 ` Steve Nickolas
2024-12-06 16:44 ` arnold
2024-12-05 22:05 ` Bakul Shah via TUHS
2024-12-06 2:02 ` John Levine
2024-12-06 2:21 ` Dan Cross [this message]
2024-12-06 16:46 ` arnold
2024-12-06 2:26 Douglas McIlroy
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='CAEoi9W4Sy9G3pePPTk=zyh2n_UbWetNU+4c4yaVPgXX2UAacQw@mail.gmail.com' \
--to=crossd@gmail.com \
--cc=johnl@taugh.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).