3 ms·
I programmed in APL circa 1980-83. It's not a normal programming language in that you don't use it to solve the same kinds of problems as you'd solve in Pascal
by kbob 10y ago
I programmed in APL circa 1980-83. It's not a normal programming language in that you don't use it to solve the same kinds of problems as you'd solve in Pascal or Fortran (then) or Python or C (now). Lisp and Smalltalk are a little like that. If you pick a problem they're good at, they're very good indeed, but if you're writing something they don't do, they're just Pascal/Python with funny syntax and nonstandard libraries.
APL really encourages code golfing. It's barely readable in the best of circumstances, so there's a lot of temptation to compress code. Er, it's readable, but it's like reading a regular expression. You read it character by character, not line by line.
The other thing APL encourages is writing dimensionality independent code. Just as a good C programmer will write a function to concatenate two strings that works independent of the strings' sizes, a good APL programmer will write a function to accept arrays of arbitrary dimensionality where that can make sense. That's because it was not uncommon to have intermediate results of 3, 4 or 5 dimensions. Also, most of the built-in operators do something useful with higher-dimensioned inputs.
So yes, it becomes second nature, more or less. But at the same time, it restricts the kinds of problems you think about solving with it.
Today I would not recommend APL for any purpose except studying its place in computing history.
- arcfide 10y agoRespectfully, the APL of today is not the APL of the 80's. APL is tremendously well suited to many of the problems that face other programming languages, such as the parallel programming usability problem. Modern dfns based APL has incorporated lessons learned from languages liked Scheme (Lisp) to make function syntax and control flow more functional. And APL has been and continues to be used to solve problems from web programming to graph processing and everything in between. While it finds immediately obvious advantage in numerically dense calculation heavy code, my research is specifically interested in demonstrating and scaling APL beyond the "status quo" of what people think APL is good for. The Co-dfns compiler mentioned in these threads is precisely such a counterpoint, demonstrating how to leverage APL in a domain space traditionally dominated by OOP and Lisp style languages, and more recently by certainly highly typed languages such as Agda or maybe Haskell. The difference is that good APL is often more or less "parallel ready" out of the box. Good code in other languages is often anything but. I am working through making the case that "parallel first" languages such as APL are actually pedagogically and programmatically better than "serial first" languages. To this end I have conducted at least one exploratory pilot study on the matter: http://video.dyalog.com/Dyalog13/?v=kIItfQJEVdM http://video.dyalog.com/Dyalog13/?v=kIItfQJEVdM