9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Sam Watkins <sam@nipl.net>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] dataflow programming from shell interpreter
Date: Wed, 27 Jan 2010 21:44:50 +1100	[thread overview]
Message-ID: <20100127104450.GC13116@nipl.net> (raw)
In-Reply-To: <c563b2f7-92ac-463a-864c-267721ddb30a@k35g2000yqb.googlegroups.com>

On Mon, Jan 18, 2010 at 10:58:30AM +0000, Tim Climber wrote:
> Is this possible for UNIX philosophy to develop further? Let's say,
> XML-coded trees or graphs instead of one-line strings in stdin/
> stdout.Or LISP S-expressions. New set of utilities for filtering such
> streams, grep for XML trees, etc. Building environment for dataflow
> programming from shell interpreter.
> Any interesting papers exist on this topic?

This is interesting.  I'm not keen on XML (except for actual markup of
documents) but dataflow programming is interesting and worthwhile.

I like graphical programming (with nodes and arcs) for this, but programs can
also be represented as plain text.  I haven't implemented much to do with this
yet, but I have thought about it at length, determined what basic operators and
forms can be used for lambda, math, sets, lists etc.

I'm interested in relational / logic / dataflow programming where for example:

  a + b c

expresses a relationship.

If b and c are known, a can be calculated:  a = b + c
If a and b are known, c can be calculated:  c = b - a

This can lead to much shorter code.  Immediately you can see there is no need
for a separate subtraction operator, it is just a different mode of addition.
Likewise / is only a mode of *.  Raising to the power, taking a root,
exponentiation and logarithms are different modes of a single operator.

  + - * / ^ log   becomes   + * ^

One basic operator is needed for sets:  the discrete union, which is like a sum:

  A B # C

means  A OR B = C,  A AND B = empty


Various list relationships such as reversal, membership, head, tail, sublist,
etc.  can be represented simply with a single list symbol.

Operators can be defined using lambda closure (a box).  An operator over
paramters A, B, C, D is effectively (from some point of view) a set of all
tuples satisfying the contained relationships  { (A,B,C,D) }

So the "lambda" box thing creates a set of possible values from a free
variable.  It can be used in reverse to produce a free variable that is a
member of a set.  (also, an instance of an operator).  Lambda, application, set
definition, and set membership are the same thing (expressed by a box).

A single processor might perform both splitting and joining of text, depending
which direction you feed the data to it, etc.  Or parsing and formatting, maybe
encoding and decoding video, etc.  There will be some components of the program
used only for encoding, some only for decoding, but much can be shared between
them.

I am not fully sure how to integrate the dataflow system with the relational
system, but it seems like these models would go very well together.  Perhaps an
abstract model of a stream (like in Haskell) would be the way, perhaps a lazy
list achieves this already.  I need to think more about this.


Sam



  parent reply	other threads:[~2010-01-27 10:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-18 10:58 Tim Climber
2010-01-18 12:19 ` Steve Simon
2010-01-18 20:04   ` Tim Newsham
2010-01-19  9:59   ` Aharon Robbins
2010-01-19 15:40     ` Steve Simon
2010-01-20 21:13       ` Eris Discordia
2010-01-20 21:41         ` Patrick Kelly
2010-01-21  8:00           ` roger peppe
2010-01-21 12:45         ` maht
2010-01-21 21:36         ` Skip Tavakkolian
2010-01-22  9:44           ` Eris Discordia
2010-01-19 22:13   ` Andy Spencer
2010-01-18 16:23 ` Eric Van Hensbergen
2010-01-18 19:23 ` Aharon Robbins
2010-01-19 22:33 ` Andy Spencer
2010-01-27 10:44 ` Sam Watkins [this message]
     [not found] <c563b2f7-92ac-463a-864c-267721ddb30a@k35g2000yqb.googlegroups.co>
2010-01-18 11:15 ` erik quanstrom
     [not found] <58d8d6b4960925aab27312e0968a3e26@quintile.net>
2010-01-18 19:39 ` Eric Van Hensbergen

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=20100127104450.GC13116@nipl.net \
    --to=sam@nipl.net \
    --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).