APL study session 1

Discussion of the first study group can go here! APL Overview

[ session 2 >>>]

This is a wiki post - feel free to edit to add links from the lesson or other useful info.

Overview

  • Setting up an APL dev environment
  • Top-down learning plan
  • APL basics
    • Arrays
    • Functions: monadic vs dyadic
  • Basic math operators
    • Minus sign: negate (monadic); minus or subtract (dyadic)
    • Plus sign: conjugate; plus
      • Complex numbers and their conjugates

Study session resources

Study session links

Notes

Video time line - thank you @Daniel

04:23 Greetings

05:00 - Chats on APL: Jeremy on Array Cast, Teaching children on APL, applied linear algebra on APL

06:10 - Installing Dyalog for APL and why Dyalog

09:10 - use ctrl + in windows and backtick + in mac to access glyphs, and how to access different APL keyboards for windows and mac

14:47 tryapl.org and <prefix> + s means hit backtick + s

16:44 Get started with APL and a trick to reuse previous command by changing the previous command directly

18:17 finding previous command history ctrl + shift + backspace

19:10 Why to get Jupyter kernel working for APL? What is Jeremy or Fastai way of teaching APL? What’s Jeremy’s plan for learning APL? What’s Jeremy’s young students’ reaction to his plan?

21:58 Install Jupyter kernel for APL

24:51 Explore Dyalog Language Elements and start reading on the first glyph

26:31 Understanding the monadic minus sign

31:29 How to toggle special box to display the dimension of your data?

33:35 More examples on negate or monadic minus sign

35:51 Does space have meaning next to a function?

37:05 Add a bookmark language bar for your jupyter APL kernel

38:00 How Jeremy use examples to teach kids with APL?

39:29 How to do backtick? backtick + space

41:56 Understanding dyatic minus sign, named minus or subtract

44:22 When to use parentheses ()?

46:21 Starting on second glyph on plus sign

48:27 How to use the monadic plus sign, named conjugate?

49:11 complex number explained

57:56 questions on complex number intuitions

58:48 motivations of learning APL

1:06:47 Negative flip the number on the real line, conjugate flip the number on the imaginary line

1:09:05

5 Likes

Oops! missed it again! watching the recording now, thanks Jeremy!

1 Like

I just looked into the backtick issue and changed the javascript file to support it, but I have just seen that it has been explained now by @abrudz

To type a backtick use, Backtick + Space

Many thanks for this cool tool!

Really looking forward to this!

I have been spending some time solving basic exercises in the linear algebra book I mentioned on the call. I found it helpful to figure out the answer, then check on APL to see if I got it right (I didn’t at first).

I found these simple operators made sense sense, but the precedence rules took some getting used to as they are different than what I am used to. Here’s an example!

1 2Ă·3 4 -5 6

  • 3 4 -5 6 is (3 4) vector minus (5 6) vector, not a length 4 vector because it’s using - instead of ÂŻ
  • Right to left precedence means subtraction of those vectors happens before the division.

Working a bunch of examples was helpful to get used to this because it felt weird at first!

4 Likes

This uses a symbol we have not covered yet, but it helps show what the little arrows do in arrays. The arrow came up briefly in the call so I dug in.

The 4 commands in the image below do this:

  • Create a length 2 array (vector)
  • Create a 2x2 array (matrix)
  • Create a 2x2x2 array (cube)
  • create a 2x2x2x2 array

What you notice is the arrows in the output show you the directions of the array dimensions, with 1 arrow for dimension. While this isn’t all that insightful for 1D or 2D arrays, it is a helpful reference in higher dimensions to show how all the dimensions are organized on our 2D screen.

5 Likes

One more insight!

The bottom left of all the arrays created in my previous post have a small tilde, which was noted on the call but we didn’t know what it meant. Tilde means everything in it is numbers. A plus would mean a mixed array with stuff that aren’t all the same type. A epsilon would indicate it’s a nested array. Some examples!

Screen Shot 2022-07-05 at 6.09.49 PM

7 Likes

04:23 Greetings

05:00 - Chats on APL: Jeremy on Array Cast, Teaching children on APL, applied linear algebra on APL

06:10 - Installing Dyalog for APL and why Dyalog

09:10 - use ctrl + in windows and backtick + in mac to access glyphs, and how to access different APL keyboards for windows and mac

14:47 tryapl.org and <prefix> + s means hit backtick + s

16:44 Get started with APL and a trick to reuse previous command by changing the previous command directly

18:17 finding previous command history ctrl + shift + backspace

19:10 Why to get Jupyter kernel working for APL? What is Jeremy or Fastai way of teaching APL? What’s Jeremy’s plan for learning APL? What’s Jeremy’s young students’ reaction to his plan?

21:58 Install Jupyter kernel for APL

24:51 Explore Dyalog Language Elements and start reading on the first glyph

26:31 Understanding the monadic minus sign

31:29 How to toggle special box to display the dimension of your data?

33:35 More examples on negate or monadic minus sign

35:51 Does space have meaning next to a function?

37:05 Add a bookmark language bar for your jupyter APL kernel

38:00 How Jeremy use examples to teach kids with APL?

39:29 How to do backtick? backtick + space

41:56 Understanding dyatic minus sign, named minus or subtract

44:22 When to use parentheses ()?

46:21 Starting on second glyph on plus sign

48:27 How to use the monadic plus sign, named conjugate?

49:11 complex number explained

57:56 questions on complex number intuitions

