The APL programming language source code (2012) (computerhistory.org)

by tosh 29 comments 83 points
Read article View on HN

29 comments

[−] lioeters 33d ago
APL is how non-programmers imagine what programming is, a kind of sorcery involving exotic symbols and elaborate ritual processes to create data and algorithms out of thin air. Like LISP, it's an eternal classic that every generation rediscovers and gets their mind blown as an educational experience about the strange nature of computing, logic, and language.

Notation as a Tool for Thought, the 1979 ACM Turing Award Lecture by Ken Iverson who developed APL, is insightful in understanding some of the thinking behind it.

[−] andai 33d ago
PDF of the lecture: https://www.eecg.utoronto.ca/~jzhu/csc326/readings/iverson.p...

I found this part remarkable:

> The executable language to be used is APL, a general-purpose language which originated in an attempt to provide clear and precise expression in writing and teaching, and which was implemented as a programming language only after several years of use and development.

This is also how Python started out! I always thought, "Python is so easy for beginners because it is a teaching language." Well, so is APL!

[−] jamesfinlayson 32d ago
My brother often pokes fun and says my job is slash colon asterisk - he's never done any programming to know that a lot of what happens today is mostly English words.
[−] themafia 33d ago
Well that opened a bit of a rabbit hole. Looking at the source code I saw this which made me chuckle:

    RNUMBER  DC    F'16807'            RANDOM NUMBER.
Surely we wouldn't have DailyWTF quality code here. Looking for how it's referenced we find the RANDOM function itself:

    *        RANDOM NUMBER GENERATOR.
    *        LEHMER'S METHOD, CACM JUNE '66, P 432.
    *        N(I+1) = P RES Q X N(I)
    *        P = (2**31)-1
    *        Q = 7**5
Following that lead to the original ACM article referenced:

https://dl.acm.org/doi/epdf/10.1145/365696.365712

Which further lead to this rather interesting article on the history of the ROLL function which relies on this random number generator:

https://www.jsoftware.com/papers/roll.htm

Neat!

[−] flint 33d ago
I went out to talk with a guy, back in about 1995, in Chicago, fired up APL on his notebook, loaded the JPMorgan Risk Metrics data set, fiddled a bit, and reduced the thing to a one-line formula in an interactive window - like a Jupyter Notebook.
[−] QuantumSeed 33d ago
APL was the first programming language I learned, I was obsessed with learning every intricacy of the language. I almost lost my mind when I had to switch to a procedural language. APL warped my mind in such a way that it took almost a month to feel comfortable using anything else.
[−] sizzzzlerz 34d ago
At my very first professional EE position, in 1978, there was an older staff member, PhD, kind of a professor type, who was programming in APL. Naturally curious, I asked him about it and what the strange symbols on the keyboard meant. His explanation mostly flew right over my head but I asked a few questions, thanked him, and went away. In 43 years, he's the only person I ever saw using it.
[−] dang 34d ago
Related. Others?

The APL Source Code (2012) - https://news.ycombinator.com/item?id=34064480 - Dec 2022 (58 comments)

[−] NetMageSCW 33d ago
I got an introductory book on APL at a used goods shop and it was my second programming language after Basic, though I learned it and C without an actual computer implementation. I later took a class on APL in college because of having that book, it was taught in the school of Architecture.
[−] SilentM68 33d ago
If the Keyboard requirements for this language were not so high, I might have gotten into this language, but the cost of purchasing the equipment put me off. That is not to say that I don't find the language intriguing since that it is.
[−] NetMageSCW 33d ago
My favorite APL one liner (expression) reduces multiple sequences of spaces in a text string to a single space by doing boolean algebra on vectors of bits.