9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Bakul Shah <bakul+plan9@bitblocks.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] typed sh (was: what features would you like in a shell?)
Date: Mon,  6 Apr 2009 08:40:59 -0700	[thread overview]
Message-ID: <20090406154059.AB3C85B23@mail.bitblocks.com> (raw)
In-Reply-To: Your message of "Mon, 06 Apr 2009 07:09:47 EDT." <d916d0fcaa1fcc6a1d22dc4cf445c654@quanstro.net>

On Mon, 06 Apr 2009 07:09:47 EDT erik quanstrom <quanstro@quanstro.net>  wrote:
> > Nitpick: the output type of one command and the input type of
> > the next command in the pipeline has to match, not every
> > command.
>
> i think this is wrong.  there's no requirement
> that the programs participating in a pipeline are compatable
> at all; that's the beauty of pipes.

If program A outputs numbers in big-endian order and B
expects input in little-endian order, A|B won't do the "right
thing".  Even for programs like wc have a concept of a
'character' and if the prev prog. produces something else you
will be counting something meaningless.

Perhaps it is impossible to capture such type compatibility
in anything but runtime IO routines but the concept exists.

>                                      you can do things
> that were not envisioned at the time the programs were
> written.

That comes from composability.

> > To go beyond simple char streams, one can for example build a
> > s-expr pipeline: a stream of self identifying objects of a
> > few types (chars, numbers, symbols, lists, vectors). In Q
> > (from kx.com) over an IPC connection you can send strings,
> > vectors, dictionaries, tables, or arbitray Q expressions. But
> > there the model is more of a client/server.
>
> or ntfs where files are databases.  not sure if streams
> can look the same way.

May be not.  What I was getting at was that one can do a lot
with a small number of IO types -- no need for "type
profligacy"!  [Unless your definition of profligacy is
anything more than one.]  The nice thing about s-expr is that
you have a syntax for structured IO and its printer, parser
are already written for you.  Anyway, a typed sh would be an
interesting experiment.



  reply	other threads:[~2009-04-06 15:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-02 18:48 fgergo
2009-04-02 19:28 ` roger peppe
2009-04-02 20:27   ` tlaronde
2009-04-06  3:55   ` Bakul Shah
2009-04-06 11:09     ` erik quanstrom
2009-04-06 15:40       ` Bakul Shah [this message]
2009-04-06 16:02         ` erik quanstrom
2009-04-06 16:22           ` [9fans] typed sh maht
2009-04-06 16:56             ` erik quanstrom
2009-04-06 16:50           ` [9fans] typed sh (was: what features would you like in a shell?) Bakul Shah
2009-04-06 21:18           ` John Stalker
2009-04-16 17:24     ` roger peppe
2009-04-16 18:52       ` Bakul Shah

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=20090406154059.AB3C85B23@mail.bitblocks.com \
    --to=bakul+plan9@bitblocks.com \
    --cc=9fans@9fans.net \
    /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).