
Conway's Game Of Life in APL (2009) [video] - kick
https://www.youtube.com/watch?v=a9xAKttWgP4
======
dang
2015:
[https://news.ycombinator.com/item?id=10366441](https://news.ycombinator.com/item?id=10366441)

2012 (1 comment):
[https://news.ycombinator.com/item?id=4611015](https://news.ycombinator.com/item?id=4611015)

2012 (2 comments):
[https://news.ycombinator.com/item?id=3840273](https://news.ycombinator.com/item?id=3840273)

2011:
[https://news.ycombinator.com/item?id=2547655](https://news.ycombinator.com/item?id=2547655)

2010 (1 comment):
[https://news.ycombinator.com/item?id=1499630](https://news.ycombinator.com/item?id=1499630)

2010:
[https://news.ycombinator.com/item?id=1041500](https://news.ycombinator.com/item?id=1041500)

2009 (1 comment):
[https://news.ycombinator.com/item?id=451923](https://news.ycombinator.com/item?id=451923)

2008:
[https://news.ycombinator.com/item?id=204042](https://news.ycombinator.com/item?id=204042)

I really need to write code to do this.

~~~
saagarjha
I hear Algolia has an API ;)

------
dimator
One thing that I've always noticed about this video is how much it makes sense
when explained iteratively at each step. The final product, though, I can't
picture that checked into source control for someone to understand weeks or
months after it was thought through and written. Unpacking the final form
seems almost impossible.

I'd love to know the software engineering side of using APL. For the same
reasons that using esoteric bashisms instead of say a clearer python script is
bad form, I can't picture APL fitting into good engineering practice. Maybe
once you think in APL, it all works out fine.

~~~
kick
APL is readable more or less like you'd read English, so it's not hard to
decipher. You can find a lot of talks on the normal video-sharing sites from
people like Aaron Hsu and Roger Hui demonstrating this. The modern Dyalog
_style_ of writing it is (in my opinion) a bit harder to decipher than other
ways, though (at least, the style used in their public code repositories);
it's much too long, and looks more or less like BASIC with symbols nowadays.

When you internalize the parsing model, it's downright trivial to read pretty
much anything in it or its dialects.

~~~
clarry
> You can find a lot of talks on the normal video-sharing sites from people
> like Aaron Hsu and Roger Hui demonstrating this.

If you have a good one in mind, please do recommend!

Last night I watched this:
[https://www.youtube.com/watch?v=IKfJRyoiBlY](https://www.youtube.com/watch?v=IKfJRyoiBlY)

(found via r/apljk, posted by Kari himself IIRC)

This one uses pretty simple constructs though, mostly ones I'm already
familiar with. It (intentionally) avoided reading the more complicated
expressions.

(Also if there's another active online community around APL & similar
langauges, I'd like to know about it)

~~~
clarry
I think I found a nice example:
[https://youtu.be/v7Mt0GYHU9A?t=1237](https://youtu.be/v7Mt0GYHU9A?t=1237)

~~~
kick
Sorry for seeing this so late! I didn't have any in particular in mind, but it
comes up pretty frequently throughout, I believe.

------
mlochbaum
There's some additional information about John's code at
[https://aplwiki.com/wiki/John_Scholes%27_Conway%27s_Game_of_...](https://aplwiki.com/wiki/John_Scholes%27_Conway%27s_Game_of_Life),
including a link to his own notes at
[http://dfns.dyalog.com/n_life.htm](http://dfns.dyalog.com/n_life.htm).

------
SpikeDad
I typed this in using an IBM terminal with an APL ball during my first year of
Comp Sci at Penn State Delaware Valley campus in 1976. I also typed in
Trek-76.

There's nothing slower than tying in APL code using a hard copy terminal. At
least we had an APL keyboard on the terminal - I think it was a dedicated
terminal. Sorry I don't recall the model.

I never did get to think in APL - if you've never used it there are lots of
specialized characters, some that do a ton of operations with one character
(arrays for example).

Anyways it's in the wayback days of PL/1, Snobol, Cobol, BASIC and Turbo
Pascal.

------
dang
See also
[https://web.archive.org/web/20070205060623/http://catpad.net...](https://web.archive.org/web/20070205060623/http://catpad.net/michael/apl/)

~~~
mlochbaum
Cool article, but it does go through a lot of effort (copying a string many
times and then executing it) in order to get a loop on one line. In modern APL
we'd just use the Power operator (⍣), which repeats a function. The dfn
{⎕←Life ⍵} gets the next iteration and displays it, so {{⎕←Life⍵}⍣⍺⊢⍵} does
this ⍺ times, where ⍺ is the left argument (the ⊢ is the identity function:
all it does it to prevent ⍺ and ⍵ from being stranded together into one
array). If we want space between the iterations, we can print an empty line
first, with {{⎕←''⋄⎕←Life⍵}⍣⍺⊢⍵}. Substituting in the definition of Life, we
have

    
    
      RepLife ← {{⎕←''⋄⎕←↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}⍣⍺⊢⍵}
    

Try it with

    
    
      10 RepLife ¯10 ¯10↑3 3⍴1 1 1 1 0 0 0 1 0
    

Another old paper on the Game of Life is Eugene McDonnell's "Life: Nasty,
Brutish, and Short"
([https://www.jsoftware.com/papers/eem/life.htm](https://www.jsoftware.com/papers/eem/life.htm)).
This was where John Scholes got the idea of doing three rotations along each
dimension. Interestingly, McDonnell attributes the idea to an implementation
by Don Knuth in METAFONT!

------
klysm
If I had to pick a video to motivate me to learn APL it would be this one. I
still haven't learned APL but this would be the one.

