TITLE: The J programming language: is it useful for mathematics?
QUESTION [6 upvotes]: I just stumbled upon the J programming language, which has the description:

J is particularly strong in the mathematical, statistical, and logical
  analysis of data. It is a powerful tool in building new and better
  solutions to old problems and even better at finding solutions where
  the problem is not already well understood.

which sounds promising.
However, I looked at some examples, and my reaction was "you've got to be joking".  E.g. here's an investigation into the Collatz problem (source):
   collatz=: -:`(>:@(3&*))`1: @. (1&= + 2&|)

   collatz 9
28
   collatz 28
14
   collatz 1
1
   collatz^:a: 9
9 28 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1

This makes me feel like it's more intended for code golfing, rather than serious mathematics.

Q: Is the J programming language actually useful for mathematics and mathematicians?

REPLY [7 votes]: J is very useful. While it has its quirks, once you get used to them, as gar said, you can really understand the language quite well. I consider myself a novice at J, but being exposed to it, I can definitely tell what the example in the accepted answer's "mysterious code". It's easy enough to say you don't know what a program does, that's the same for many languages.
I for one cannot understand, without running it, some C programs, especially ones that rely on pointers, me being mainly a JavaScript programmer. Does that make C useless and unreadable? Granted, J has a higher scale of unreadability, but it still can be readable. There's a line between readable and unreadable, and J lies right on the line.
As for your question, I believe it is very useful for math (I use it for geometry) and mathematicians (it's a nice calculator if you have a computer with you, and are used to it). While you may not appreciate J, I strongly suggest you try learning it. J, APL, etc. can seem like a bunch of nonsense, but it's just another way to program and to learn.

You can stop reading if you're convinced—I'm mainly showing examples now.

J is good for its conciseness. You want a multiplication table for numbers 0 to 10? Boom:
*/~i.11

This yields a very appealing table:
0  0  0  0  0  0  0  0  0  0   0
0  1  2  3  4  5  6  7  8  9  10
0  2  4  6  8 10 12 14 16 18  20
0  3  6  9 12 15 18 21 24 27  30
0  4  8 12 16 20 24 28 32 36  40
0  5 10 15 20 25 30 35 40 45  50
0  6 12 18 24 30 36 42 48 54  60
0  7 14 21 28 35 42 49 56 63  70
0  8 16 24 32 40 48 56 64 72  80
0  9 18 27 36 45 54 63 72 81  90
0 10 20 30 40 50 60 70 80 90 100

Want to make it look like a "real" multiplication table (without the zero columns)? No problem:
*/~1+i.10

While this looks like a bunch of jargon to the casual observer, it makes a great deal of sense. Observe:
*/~ 1 + i. 10

i. n makes an integer range $[0, n)$. 1 + i. n creates an integer range $[1, n]$. ~ makes a one-argument function (or monad) take its argument twice, making it a two-argument function (or dyad). E.g., +~ n = n + n and *~ n = n * n or n^2.
/ inserts the function before it (*/multiplication) between every member (so +/ is summation over a list), or, when having two arguments as in +/~, it essentially makes a table in our desired fashion.
While this is only a bit of J, you can see the effect it has for its brevity. It makes calculation swifter and easier—so long as you devote the time to learning it. Which I suggest you do.