
Alan Kay on “What Made APL Programming So Revolutionary?” - fniephaus
https://www.quora.com/What-made-APL-programming-so-revolutionary?share=1
======
neves
I programed in APL! Sure, I just had to change an already developed code from
my MSc adviser. It was weird! First of all, you needed an special keyboard
just to use it: [http://ageinghacker.net/hacks/apl-keyboard/apl-
keyboard-1.jp...](http://ageinghacker.net/hacks/apl-keyboard/apl-
keyboard-1.jpg)

When you were not fluent, the myriad different symbols would overload your
working memory, making it very hard to program. Just needing to find the
symbols in the keyboard would make you program slowly. It had some nice ideas
about matrix programming, probably they are similar of pandas or tidy verse.
Cool, but the steeeeep learning were really terrible.

Read the article! Great reminiscences from one of greatest computer science
elders. Made me understand better the language.

------
xaedes
This code example (Nile language not APL) makes me want to look into those
languages:

[https://qph.fs.quoracdn.net/main-
qimg-07327016425ac646009769...](https://qph.fs.quoracdn.net/main-
qimg-07327016425ac6460097699f322b1a28)

I think its so beautiful, just the math written down.

~~~
sp332
I always liked this example: Conway's Game of Life in One Line of APL
[https://www.youtube.com/watch?v=a9xAKttWgP4](https://www.youtube.com/watch?v=a9xAKttWgP4)
It's esoteric as one-liners tend to be, but I think it's a fascinating
glimpse.

------
chenglou
Since Alan Kay mentioned Nile, I'm gonna dump here the list of relevant
resources on Nile and its derivative works that I've found over time:

Ohm, the successor to the parser (Ometa) used by Nile:
[https://github.com/harc/ohm](https://github.com/harc/ohm)

Maru, Nile's compiler/interpreter/whatever:
[https://www.reddit.com/r/programming/comments/157xdz/maru_is...](https://www.reddit.com/r/programming/comments/157xdz/maru_is_a_symbolic_expression_evaluator_that_can/)

Nile itself:
[https://github.com/damelang/nile](https://github.com/damelang/nile) (pdf
presentation in README)
[https://programmingmadecomplicated.wordpress.com/2017/10/11/...](https://programmingmadecomplicated.wordpress.com/2017/10/11/self-
commentary-notes-on-graphics/)

Gezira, svg drawing lib on top of Nile:
[https://github.com/damelang/gezira/blob/master/nl/stroke.nl](https://github.com/damelang/gezira/blob/master/nl/stroke.nl)
[http://web.archive.org/web/20160310162228/http://www.vpri.or...](http://web.archive.org/web/20160310162228/http://www.vpri.org/vp_wiki/index.php/Gezira)
[https://www.youtube.com/watch?v=P97O8osukZ0](https://www.youtube.com/watch?v=P97O8osukZ0)
[https://news.ycombinator.com/item?id=8085728](https://news.ycombinator.com/item?id=8085728)
(check the demo video)
[https://www.youtube.com/watch?v=ubaX1Smg6pY](https://www.youtube.com/watch?v=ubaX1Smg6pY)
(live demo on stage later on)
[https://github.com/damelang/gezira/tree/master/js/demos](https://github.com/damelang/gezira/tree/master/js/demos)
(downloadable and runnable in browser)

KScript, UI building on top of Nile:
[https://www.freudenbergs.de/bert/publications/Ohshima-2013-K...](https://www.freudenbergs.de/bert/publications/Ohshima-2013-KScript.pdf)
[http://tinlizzie.org/dbjr/KSWorld.ks/](http://tinlizzie.org/dbjr/KSWorld.ks/)

Final Viewpoint Research Institute report, where the entire system
(antialiasing, font rendering, svg, etc) was rendered using Nile into Frank,
the word/excel/powerpoint equivalent written completely in Nile + Gezira +
KScript):
[http://www.vpri.org/pdf/tr2012001_steps.pdf](http://www.vpri.org/pdf/tr2012001_steps.pdf)

VPRI wiki restored from archive.org:
[https://web.archive.org/web/20171121105004/http://www.vpri.o...](https://web.archive.org/web/20171121105004/http://www.vpri.org:80/vp_wiki/)

Shadama, which the Nile author (Dan Amelang) worked on too:
[https://2017.splashcon.org/event/live-2017-shadama-a-
particl...](https://2017.splashcon.org/event/live-2017-shadama-a-particle-
simulation-programming-environment-for-everyone)

Partial DOM reimplementation on top of Gezira:
[https://github.com/damelang/mico/blob/master/gezira/svg.js](https://github.com/damelang/mico/blob/master/gezira/svg.js)

Partial reimplementation of Gezira:
[https://github.com/Twinside/Rasterific](https://github.com/Twinside/Rasterific)

And the famous Nile Viewer itself (everything interactive):
[http://tinlizzie.org/dbjr/high_contrast.html](http://tinlizzie.org/dbjr/high_contrast.html)
[https://github.com/damelang/nile/tree/master/viz/NileViewer](https://github.com/damelang/nile/tree/master/viz/NileViewer)

Commentary: [http://lambda-the-
ultimate.org/node/4325#comment-66502](http://lambda-the-
ultimate.org/node/4325#comment-66502)
[https://fonc.vpri.narkive.com/rtIMYQdk/nile-gezira-was-
re-1-...](https://fonc.vpri.narkive.com/rtIMYQdk/nile-gezira-was-re-1-ftw)
[http://forum.world.st/Vector-Graphics-was-Pi-performance-
fun...](http://forum.world.st/Vector-Graphics-was-Pi-performance-fun-
td4690038.html)

Since Alan Kay himself is on Hacker News, maybe he can comment with more links
I couldn't find. It's hard to fire up the live Frank environment, though
understandably reproducing the working env might not have been a top goal.
Maybe someone more cunning can merge these into a single executable repo or
whatever so that I can stop playing archaeologist =)

------
bakul
Kay: > There are several modern APL-like languages today — such as J and K —
but I would criticize them as being too much like the classic APL. It is
possible to extract what is really great from APL and use it in new language
designs without being so tied to the past.

It would've been good to see specific criticism instead of being just like
classic APL.

I think many of APL/k/j verbs/adverbs can be generalized to working on streams
(dataflow programming). Perhaps Dan Amelang's very interesting work on "2.5D"
graphics can be cast into such an extended version....

~~~
vchak1
I have played with both Nile and APL now for a bit, and I have been thinking
about how to combine them. I believe if we took Nile's operator overloading,
tick syntax (s' is the previous value of s), and recursion being expressed via
streams (<< operator), and combined it with some of the higher order adverbs
of apl, it might be very interesting. In APL complex structures (say a point,
or a bezier curve) need to be broken up into constituent equal length arrays
for processing, but I believe one could just overload basic operations like +,
- , etc.

~~~
bakul
I am more familiar with k so will use it as an example. If we were to extend
it, the equivalent of some functions in compositor.nl would be something like
this:

    
    
      compositeSrc:{x} // output first arg
      compositeDst:{y} // output second arg
      compositeInvert:{+(1-x[;0];1-x[;1];1-x[;2];x[;3])}
      // take a column, invert r, g, b columns and transpose
    

where x[i;0 1 2 3] == ith (r,g,b,a) of x. No need for "∀ (A, B) >>". This is
implicit as k/APL work on whole collections. Basic operations are already
overloaded. There would need to be a way to define tuples. "x[i;2]" to refer
to ith blue value is a bit cryptic. You can define verb "blue x[i]" to do the
same but may be some language syntax would help. I can't grasp enough of Nile
through the examples I've seen so far but seems doable.

~~~
vchak1
If you take a look at things like converting beziers into sub-beziers of
specific flatness, you could express it pretty easily as a // convergence as
in k, or a power operator in apl, but it would be really nice to have the
notion of an algebra of points. So if the distance between two points is b -
a, then +/ eachprior {y-x} would give us the total length of a polyline.

~~~
bakul
This can get a bit tricky. You can do something like this today:

    
    
      d:{_sqrt+/(y-x)^2}
      ls: 2 10 # 20 _draw 0 // a list of 10 random points
      +/d':ls // total length
    

Now if x, y above are vectors of points (as opposed to vectors of pairs), and
if points have their own - verb, total length becomes "+/{y-x}':ls". But to
define such a - for point, you'd need conversion verbs (or enclose/disclose).

------
neves
Holy Sh*t! A lot of things to do and I just discovery Alan Kay's answers in
Quora: [https://www.quora.com/profile/Alan-
Kay-11](https://www.quora.com/profile/Alan-Kay-11)

