views:

4558

answers:

28

When I was at University 30 years ago, I used a programming language called APL. I believe the acronym stood for "A Programming Language",

This language was interpretive and was especially useful for array and matrix operations with powerful operators and library functions to help with that.

Did you use APL? Is this language still in use anywhere? Is it still available, either commercially or open source?


I remember the combinatorics assignment we had. It was complex. It took a week of work for people to program it in PL/1 and those programs ranged from 500 to 1000 lines long. I wrote it in APL in under an hour. I left it at 10 lines for readability, although I should have been a purist and worked another hour to get it into 1 line.

The PL/1 programs took 1 or 2 minutes to run on the IBM mainframe and solve the problem. The computer charge was $20. My APL program took 2 hours to run and the charge was $1,500 which was paid for by our Computer Science Department's budget.

That's when I realized that a week of my time is worth way more than saving some $'s in someone else's budget.

I got an A+ in the course.


p.s. Don't miss this presentation entitled: "APL one of the greatest programming languages ever"

+1  A: 

I haven't thought about this in a while!

http://en.wikipedia.org/wiki/APL_(programming_language)

Adam Alexander
+21  A: 

It was "reimplemented" without all the special symbols as J:

http://www.jsoftware.com

If you specifically want APL IBM has an implementation (registration required). The link I have is:

http://www14.software.ibm.com/webapp/download/preconfig.jsp?id=2007-05-01+08:49:37.264028R&cat=&fam=&s=z&S_TACT=104AH%20W42&S_CMP=&st=1&sp=20

