Hacker News new | ask | show | jobs
by whitej125 846 days ago
TIL APL...neat! Found this for others who want to play along.

https://tryapl.org/

(Note: took a while but the special characters for producing lists, etc... are from "virtual keys" you can see at the very top of the web page)

3 comments

I wanted to do some statistics, so I accidentally learned J (thinking it was R). J is like APL, but with digraphs (multiple characters) instead of special characters as symbols.
Ok, so this is kind of funny but I also want to know - did/do you feel productive with J for stats work?

Did you ever switch to R? If so, how would you describe the two languages to a non-programmer?

I don't think I ever actually did any stats with J, but I did play with it for a long time.

J is like an old school text adventure where you start with a blank screen that reads "You are in the woods" and, before you know it, it's Monday morning and you're considering calling out of work because you've almost decoded some elvish runes you found on a rock.

R is the single player campaign of a modern first person shooter, where you have infinite lives and your health regenerates if you sit and think for a while.

This isn't a perfect analogy. Maybe J is high school Spanish class, and R is Google translate? I remember enjoying J as a language and R as a tool. It's exciting to express new things in J. It's easy to do familiar things in R.

R also is really well documented - there was a time where experts were asking basic questions on Stack Overflow and answering them themselves, because that's where people look for documentation.

> This isn't a perfect analogy.

It's pretty damn good!

Yes. I like the wool and first personal shooter more.
I've been trying to improve my J skills by doing the https://adventofcode.com/2022 puzzles. I got stuck on day 7 because recursion in J is possible but an advanced level incantation. Day 1 was five short lines of code for Part One and another two lines for Part Two. Each line of code needed four or five long lines of documentation.
How does one accidentally learn a different programming language?
On the J website the first sentence is: 'J is a high-level, general-purpose programming language that is particularly suited to the mathematical, statistical, and logical analysis of data.'

So I can see him thinking he has the correct language.

Sounds like a Neal Stephenson beginning.
"The analyst's cheeks warmed as she looked around the room, realizing they were talking about something different than she expected."
Slightly annoying that that site doesn't accept ι (iota) typed normally for some reason

(it expects the U+2373 ⍳ 'APL iota', which isn't anywhere as easy to type)

What's the story behind those characters? Did old APL machines have custom keyboards?
Math student Ken Iverson being annoyed at the inconsistency of math notation and its precedence rules decided to come up with a better one. "Iverson notation" or "the notation", he went through Harvard and became Dr Iverson, got picked up by Adin Falkoff at IBM when they were designing the IBM/360 processor and adapted the notation for the blueprints of how the thing would work, and then got rid of superscripts and subscripts and cut it down a little so it could become a line-based executable thing to run on an IBM/360 as a kind of matrix-aware desktop calculator / "A Programming Language" (APL). IBM made custom Selectric/golf-ball printer heads and keyboard overlays for it.
They weren't really "APL Machines" but computers used to run APL like IBM's APL2 had special keyboards like: https://www.clickykeyboards.com/product/1989-ibm-model-m-139...
Looks like Unicomp even makes a Model M with APL keycaps: https://www.pckeyboard.com/page/product/00UA41P4A
It started as notation and grew into a language. The language retained the notation and so we get the special symbols.

https://en.wikipedia.org/wiki/APL_(programming_language)#His...

They're "space runes" from ancient alien civilizations that allowed humans to briefly glimpse their technology.
I am waiting for someone to write an APL descendant using Linear A... there is already a keyboard for it: https://shop.keyboard.io/collections/the-keyboardio-model-10...
An APL keyboard typically wasn't exactly a custom keyboard, but a standard keyboard with APL characters accessible through modifier keys. Often there were adhesive labels on the front of each key showing the special characters or you could get custom keycaps that had the special characters printed on the front. And of course many of the special characters were created through overstrike rather than separate keys. Way back, I programmed in APL on a DECWriter that had support for APL characters.
I have a keycaps set imitating the classic Space Cadet keyboard (from Symbolics Lisp workstations). The Space Cadet had APL tops and fronts [1], but these caps only have the tops presumably because the cost to get keycaps printed on the fronts would be way too high. Frustrating though. I've thought about getting the rest printed on clear plastic adhesive.

[1] https://en.wikipedia.org/wiki/Space-cadet_keyboard#/media/Fi...