Hacker News new | ask | show | jobs
by Avshalom 2745 days ago
APL is actually kind of bad at math, or well the kind of math people tend to think of when they talk about matlab or Fortran being good at math.

What APL does well is filter/select/transform more spreadsheet style work than linear algebra stuff. It's a language to describe computation as meant by the sort of computer scientists that were born when computer was a job description.

3 comments

Still, from what I gathered, APL is primarily suited for chewing through a bunch of numbers lumped into arrays, in the manner of shaders or DSP, while I haven't seen examples with traditional control flow (and Perlis notes that loops and branches aren't APL's thing)―though I didn't look for long.

Come to think of it, that's similar to what's often done to lists in Lisp, outside of the more traditional control flow of 'business logic.' Precisely the filter-select-transform.

APL has map embedded into language. And reduce is an operator in J. APL is conveniently used by those who don't describe themselves as programmers - let alone as computer scientists - but need to get the job done. In this aspect it's similar to Excel, I think.

I wonder if APL is that much different from Matlab by the concept.

Syntactically, Matlab is closer to traditional languages. Where it excels at math is that you can do all sorts of things like solving matrices automatically. APL can invert small matrices, but can't automatically find the best way to solve it like Matlab will do. APL has great mathematical notation, but is missing the math libraries you typically need to do real math work (optimization solvers) which Matlab has via toolboxes and Mathematica has builtin.
FORTRAN is a great language, but it's not really good at math either. It's used with floats, which are a peculiar and volatile beast, though certainly useful. When I think of "good at math" I think of something like Egison.
Most high performance computing was done with Fortran back in the day (and still used today) because working with arrays and matrices is done at a higher level than C/C++ or Assembly, but it is still a fast language and has easy access to BLAS/LAPACK. When I think of scientific computing, I think of Fortran, Matlab, Mathematica, C, C++, Python + Numpy, and recently Julia. APL could've been great here if the vendors had included low level code to do all the numeric work and used APL as the glue language, but it didn't happen that way and became popular in the finance world instead. It's a shame.