APL & Array programming

This is for study of programming in array languages such as APL, J, BQN, and K, as well as array-oriented features of other languages and notation such as einstein notation, numpy broadcasting, mathematica’s threaded. We may even get into discussions of combinatory logic.

We have recorded 17 study sessions which cover all the Dyalog APL glpyhs. Click on the image below to access the playlist of all the sessions.

Blue And White Modern Game Youtube Thumbnail

Study group resources:

Other resources:

Set up:

Minor tips:

  • Once you finish a Dyalog APL session in Windows, you may need to switch back to the normal keyboard setting to make the Ctrl key work again
  • To start all arrays from 1 (the default) :
    ⎕IO ← 1
  • To start all arrays from 0:
    ⎕IO ← 0
  • In Dyalog, click the [1|2] button to turn on/off boxes around each element
  • Adding a before a variable assignment allows you to display the variable without an additional line (A ← 3 assigns 3 to A vs ⊢A ← 3 assigns 3 to A and prints out the value in A)
  • to have a high minus ¯3, use backtick 2 (or ctrl-2) and enter 3
  • for multiline statements/functions, start with ]dinput. Otherwise, use (statement separator) to “joint” them together - full explanation here
  • Creating content in Dyalog Jupyter Notebook.
  • 0+/⍳n - generate n-zero array
  • 0×/⍳n - generate n-one array

Maths/Physics

36 Likes

Quite interesting to see such an unusual (in my option) for Deep Learning / ML community topic; trying various programming languages/paradigms is a great idea. Though I never tried array-programming, the time when I hit into functional languages had a significant impact on how I write code now.

I wonder if there are any industry examples or known frameworks in these languages? Beyond their influence on array notions in other languages, of course.

Also, what is your opinion of Haskell/OCaml and alike? I was always thinking about them as a sort of “executable math”, too.

1 Like

Notation as a Tool of Thought - recommended by Jeremy

6 Likes

If anyone wants to play around with APL without installing it on their machine, they can try this:

https://tryapl.org/

This video from 1975 is cool! I liked the explanation about the way the interpreter takes input. Your input is on the right side, and the responses from the interpreter are on the left. I was reminded that this is how all messaging systems work.

Now, I’m wondering, why can’t I just iMessage or text an APL or Python interpreter in the cloud right from my messaging client? I’m sure I can, I just haven’t looked hard enough :smiley:

7 Likes

Learn APL with Neural Networks . A playlist.

3 Likes

Eh, you might find this podcast episode this interesting.

Conor Hoekstra started with Competitive Programming. He now works as a DLer in NVIDIA. He talks about how working with APL helps him working at NVIDIA because array-like structures are everywhere in Deep Learning, and such concepts are also helpful in parallelizing- the dealmaker of the current AI summer.

Corecursive Podcast: From Competitive Programming to APL with Conor Hoekstra


One could also enjoy this tutorial series on YouTube:

Learn APL with Neural Networks

3 Likes

Jeremy, what’s the best option to use APL in Linux (Debian and its derivatives)?

I have searched elsewhere, no answer is fully satisfying.

If anyone has pleasant experience with any of the options, please let me know.

In Windows, everyone uses Dyalog APL, but in Linux, that is not an option. Correct me if I am wrong.

1 Like

Hello all!

Excited to see that Jeremy is starting study sessions about APL. I just wanted to share that there is this fun podcast about APL and other array programming languages that you can check out: Array Cast. Some of my favorite episodes are:

  • Rank and Leading Axis theory: IIRC, broadcasting is discussed in this episode.
  • Transpose
  • Joe Kaplan: This one is a fun one b/c you will get an idea of the influence that APL has had in many of the technologies and tech companies that exist today.

Unfortunately due to timezone restrictions, I wont be able to attend the study sessions but I look very much forward to the recordings.

5 Likes

There’s a dyalog installer for Linux - have you tried it? (I haven’t, but I plan to)

1 Like

IIRC Conor hasn’t worked with APL, but started playing with it fairly recently out of interest.

1 Like

Okay, I will correct that. Listened to that some time ago. (corrected now)

Indeed, Conor describes himself as huge fan of array languages and combinators :grin:

This line below at the GNU APL homepage has prevented me to try APL on Linux up to this point.

The APL interpreter is an (almost) complete implementation of ISO standard 13751 aka. Programming Language APL, Extended.

Will go and install it now.

Generally most stuff on the internet works with dyalog, not GNU APL, FYI.

Before joining the study group call, please install Dyalog APL: Dyalog - Download Dyalog for Free

2 Likes

APL book:

https://xpqz.github.io/learnapl/intro.html

1 Like

i think this homebrew install looks fine? dyalog — Homebrew Formulae

If you try it will you let us know how it goes? I’ve just used the installer on the dyalog website for mac, and that was fine.

1 Like

Hi Jeremy, can you wikify this thread?

PS. Dyalog is installed in Windows. I am excited to learn it. :star_struck:

Dyalog APL - Tutorial/Documentation

2 Likes

Done.

1 Like