APL at Its Core
ac1235.github.io
ac1235.github.io
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.
Would Jd (https://code.jsoftware.com/wiki/Jd/Index) be adequate here?
> Non-commercial use is free.
Do you mean that not only the DB has to be open source, but it also should be free-as-in-beer?
A few companies manage to get people to pay for tools (e.g. Unity, Visual Studio), but they're the exception, and it's more due to a lack of open source offerings with comparable features.
No one would pay a license for a new JS framework or for a compiler outside of niches, which is where proprietary tools still survive.
If you want mass adoption, you need a complete free offering (as in beer and as in freedom). Which sucks for the tool vendors, since that's a lot harder to monetize, if not impossible.
On the other hand, it's a boon for people getting started since they can try out all these tools without a monetary investement, and it's great for companies who don't need to pay for the code they base their whole business on.
There really is nothing out there like KDB that comes close for realtime manipulation and storage of ultra fast time series data.
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 1I 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.Conway's Game of Life in some 50 characters of APL.
...and once you learn it, it feels as natural as any other language.