No study session this week

“The Twin Algorithms” (ie APL vs C++) summary:

  • APL’s application on actuarial maths, MetSim (simulation), KDB+ (trading)
  • Board cast related to APL: Lambda Cast, Functional Geekery (Episode 64, 65 & 76)
  • / reduce vs C++ accumulate
  • \scan vs C++ partial_sum
  • APL vs C++ example
  • Array languages timeline:
  • APL vs Basic switch in an IBM5100
  • APL Good for the Brian

APL (vs C++) operations covered:

  • reduce
    image

  • scan (example: remove HTML tags walk-thru)
    image

  • outer-product
    image

  • rotate (equal to reverse 3 times) and other beautiful glyphs

“… be curious. … think different. … ABL (Always Be Learning).” Conor Hoekstra

4 Likes

I’ve just updated the top post to cancel the remaining sessions this week. Sorry about that!

2 Likes

The talk was an excellent 2 hours, which should give the audience here their APL fix for the rest of the week. Watch it on YouTube.

3 Likes

Conor explains:

** What is an outer product ** (Timestamp 1:24:43 in case it doesn’t start there)

See APL Wiki.

1 Like

Hope you get well soon. :pray:

1 Like

Hope you feel better soon Jeremy! I’ve got my 4th shot booked for tomorrow. We only get Moderna here in Ontario Canada, and it’s always a doozie. Not looking forward to it :sweat:

I am trying to catch up with the material that we’ve covered (that session from last Friday with @abrudz was legendary! :slightly_smiling_face: such a beautiful discussion between Adam and Jeremy, so many cool insights)

APL still seems to me like this foreign, intricate world that I am not fully sure how it operates :smile: That is to be expected at this phase. But at the same time I can’t shake off the feeling how familiar it all seems…

Yeah, so there are a bunch of operators that do fancy things, but I have operated on various slices of arrays for a couple of years now when using numpy, pytorch, or even pandas! Even the notation for subsetting arrays seems familiar :slightly_smiling_face:

This is not a stab at APL, just an observation on something I found quite interesting and astounding (and I realize APL takes that reasoning to a whole new level, one I don’t fully appreciate yet as there is still so much for me to learn and experiment with). Probably speaks to the pollination of ideas from the APL world into the Python world and the curious situation people in the fast.ai community find themselves in – we probably don’t interact with computers how most programmers out there do.

But what completely blew my mind is how foreign APL must feel to someone who doesn’t have the background of using scientific computing in the form of numpy or R! I mean, I still remember doing something like the following in Java (or C) to iterate over an array of rank 3:

for i in ..:
  for j in ...:
    for k in ...:

I wonder if things have changed, if there is something in these other languages people use nowadays to interact with arrays like we can do in Python? Guess I will learn more from the talk shared by Adam above! Anyhow, to step from this world into APL – now that must be a ride :smile:

And the other slightly tangential thought is that it is quite amazing that there is a sustainable business model to APL, that there is a company apparently living of maintaining and developing a programming language and its ecosystem! I think this is really cool – so foreign to what we know from the Python world. In a sense, it is like encountering a unicorn, a magnificent and unique beast, so it automatically piques your interest – how does it work? Really cool!

Hoping Jeremy feels better soon and produces a lot of antibodies in the process :smile: I quite enjoy getting vaccinated and feeling the immune system kick into high gear. Probably one of the more enjoyable experiences about the whole pandemic – experiencing the effects of science and doing something good for yourself (and the people around you).

Anyhow, really looking forward for the next steps of this journey, and all the upcoming goodies (juliacon keynote, nbdev2, wow). It’s Christmas in July! :smile: Which only makes sense, because its supposedly middle of the winter here…

7 Likes

It’s a magnificent unicorn indeed! And Dyalog isn’t the only success story. As I understand it, a version of APL (called “K” ?) was sold to a wallstreet firm for a couple hundred million dollars.

What surprises me is that there aren’t any deep learning frameworks in APL or array languages already. The problem domain seems right up APL’s alley from my naïve perspective.

1 Like

OMG what a talk :heart_eyes: I only started listening to it but it is amazing!!! Probably a gateway drug into a wonderful world of niche podcasts that were mentioned early on in the talk :smile:

A nice commentary on the thought I had there :slightly_smiling_face:

1 Like

Any body trying to work through Phase1 APL competition 2022

Pretty well advanced for a newby but how else do you learn

You may also enjoy problems.tryapl.org which contains previous years’ Phase 1 problems and does the same automatic checking of your solutions. The difference is that you’re free to discuss the old problems with others. Also check out my ongoing APL Quest video series where I solve one old Phase 1 problem per week.

5 Likes

The questions are difficult. With the help in the forum, especially @abrudz, and reading lots of online resources, it is possible. :star_struck:

I watched one of Adam’s APL Quest videos. He went through how to deal with edge cases. I will go through them to see if I can improve those silver trophies to gold.

4 Likes

Which one? Sounds like a useful video.

Inspired by @Moody outstanding performance, I decided to take a look at the APL competition as well :slight_smile: Too bad it is finishing in a day! Sounds like an awesome learning resource.

Looking at the example from the competition, I have a question.

The goal is to count the vowels in a word. Here is the solution:
(+/∊∘'AEIOU') 'COOLAPL'

But I don’t understand how it works! If I look up function composition, I see this:
image

But what is what in that expression? My interpretation is as follows but I am not sure it is correct:

  • g is 'AEIOU', there is no function g, instead g is just the string
  • there is no `X
  • f is 'COOLAPL'
  • gets applied between f and g (by that point we are done with Jot, that is the operator)
  • we jump out of jot and simply perform a sum reduce on what the jot returned

My hypothesis is that this expression only lucks funny because of the right-to-left evaluation order and a newb like myself getting tricked that somehow jot takes in the sum reduce, but essentially this is how the expression is evaluated (jot has nothing to do with sum reduce)

+/((∊∘'AEIOU') 'COOLAPL')

If anyone could please share any pointers that would be greatly appreciated :slightly_smiling_face:

Similar to Kaggle competitions, we can’t discuss live competitions openly at the moment. Hold off for another day. Once the competition finishes, @eitanlees will create a new thread to discuss it. :slight_smile:

1 Like

This is not even from the competition, it is the sample example here :slight_smile:

2 Likes

In this video, Adam talked about how to develop a solution that could accommodate both ⎕IO←1 and ⎕IO←0 settings.

The full list of APL Quest is here.

Yeah, I can see how that’d be confusing. The problem is that has two meanings, Beside (which is a specific type of function composition) and Bind (which is explicit currying). The interpreter distinguishes between the two cases by looking at the syntactic role of the operands; if one of them is an array, we’ve got Bind. Otherwise, we’ve got Beside.

As for the parsing of +/∊∘'AEIOU', you are absolutely right. You can verify such at tacit.help.

2 Likes

I started this as an aside to Jeremy’s recover timeout as something to keep occupied on, as Jeremy says do a little each day.

I have partial solutions to qu1 and qu3, in that I can complete the first 2 cases in each and a gold solution to qu2 satisfying all 3 cases. Will not publish them here yet although with regards to Coursera course you are allowed to discuss tactics but not reveal solutions would you think that applies here.

Something to occupy the mind for a month or 2
Roger Hui APL Exercises

Please be aware I can not attend the live APL sessions as repeated attendance would interrupt sleep patterns that would be detrimental to health. Thanks for you time