58:48 motivations of learning APL

1:06:47 Negative flip the number on the real line, conjugate flip the number on the imaginary line

1:09:05

2 Likes

Hi all, I’ve included a link for those who might like some more reading on complex numbers. I understood complex numbers much better when I encountered them in an electrical engineering course where AC circuits are analyzed. AC circuits have magnitude and phase and can be represented by a vector made of a real and imaginary component. The article goes into operations too. Enjoy!

https://www.electronics-tutorials.ws/accircuits/complex-numbers.html

1 Like

Just incase anyone else is using mambaforge or failing to connect to the kernel when using the dyalog-jupyter-kernel on windows with errors similar to

C:\Users\USER\mambaforge\python.exe: No module named dyalog_kernel

the .bat is not set up for all possible configurations so you will need to modify it or manually copy dyalogue_kernel to site-packages. For mambaforge this means adding the below to install.bat

xcopy %0…\dyalog_kernel %USERPROFILE%\mambaforge\Lib\site-packages\dyalog_kernel /Y /I

I am not sure what needs to be fixed to get this to work on linux?

1 Like

I heard people talking about complex number on session 1.

I wrote a quick and rough piece on them:

Stuff About Complex Number I Wish Somebody Told Me

Let me know what you think.


On an unrelated note:

10 AM Brisbane Time is 05:30 AM in India. I have never gotten up at that time in my entire life, save some specific days for travel. I wanted very much to join live, but that time just doesn’t work for me.

I will follow as much as I can through the recordings.

Best wishes!

Congrats on successfully getting up anyway! :smiley: Nice to see you there today.

(PS: Please be careful to avoid cross-posting.)

1 Like

Who said anything about getting up?

I didn’t sleep at all.

Had overdue work + study, took till 3 am. Spent the rest 2.5 hours eating and browsing new shows on Netflix.

If I woke up on 5.30 am, my dad would be one happy man. But sadly, could never give him the pleasure! :sweat_smile:

But promise to try to sleep and still make it on time for the next weeks’ sessions.

Thanks for the session and the good vibes!

I was unsure where to post. So, I posted on the main thread, someone’s Complex Number thread, and the session thread.

Sure looks like spamming. (But the blog is fully unmonitized, has no ads or privacy invading trackers.)

Maybe I will mention the link and not the post if something relevant comes up.

Just post in one place please!

1 Like

Sharing that I got caught with my Dyalog IME keyboard not working, i.e. an empty list here…

until I did this…

At [21:50] Jeremy installs Jupyter notebook for APL under Windows. I’d previously had Jupyter installed under WSL, and thought it cleaner to not have two Jupyter installs on my laptop, so I’m having a go at doing it under WSL. So far it seems just as easy, I’ll log my experience here as a reference for others.

  1. Already had Jupyer running (to long ago to remember procedure)

  2. Downlaoded the Dyalog DEB file from Dyalog - Download Dyalog for Free

  3. Followed instructions in “Dyalog for UNIX Installation and Configuration Guide”
    which essentially came down to just doing…

sudo dpkg --install linux_64_18.2.45405_unicode.x86_64.deb
  1. Ran… $ jupyter-notebook
    and accessed it from Chrome running on Windows.

There is a slight difference in the menus, which I’m presuming to ignore and just use the first choice (I’m not familiar with if there is any practical difference between the two)

Windows…
image

Linux…
image

Derivative languages

APL has formed the basis of, or influenced, the following languages:[citation needed]

  • A and A+, an alternative APL, the latter with graphical extensions.
  • FP, a functional programming language.
  • Ivy, an interpreter for an APL-like language developed by Rob Pike, and which uses ASCII as input.[44]
  • J, which was also designed by Iverson, and which uses ASCII with digraphs instead of special symbols.[7]
  • K, a proprietary variant of APL developed by Arthur Whitney.[8]
  • LYaPAS, a Soviet extension to APL.[citation needed]
  • MATLAB, a numerical computation tool.[6]
  • Nial, a high-level array programming language with a functional programming notation.
  • Polymorphic Programming Language, an interactive, extensible language with a similar base language.
  • S, a statistical programming language (usually now seen in the open-source version known as R).
  • Speakeasy, a numerical computing interactive environment.
  • Wolfram Language, the programming language of Mathematica.[45]

What is APL

1 Like

After installing the Dyalog keyboard on Windows 11, for a while it “seemed” that when not-using-APL, the sytem started randomly changing from the standard to dyalog keyboards, which was a pain since this disabled all CTRL-keys. It took a while for me to tune into the “non-random” cause, which was anytime CTRL-SHIFT were pushed togther, the keyboard keyboard swapped, which as a touchtyper occurred so autonomous and transitory that I hadn’t made the connection.

Even after I identified the cause, it was hard to avoid triggering the combination. My workaround was a double-tap CTRL-SHIFT to undo the keyboard change was annoying, but I was living with it. After I asked about it in one of the sessions, I needed to dig deeper…

With each release, Microsoft keeps pushing useful Windows settings deeper under layers of simplicity, so most older instruciotn sdidn’t match. Here is how to disable CTRL-SHIFT keyboard swapping. The WINDOWS-SPACE combination remains and is sufficient on its own.

image

Hi @bencoman It was nice you could join us yesterday. I hope you are feeling better now.

I switch different keyboards by expanding the keyboard option at the bottom of the right-hand corner.
image

Note: I have a different version of Windows from yours.
image

1 Like