On Jun 25, 2018, at 2:33 AM, Ethan A. Gardener <eeke...@fastmail.fm> wrote:
> 
> On Thu, Jun 21, 2018, at 7:03 PM, Bakul Shah wrote:
>> On Jun 21, 2018, at 8:23 AM, Ethan A. Gardener <eeke...@fastmail.fm> wrote:
>>> 
>>> Thanks! I don't know APL at all, beyond the fact that its need for a 
>>> graphical (or at least sophisticated) display held it back in the past. I 
>>> should probably look into it now, I'm sure it would save me from making 
>>> some mistakes in my design.
>> 
>> Languages j, k & q are ascii only. K is
>> quite minimalist (compared to APL & j).
>> I quite like Scheme, k and plan9 for
>> their minimalist aesthetics.
> 
> I have briefly used q and pure, but I remember nothing practical about
> them, only that pure is a verbose q.  I've looked into APL a little
> now, got an introduction from a 1975 video which was interesting and a
> little amusing, and had a look at aiju's k pages --

I was talking about kx.com's array language q, which is a thin layer
on top of k4 and it quite SQLish. Very different from the equational
language Q or pure.

> http://aiju.de/code/k/ . I think the idea of combining operators is
> really cool, but I'm certain I'd get mixed up with both APL and k in
> the same way I struggle with regexps.

stream programming rc/sh style is a bit like array programming.
In sh you'd write

        f < inputFile | g | h
or
        f < inputFile | g | h > outputFile

In an apl (array prog. lang.) such as k you'd write

        h g f inputArray
or
        outputArray: h g f inputArray
        
Of course,
a) there is no side channel of stderr for apls.
b) apls have a lot of functions built in, while shells do not
   and rely on external programs.
c) apls use variables where shells use external files.

To operate on a number of files, in sh you'd have to do

        for x in a b c; do f $x | g | h ; done

in k you'd use the each operator ('):

        {h g f x}'(a;b;c)

A shell can only use pipes (byte streams) to connect functions
(implemented as programs). In contrast apls have much richer
data types and functions.

An interesting experiment would be to try to combine the two
models in one language.



Reply via email to