
APL at Its Core - panic
https://ac1235.github.io/apl.html
======
anonu
APL is cool - but the non-standard non-ASCII keyboard is a non-starter for
reaching mass-market. Q sitting on top of K is the gateway drug to people
using more APL-like languages and vector programming. However, we need an
open-source alternative to KDB+. If you want to reach mass-market you need to
be free and open and you need to provide something more than just a cool
language.

KDB+ adds a lot of important features for handling time-series, websockets,
web programming and generally scaling up to a distributed system where you
could connected different nodes to form a message bus or add your own micro-
services framework on top. You can't do that yet with any of the open-source
APL and APL-like frameworks I've seen.

~~~
alfalfasprout
It's sad how Kx systems decided to double down on making KDB so proprietary.
Had they made some part of the ecosystem open source, we'd see mass adoption
and they'd probably see more money from support contracts.

There really is nothing out there like KDB that comes close for realtime
manipulation and storage of ultra fast time series data.

~~~
anonu
I agree - could've gone the MongoDB route...

------
textmode

       cat 1.txt
    
       http://example.net/?p=
       https://www.example.com/?page=
       ...
    

For a given URL prefix in the file 1.txt, print URLs for pages 25-35. Desired
URL prefix is on line 100 of the file.

    
    
       cat 1.sh
    
       #!/bin/sh
       l=$(exec head -$2|exec tail -1);
       n=$3;while true;do
       test $n -le $4||break;
       echo $l$n;
       n=$((n+1));
       done;
    

1.sh 1.txt 100 25 35

    
    
       cat 1.k
      
       g:{_getenv x};
       u:0:g "u";
       l:0$g "l";
       b:0$g "b";
       e:0$g "e";
       `0:{,/$u[l],x}'b _!e;
    

u=1.txt l=99 b=25 e=36 k 1

------
ac1235
For those of you who also enjoy the Reddit crowd, here's a link to
r/programming:
[https://www.reddit.com/r/programming/comments/8ysgc2/apl_at_...](https://www.reddit.com/r/programming/comments/8ysgc2/apl_at_its_core/)

------
imbusy111
To me this looks like 'write-once and forget' code similar to a complex
regexp. Why is everyone raving about the incomprehensible syntax?

I admit that this is the first time I see APL code.

~~~
coldtea
> _Why is everyone raving about the incomprehensible syntax? I admit that this
> is the first time I see APL code._

You've answered your own question.

It's only "incomprehensible" if you're not familiar with it.

After you've studied it it is very powerful and very succinct.

The article even gives an example:

    
    
      Just consider the extract !'\:/:. The ! 
      operator means rotation in this context. 
      If used as n!v it rotates the vector v by 
      n. But we do not directly use the 
      operator like that, we modify it using 
      the adverb ', which generally denotes a f 
      unctional map. Now we can do something 
      like n!'m to rotate each row vector in 
      the matrix m, that is each element of the 
      vector of vectors m, by n, or more 
      generally we can say something like v!'m 
      to rotate each row m[i] in the matrix m 
      by the corresponding element of v[i]. 
    

A good analogy I would give is the equally "cryptic" to the uninitiated, but
equally fast and powerful, to those that mastered them, vi(m) text
manipulation commands -- which also use a very similar concept of modifiers
and targets and so on.

~~~
sethrin
The following video is probably reasonably well known, and I wish that I had a
more intelligent commentary than to say that it blows my mind, but it does I
think bear out the point of expressivity rather well.

[https://youtu.be/a9xAKttWgP4](https://youtu.be/a9xAKttWgP4)

Conway's _Game of Life_ in some 50 characters of APL.

