What's so cool about APL?

Why does APL have such a devoted following, despite its strange appearance? What have its users, since the 1960s, seen in it that made them embrace such an unpopular language?

I'm not one of those fanatical APLers, but I think I understand why. Imagine the year is 1965. All computing is on mainframes, and the only high-level languages you've ever seen are Fortran and Algol-60. And then one day you meet APL, and discover:

  • It has a read-eval-print loop: you can type expressions in and see the results immediately, without running a compiler. It's a remarkably powerful calculator, in the days before calculators were common. (This may account for its popularity in finance.)
  • It's mostly functional: most operations return a result rather than requiring you to specify a destination to modify, so you can easily combine many operations in one expression.
  • It has built-in collections — specifically multidimensional arrays, but any decent collection support would do as well. We take collections for granted nowadays, at least in languages higher-level than C, but this wasn't always so. There's a reason many early languages (not just APL and Lisp) were built around a collection type.
  • It has high-order operations: map is (often) implicit, and reduce, scan, and Cartesian product are single characters.
  • It's terse, and not just because of its one-character names. You really can say in a line of APL what would take a page of Fortran.

Under these circumstances, wouldn't you be amazed by the powerful new language? Wouldn't you become a faithful user, and for decades wonder why all other languages were so uselessly primitive?

5 comments:

  1. Yes, APL has a really cool abstraction. Way after its prime, I worked in the remains of I.P. Sharp, which was a huge APL power at one time. I was working in C, but there were still a lot of gifted APL veterans hanging around. I learned a lot of great tricks from them that I've since applied to other languages. A good abstraction transcends its initial language ...

    So much of what was learned in programming has been forgotten, as each new generation starts over again :-(

    Paul.

    ReplyDelete
  2. Indeed. But some of us kids are looking back at history to pick the good parts out. :)

    ReplyDelete
  3. Michael@Hughes.uk.com10 January 2011 22:35

    APL is alive and well

    See www.Dyalog.com www.apl2000.com and www.microapl.co.uk

    Dyalog run an APL competition every year to encourage students to learn enough APL to solve a problem. They run User conferences most years.

    APL has changed - its worth another look.

    ReplyDelete
  4. I'm not sure if APL was around in 65. There may have been rumblings about "iverson notation" in academic circles. This topic on LinkedIn: "Happy Birthday: APL CLEANSPACE was saved 1966-11-27 17:53:59 (GMT-5)." points to that.

    One may think Perl has all these qualities, but it lacks regularity; the language is rife with gotcha's. My limited experience with Perl: it truly is a write-only language, not just code, but data. The result of an expression is irretrievable in a lot of cases.

    ReplyDelete
  5. Oh, you're right. Falkoff and Iverson's history says the first, experimental implementation was in 1965, but the popular APL/360 wasn't until 1966.

    ReplyDelete

It's OK to comment on old posts.