Conway's Game Of Life in APL

Dyalog · 235K views · 2009 · 7:48

Open on YouTube

Programming language designFunctional programmingRecreational & visual mathdemo

Why Hacker News recommends it

Recommended whenever APL or array languages come up as the quickest way to see why the paradigm is so striking.

What it is

A short Dyalog demonstration building Conway's Game of Life in a single line of APL, step by step. It shows how array operations replace loops.

Recommended by 11 HN commenters across 10 different months, 2010 to 2024.

What Hacker News said

Strong rec sblom · 2012-04 · on “A Programming Language, now in HTML (50th anniversary)”

It has an incredible amount of elegant power for some things (see [this video] if you want to immediately fall in love). But I've found that trying to use it for most things just isn't worthwhile. It feels like cheating every time I have to escape from its array programming core to the more familiar flow control structures that only came along in later versions of APL. I think it makes a good puzzle language (i.e. the fun comes from figuring out _how_ to say something rather that just raw getting stuff done), but unfortunately, it's even more of a puzzle to figure out how code that someone else wrote works. For full context: I've spent more time using J than APL itself.

Strong rec jboggan · 2015-06 · on “Try APL in your browser”

While we wait for the site to come back up please enjoy this amazing video showing Conway's Game of Life in APL: [this video]

Strong rec sethrin · 2018-07 · on “APL at Its Core”

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. [this video] Conway's Game of Life in some 50 characters of APL.

Strong rec kragen · 2019-10 · on “Loopless Programming”

Try watching this video; it will only take you 8 minutes, but within 3 minutes you should have an idea of why array languages are different from having an ndarray library available in Rust or having typeclasses in Haskell: [this video] After you watch that you will of course suspect that APL and other array languages like J are a sort of DSL for things like numerical linear algebra, which is of course what Numpy and Octave are. (Even though the Game of Life isn't linear algebra, it's very clearly matrix-based, so it doesn't seem that far off.) Dyalog has posted some other videos demonstrating the use of their proprietary APL for different things, but I think a more interesting one is [LINK] , by

Strong rec Cactus2018 · 2020-08 · on “A look at the J language: the fine line between genius and insanity (2012)”

> Here's a video that really illustrates the power of this paradigm: [this video] Amazing game of life code!

Recommends rgiar · 2015-10 · on “Conway's Game of Life in One Line of APL (2007)”

For an infinitely more relaxing experience of life in APL, may I recommend: [this video] I've watched it many times but I still expect him to mention happy little trees :)

Recommends sp332 · 2019-05 · on “Alan Kay on “What Made APL Programming So Revolutionary?””

I always liked this example: Conway's Game of Life in One Line of APL [this video] It's esoteric as one-liners tend to be, but I think it's a fascinating glimpse.

Recommends hhas01 · 2019-08 · on “A+, the Programming Language of Morgan Stanley”

I think the key to understanding APL is realizing that it’s not built for Programmers; it’s built for Mathematicians. Here’s a fine half-hour introduction to APL in action: [LINK] 1:00-2:00 is the motivation for APL—or any DSL—in a nutshell. (“conversational computing”, “users who are [not] professional programmers”) Or, if you’re happy to sit back and see math magic happen: [this video] For all its mechanical advances over the last 40 years, it’s shocking how far our technology has regressed philosophically.