Here is a vector of the first nine natural numbers...
April 11, 2019 1:22 PM   Subscribe


I love APL programming. Here's a short k-means clustering in APL tutorial I wrote.
posted by ijoshua at 2:27 PM on April 11 [4 favorites]

That code is all very nice if you have fancy schmancy Dyalog, and you probably get by pretty well with APL2 as well, but on my olde IBM 5100 the one-liner is this gigantic thing:
So much typing! Seriously, writing out all of that...
posted by tss at 2:33 PM on April 11 [4 favorites]

Man, this is APL ASMR.
posted by ardgedee at 2:50 PM on April 11 [5 favorites]

Holy cow, I've seen this video before and I don't remember when or where or why but watching the first five seconds of the video was this like faster-than-light film sequence zoom from "Life in APL, huh, I wonder what that's..." to "OH SHIT IT'S THIS GUY".
posted by cortex at 3:14 PM on April 11 [2 favorites]

Ah, APL. Back in the day, there was Tymnet, GTE Telenet... and IPSANET, yet another packet-switched net, from I. P. Sharp Associates, a Canadian company which was Kenneth Iverson's employer through 1987.

The network used APL-ready terminals and had some email capability IIRC. Was weird to see a Diablo daisywheel typewriter/printer with what looked like a Greek keyboard. Actually got to use one once. One of my more exotic computing experiences.

I used to daydream about Bob and Doug Mackenzie being IPSA terminal repair guys... "What's that key, an umlaut" "No, hoser, it's the symbol for upside-down toque, like in an emergency." "Hey look, there's a boobies key where the W should be!" "Heh heh heh... Smoke break!" Good times.
posted by zaixfeep at 3:55 PM on April 11 [3 favorites]

Man, this is APL ASMR.

Next let's have this guy do a synthesizer so we can have APL ASDR ASMR.
posted by weston at 4:18 PM on April 11 [2 favorites]

I had the same experience as Cortex. Previously.
posted by samw at 4:30 PM on April 11

I bought a book back in the 80's called APL is Easy! They lied...
posted by jim in austin at 6:10 PM on April 11

Ahhh, APL. The original Write-Only language.

I learned it back in Uni. I remember the feeling of satisfaction on solving an APL homework problem. I also remember the feeling of utter bafflement on looking at that solution a few days later. It was usually quicker to solve the problem again than it was to decipher my own code.

Looking back, I have a great deal of sympathy for the poor TA who had to grade our homework.
posted by monotreme at 6:17 PM on April 11

Huh. So this (for some reason--probably from looking at the alien operators) reminded me of the J language, which was APL for ASCII. So I Google'd it and sure enough, it's still around.
posted by suetanvil at 6:32 PM on April 11

If you ever solve problems on Project Euler you'll inevitably see solutions written in J in the discussion forums, and they're just hilarious short bursts of line noise that allegedly find the sum of all integer substrings that can be formed from the concatenation of a million copies of the millionth prime number, or whatever. It has to be a really really long-game prank.
posted by Wolfdog at 7:36 PM on April 11 [4 favorites]

In 1982, I lived in Copenhagen and worked as a chef at the Danish parliament. One day, I got an unexpected visit from "Danny", who used to be my very best friend. I had not heard from him since I left Israel 10 years earlier.
He showed up with a giant modem in a suitcase which he hooked up to the phone, and told me about "computers" and the "internet". He was a real genius, and in the time since I last saw him, he had studied computer science & entrepreneurship in (some) Michigan University.
Within a few weeks, he sold me on quitting my job, starting to learn APL, and joining him in a new 2-men company that will make millions marketing some of his cutting edge APL technology.
Less than a month later, he sent me to Toronto and London to some conferences with the then-leaders of the field. I bought a suit and some ties, an attache case, and printed business cards. I remember feeling very unqualified for such a job, but I represented 'our company' to the best of my abilities.
Meanwhile, "Danny" got himself an apartment overlooking the harbor (Just like the one in Wenders' "American Friend"), bought a brand new Alpha Romeo convertible, and started the process of building up the company.
However, a few months later, his manic period was over, and his depression hit up. He retreated into his apartment, which he never left.
I would visit him twice a week, bringing him food & dozen of books in English from the local library. He promised that his depressive period will soon be over, but one day when I opened the door to the apartment, the stench was horrible.. and I found his body hanging in the bathroom...
That was the end of my experience with APL.
Eventually, I threw away the books. Don't remember what I did with the suitcase modem.
posted by growabrain at 9:05 PM on April 11 [12 favorites]

I am so sorry.
posted by Samuel Farrow at 11:31 PM on April 11 [1 favorite]

If this was in article form instead of video, it could have been in Scientific American’s “Computer Recreations” column circa 1985.
posted by D.C. at 4:10 AM on April 12

At about 1.25 in the video there is a comment "...we can simplify slightly..." which, in context, suggests to me that the narrator has a different definition of the word 'simplify' to the one I am used to.
posted by Major Clanger at 4:58 AM on April 12 [1 favorite]

Based on the video presentation, I'm going to guess that this guy doesn't comment his regular, non-video recorded code (with anything useful, or probably even at all) either. Relatedly: research debt.
posted by eviemath at 5:12 AM on April 12 [1 favorite]

I've always wanted to learn APL, but I never managed to get my head around it because I couldn't find a good tutorial and a good open-source environment to use it in. I did try my hand at J, which looked like line noise. I imagine APL must be a little easier these days with the widespread adoption of UTF-8 - anyone have recommendations for how to go about learning it?
posted by whir at 5:30 AM on April 12

Browser implementation.
posted by sammyo at 6:09 AM on April 12

Whir: Dyalog has a free downloadable interpreter for personal use.

(Full disclosure: I work for a company that uses Dyalog APL as their main language)

(Second full disclosure: This is a Danish company, and it makes me wonder if any of the older folks at my company know growabrain or their friend...)
posted by vernondalhart at 10:08 AM on April 12

I remember taking a "survey of programming languages" CS course as an undergrad in the 1980s. The format was to look at a different language every week and the homework was always to write two programs: one was the same every week (write a sort for the class roll) and then one that really emphasized whatever the language was good at. When we got to APL, the prof said as a fun little side challenge for extra credit, we should try to write the most compact program possible. I felt very proud turning something in with two lines of code. I get to class and the next week and the prof points out the winner who did it in something like 29 characters. None of use could understand how it worked. The prof laughed and told us some anecdote about Donald Knuth writing a four line APL program and then coming back to it and spent hours trying to figure out what it did. Looking back after a life time of working in IT and many, many hours trying to decipher someone else's code, I've come to look at the power and compactness of APL as a bug rather than a feature.
posted by kovacs at 7:03 AM on April 14 [1 favorite]

« Older “It all started with my balls.”   |   can lose visits indefinitely for substance-abuse... Newer »

You are not currently logged in. Log in or create a new account to post comments.