(if that is broken search for "APL download" on http://www.ibm.com/us/en/)

tonys
it's also worth looking at the wikipedia entry for J. http://en.wikipedia.org/wiki/J_(programming_language)
Knox
Sorry. I had to take away your "correct" answer. That You Tube video is just too good!!
lkessler
No problem - I'm entirely with you on that :-)
tonys
A: 

i used APL2 on some monstrous IBM mainframes, it's still out there:

http://www-01.ibm.com/software/awdtools/apl/

the other implementation, STSC, seems to have gone invisible in google..

Gene T
A: 

Insurance actuaries are fond of it because it is well matched to their problem domain.

Thomas L Holaday
+1  A: 

Gtani's answer led me to find info about APL2.

That led me to find that ACM has a SIGAPL group and they still have APL conferences.

IBM has workstation versions of APL2 but does not list the price of their APL2 product, possibly meaning its too expensive for you and me.

Is there a freeware or open source version available?

lkessler
+37  A: 

This popular poem should give you an idea of why APL is not popular anymore:

'Tis the dream of each programmer
Before his life is done,
To write three lines of APL
And make the damn thing run.
ShreevatsaR
Thank you. I enjoyed that.
lkessler
Then there's that other APL rhyme :) Rho, rho, rho of X / Always equals 1. / Rho is dimension; rho rho, rank. / APL is fun!
Uros Dimitrijevic
+6  A: 

I used to write APL apps, back at the dawn of time.

Look into the A+ language, invented and used at Morgan-Stanley for financial applicaitons.

Charlie Martin
Never heard of that one before. The history of it is very interesting.
lkessler
Great tidbit. I used to work on Wall Street and knew Joel Kaplan. I wonder where he is today?
JonnyBoats
Jonny, I swear I've heard the name recently, but can't place it. MIght be at kx Systems. http://www.kx.com/
Charlie Martin
+1  A: 

It was fun, but treated too much like an academic exercise.

jsfain
That's funny you should say that. My first experience with it was a Computer Science course at University. One of the keener students claimed he could write any program in just one line of APL, although it might be a very long line.
lkessler
That's its problem. If you understand APL, you can write one liners that are incredible, but just try to document what/how it's doing for someone else, especially someone with lesser APL skills.
jsfain
I did one combinatorics assignment that took me an hour to code in APL. It took 30 minutes of execution time on the IBM mainframe to get to its solution. Other students took a week of their time to write it in PL/I. It took the computer 30 seconds to execute that. Gotta love the tradeoff!!!!
lkessler
Yes, yes I do love that tradeoff. So, I think would most people for the majority of tasks.
Marcin
+4  A: 

People couldn't convince keyboard makers to adopt it.

BubbaT
See my Keyboard post in response (since pictures can't display in comments)
lkessler
You don't need a special keyboard to write APL. I'm using a standard Windows 104-keys keyboard, and it works excellent. Just press Ctrl+i for the "iota" e.g.
Christian Davén
+5  A: 
lkessler
I first saw APL in high school on a 370. A guy at the computer club actually bought a daisy wheel for a terminal. Problem we couldn't save, a faculty member made suggestions to us how to get around this. Unfortunately we couldn't get our faculty to ask the school board. My answer: punch cards.
BubbaT
Fortunately, we just got brand new punch card machines. Real cool ones from IBM, they would hold the typed characters in memory, not punching till you pressed return. So you could backup and make corrections. The character positions was displayed on a two digit LED display.
BubbaT
Ok. I'm lighting a candle and waving my arms around, trying to dissipate the smell of ancient flatulence.
BubbaT
The B and N symboils look like bottom and top to me - http://en.wikipedia.org/wiki/Bottom_type
Mark Pim
The symbols on B and N are encode and decode - http://www.sigapl.org/encode.htm
Kris
+12  A: 

From: If programming languages were religions...

APL would be Scientology - There are many people who claim to follow it, but you've always suspected that it's a huge and elaborate prank that got out of control.

lkessler
+10  A: 

APL was brilliant for the technology of the time. At that time, both serial bandwidth and memory space was extremely tight. Most terminals output to paper, not to video monitors. Baudrates were 75, 110 and 300. An APL workspace was 32K on the System\360, and the one we had at my JC supported 80 online APL terminals. Every character sent or stored cost precious space and/or bandwidth and/or paper, so the fact that the language was a terse set of symbols was what made it so effective in that environment.

It was the first language I ever learned, and I still love it. I have a version I wrote for the PC that even emulates the overstriking of the keystrokes, as that made the keyboard simple (otherwise you have zillions of combination symbols all over the place). It's an anachronism now, but it has a soft spot in my heart. I still use it for doing desk-calculator type operations on my computer. I wish I could get a real 2741 terminal with APL keyboard to restore and hook up to it but they are now very rare beasts (and heavy monsters too). Oh well, fond memories.

Some still think that APL was ahead if its time, but I'm afraid they misunderstand much of what made it truly great in its heyday.

There has been an attempt to bring the language up to date with the language "J" which isn't dependent on the special symbols (which IMHO, was a large part of what APL had going for it). The result is a language even more unreadable than APL. The language R may be the current future of matrix languages, though I'm sure that's a controversial subject. J and R are free though, and there are some APLs out there, most are not good projects for the uninitiated, as unless you understand the original intents and contexts its hard to use an old APL executable and understand what's going on with it...

+3  A: 

For the open source version of GNU APL2 see here

1.01pm
+3  A: 

See dYALOG APL Used in life critical Hospital information systems (TakeCare) at Karolinska university hospital + many more companies...

+3  A: 

I really enjoyed APL, back in the far when. It is super high level. At best it treats arrays as objects, not as sequences, giving a view "orthogonal" to the usual one, and lets operators work globally on a whole structure at once. This is a great aid to conceptualization.

So one use of APL was to breadboard a complex numerical or array-manipulating application. The brevity of the code was a real advantage, since an app that would take several pages of ordinary code would often condense to a few lines of APL, and give you new ideas as well. Examples:

  • determine whether a string is a pangram (contains all letters of the alphabet). In APL this takes just 5 symbols.

  • solve the Wonderword puzzle, familiar from daily newspapers. In APL, no more than a dozen lines, as I recall.

One pastime of APL programmers at the time was "one-liners," programs that solved a whole problem in one line of code. Of course this is just playing around, but the range of problems that could be handled this way was amazing.

Thanks to Charlie Martin for mentioning A+, which looks very much like a modern implementation of APL.

bigturtle
+7  A: 

Is this language still in use anywhere?

Yes, it's used by e.g. SimCorp, "a provider of highly specialised software for leading fund and investment management companies, pension funds, banks and insurance companies".

It's also, like Peter says here, used by Profdoc to create the electronic health record system used in almost all of Stockholm, Sweden (including the renowned Karolinska University Hospital). And I'm in fact one of the developers of this system as of today.

Is it still available, either commercially or open source?

Dyalog Ltd offers a commercial APL implementation (Dyalog APL) for Windows, Linux and other platforms. It includes some "modern" features such as Unicode, object orientation and .NET.

Christian Davén
+5  A: 

We are still using APL. APL2000 has created a full .NET implementation of APL. I Love the language. We use the APL2000 APL+Win product. There is also a Mac implementation from MicroAPL.

Ryan Howe
A: 

www.apl2000.com has details of APL+Win & Visual APL (www.aplnext.com)

Visual APL is a C# peer language, works with Visual Studio 2008 as its IDE.

+1  A: 

Click here to obtain a free evaluation copy of VisualAPL for Visual Studio 2008.

Click here to learn about the immediate-mode, interactive "Cielo Explorer" session included with VisualAPL in which you can use C# [and VisualAPL if you like array-based programming] to explore the .Net Framework. With the "Cielo Explorer", you don't have to build a Console Project to see results right away.

+1  A: 

Boy this brings back memories! Does anyone rember the book **APL, an Interactive Approach ** by Leonard Gilman and Allen J. Rose?

I used to work for STSC in White Plains, NY. I was interviewed by Allen Rose, who was a great guy. When I went for the interview I did not know APL. The interview consisted of questions like "If I told you this operator did this and that operator did that, what would be the result of this line of code?"

Anyway if memory serves me he hired me on the spot. Before that I had been a COBOL programmer, so it was quite a change. Those were the good old days when they were more interested in if you could think than what you knew about programming. They knew they could always teach you a new language, but it's hard to teach someone to think.

ANd the ideomatic expressions! Do you rember using the 1 (take) of the 0 (reshape) of a variable? That was how you determined if a variable contained a string or a number.

JonnyBoats
I used your APL for DOS circa 1993; learned through the book "APL is Easy!" I once had all the weird features down pat; most have been eaten by senility^H^H^H^H^H^H^H^H memory entropy.
JCCyC
+3  A: 

My first paid gig was developing "expert systems" derived from mathematic model in APL which was actually a pretty fit. I was hooked after encountering a one-liner to solve Rubik's cube!

I don't regret spending almost a year of my life hacking APL because programming in a radically different way, learning strange symbols, thinking in terms of matrix manipulation, using right to left precedence, blurring of programs and data, workspace persistence, really changes how you think, even when faced with "modern" block oriented languages.

Having come across a few APL videos recently, I'm finding the APL Wiki a good place to rediscover what always was a fun tool. At worst you could think of it as "Brain Training" for coders.

psd
You got me curious, and I was able to find the Rubik's Cube solution in APL here: http://www.nyx.net/~anon84c2/ - They didn't implement it as a one-liner and did make it semi-understandable (so un-APL-ish), but you get the idea.
lkessler
+35  A: 

The link below is a to an 8-minute video implementing Conway's "Game of Life" -- including a live-running display -- using Dyalog APL. If nothing else, it should show that the comment questioning the "functional-programming" tag was way off base.

http://www.youtube.com/watch?v=a9xAKttWgP4

This video is superb! It shows APL off in all its glory and will give even those who've never heard of APL before, an understanding of its power and how exotic it is. A must see!! I wish I could give you 10 upvotes for pointing it out. ++++++++++1
lkessler
Also see "Conway's Game of Life in one line of APL" at: http://catpad.net/michael/apl/
lkessler
+3  A: 

APL was Iverson's brain child. Iverson was an IBM Fellow which gave him carte blanche in the research center. APL absolutely was a numerical language -- that was one of its objectives; to be very efficient and numerically intensive. The notation was all around the concept of vectors and vectors could be of any dimension. The good implementations were designed to take advantage of advanced computer architectures - pipelining, parallel, highly-register-based and with lots of "core" memory.

The linear algebra was used in a lot of modeling for 'live' simulations, stochastic processes, successive approximations, AI rules, etc. At University of Massachusetts, it implemented on a Cyber 7600 running KRONOS which was the precursor to the Cray Super computers.

Although it was interpretive, the language symbols represented some very complex operators. It was a prefix notation and every operator had monatic and diatic operations -- meaning that its function could operate on either a left-hand, right-hand or left- and right-hand vectors.

The power and elegance lead to some very sophisticated solutions and there are even puzzles and challenges between APL experts.

I loved APL and would be programming with it in a heartbeat if it were available to my class of projects.

mobibob
+1  A: 

The video, The Origins of APL, is rather interesting. It's a community television panel discussion about the history of APL from about 1974. The panel includes Kenneth Iverson, as well as several other people involved in the early history of APL. Quite interesting, and the suits and facial hair are to die for.

Dale Hagglund
A: 

This is a bit off-topic, but the profdoc website was giving me a .NET 500 error screen.

I have seen that APL has been ported to .NET, but still - irony.

Insurance actuaries are fond of it because it is well matched to their problem domain.

That sounds about right. A lot of the symbols seem to match stuff used in accounting.

Aaron Newton
actuaries don't do accounting
Mark
Yes, and they don't use the same maths either. There were actuarial components to this accounting course. Sorry for the confusion.
Aaron Newton
A: 

People couldn't convince keyboard makers to adopt it.

This is a fair point, and seems to be a common complaint (it is in fact my main complaint). With all these new fangled touch-screen computers, has anyone created a touchscreen keyboard for APL for any of the IDEs?

Aaron Newton
+3  A: 

You may be interested in this piece of APL computer history. Between 1969 and 1976 I worked at the American Stock Exchange and then SIAC after the IT departments of the 2 exchanges merged.
My resume has the following entry: Designed, developed and implemented the first working model of the national stock exchange for SIAC, the computer facilities management and planning organization for the New York, American and regional stock exchanges, formed in 1972 to reduce redundant automation expenses. Presented model to members of US Congress, boards of directors of the exchanges and its members end of entry That model was built in APL by some very good APL folks who worked for a company that had almost all left-handed employees. There was an Allen Rose, a younger guy - Kevin, who actually did most of the programming. As a subject matter expert, I worked as the business analyst. One of the ideas we came up with was to show multiple exchanges and compare the prices being traded on the floor against a back office model that looked at price performance and rules adherance. We needed to tie several computers together to get this all to work and so we were among the first to use the shared variable. I remember Kevin having a tough time to get it to work and was quite happy when he figured it out. I believe we were working with a real time service company and so we had to have several terminals signed in in order to drive our various displays. It was all quite impressive and provided an excellent sounding board for discussions. At one presentation I asked a US senator what he thought about it and that prompted him to send 3 of his staff members the next day to get more details. Thank you Ken Iverson.

bob o'brien
@Bob: please email me the APL formula for making money in the stock market. :-)
lkessler
+6  A: 

The hype-meter that goes with discussions about the relevance of various programming languages should be subsumed under the single question raised by the author of APL: how efficient is your programming language as a tool of thought?

In this regard the "why" behind APL's design is far more important than whether a programming language is structured, requires semi-colons at the end of every line or swamps the user in a recursive sea of brackets.

For example I was comparing an old Windows DOS command for deleting all the files in a directory with a scripted equivalent the other day - the modern version required typing over 50 times more code to achieve the same outcome. How is this a measure of progress?

What I clearly recall from the days when I used APL is that if I could solve any problem visually in my head (usually in the bath) I could go to work the following day, write the visual transformations down as a series of APL operations and it would just work.

There was no translation required, no memory management, no structured code to bother about and having to think about avoiding the evil use of "go to" statements - well, this was a complete irrelevance.

All I had to do was to focus on the problem. Yahoo!

APL was been the one (and so far only) language I have come across that just never got in the way of solving a problem.

One would have hoped that after 50 years of creativity we would have had something even more efficient and easier instead of the completely pointless debate about the symbols the language used instead of what they achieved.

Contrariwise we have done a remarkable job of focusing on the production of ever more complex languages that focus nearly exclusively on the Von Neumann architecture rather than on the way we actually think.

So we end up throwing our productivity into the bin by having to juggle three problem domains in our heads (a) the original probem (b) the problem as restrcutured to fit Von Neumann architecture (c) the mapping rules needed to translated back and forth between (a) and (b).

A great way to make projects take at least three times longer than they need to.

How would you rate your programming language as a tool of thought?

http://awards.acm.org/images/awards/140/articles/9147499.pdf

Rob
@Rob: I'm honored that you'd pick my APL question to be your first answer at StackOverflow. And thanks for the link to the APL Award.
lkessler