[stack] Abstracting away the complexity is the goal.

chris glur <[email protected]> Sat, 20 Feb 2010 18:26:21 +0200
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
I refute the contention that human readability is NOT the most important
 attribute of programs.

Here's a real-life task, for which I'd like to see the cat-like skeleton code:-

Previously we had Usenet. Now the kiddies have moved over to blogs.
It's like the crowding-out of public transport by private cars.
With Usenet, individual articles could be indexed. With blogs the whole
article and comment set is an atomic unit.
Usenet was designed by engineers via RFCs. Blogs evolved chaotically
like natural language.

So, for the  professor's blog that gives 4 new topics per week, where I've
asked a question ca. 2 weeks ago, to find possbible answer/s; since blogs
have removed the reader's capability of originating a topic, I had to slip my
question, into the comment-set of one of the blog-owner's topics.

How will cat-like help me find possible answers to my query?

First I'm trying to find my query that a scribbled in a open file on my PC.

Here's how algol-like does it:
 FOR AllFiles in dir-tree  X    FOR AllFiles < 15DaysOld
      FOR Allfiles containing GuessWord1
        FOR Allfiles containing GuessWord2
          FOR Allfiles containing GuessWord3

I speculate that if I can guess 3 uncommon/key words that I'd put in my post,
 it might reduce the search to less then 10 files -- on my PC.

With some difficulty, via usenet queries, I previously found [and often use it]
that the first 3 of the 5 steps listed above, can be done easily by:--
    find $dir  -ctime -$daysOld  -exec grep -l $String  {} \;

What I like about this is that I can percieve it as BLOB with 3-args:
1. the dir-tree, 2. how many days old, 3. the Search-word.

So now to further reduce the files needing to be to manually searched, I
need to 'pipe' the results through 2 further stages of `BLAB GuessWordn`.

I'm dreaming of a cat-like/dataflow language which looks like:-

DirTree DaysOld String `DASfind` | GuessWord2 `ListFilesWithString`
    | GuessWord3 `ListFilesWithString`

I've put the `operators` in " ` ".

What appeals to me about this 'programming style' is that you can just put
the utilities in a library, and grab them whenever you need them.

The first unix utility above, I was 'given' and don't [want to] fully
understand, except to comment that each (file < DaysOld) would need to be
found, before it can be tested for, or not containing  $String.
So, the 'local variable' of a file or perhaps [since grep does one line at
a time] a line [of unlimited length] has to be held [point-free/unconcerned
about ?].  It's really nice to be able to abstract-away such details, when
you've had decades of having to caretake every bit.

BTW, I've got my own little few-lines utilitiy, which I 'paste around',
to 'process a list of files' as will be needed above for GuessWord2 & 3.

AFAIK Haskell and others have the mapcar-concept of:
 DoTask (TheTask, ListOfFiles)  -> ListOfFiles

Does joy have a mapcar-type as 'native' ?
Where are joy's reserved words listed ?

== Chris Glur.