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 09:50:10 -0700	[thread overview]
Message-ID: <20090406165010.9745B5B23@mail.bitblocks.com> (raw)
In-Reply-To: Your message of "Mon, 06 Apr 2009 12:02:21 EDT." <f51c9682ec37dabe0f71590a7321fb56@quanstro.net>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2104 bytes --]

On Mon, 06 Apr 2009 12:02:21 EDT erik quanstrom <quanstro@quanstro.net>  wrote:
> > 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".
>
> non-marshaled data considered harmful.  film at 11.  ☺

In effect you are imposing a constraint (a type discipline).
Even if the programs themselves check such constraints, the
compatibility idea exists.

> what i said was not that A|B "makes sense" for all A and B
> and for any data but rather that using text streams makes
> A|B possible for any A and any B and any input.  the output
> might not be useful, but that is a problem on a completely
> different semantic level, one that computers are usually no good at.
> alsi, i don't think that "type compatability" is sufficient
> to insure that the output "makes sense".  what if A produces
> big-endian times in ms while B expects big-endian times in µs.

In effect you are saying that text streams allow nonsensical
pipelines as well as sensible ones and anything other than
text streams would imply giving up freedom to create sensible
pipelines as yet unthought of.  No disagreement there but see
below.

> > 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.
>
> that's why plan 9 uses a single character set.
>
> but forcing compability seems worse.  where are these decisions
> centralized?  how do you change decisions?  can you override
> these decisions (cast)?  how does the output of, say, awk get
> typed?

I am not suggesting forcing anything; I am suggesting
experimenting with s-expr streams (in the context of "typed
sh" idea). I don't know if that buys you anything more or if
you give up any essential freedom.  My guess is you'd build
something more scalable, more composable but I wouldn't
really know until it is tried.  I imagine s-expr-{grep,awk}
would look quite different from {grep,awk}.  May be you'd end
up with something like a Lisp machine.



  parent reply	other threads:[~2009-04-06 16:50 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
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           ` Bakul Shah [this message]
2009-04-06 21:18           ` [9fans] typed sh (was: what features would you like in a shell?) 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=20090406165010.9745B5B23@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).