revs = dot(dirichlet(alpha, NUM_SAMPLES), rev_by_category)
Net result - this draws NUM_SAMPLES dirichlet vectors, dots them with the rev_by_category vector, and generates a list of NUM_SAMPLES of the corresponding random variable.Or:
total_variation = var(data.flatten())
first_axis_var = var(mean(data, axis=0))
second_axis_var = var(mean(data, axis=1))
From what I understand, this is definitely idiomatic J translated to Python. In general, idiomatic numpy code will always be array oriented since that's (until recently) the only way to shell out to C.So from what I can tell, APL isn't dead. It's just spelled out in easy to read executable pseudocode.
Imagine you're handed a tablet that shows such a program. At first glance it's a unique calligraphic image, but when you know the language you can also parse the data flow and manipulated types intuitively upon seeing the shapes. And since it's a dynamic digital document, you could zoom in, isolate parts, or even run "live coding" style experiments to see what the painting actually does.
For what I know, Hangul "glyphs" provide consistent encoding (see also: http://en.wikipedia.org/wiki/Featural_alphabet).
In Japanese Kanji the "elements" (Radicals, or Bushu, see here: http://en.wikipedia.org/wiki/Radical_%28Chinese_characters%2...) do _often_ work as semantic indicators (see for example Radical 85: http://en.wikipedia.org/wiki/Radical_85 which usually implies some connection with water or other liquids) but the connection may be obscure, or even look random - as an example (among hundreds) see 淋 where the radical for water, followed by two "tree" radicals means: "lonely, deserted, abandoned".
Something like "this large brushy swoop here is the part where all those matrices on the left are reduced, and then on the right we have these leafy things that map them into coordinates"...
Most text editors operate text substitutions (like "<-" turning to "←" automatically), so ASCII doesn't seem inevitable anymore (and I believe it's even truthier with virtual keyboards).
I worked in a company where APL used to be very strong (large french truck manufacturer) and they even had lots of programs written in Scheme for assembly-line optimisations in the late 90s. Most of those have been rewritten (should I say... painfully rewritten, and now buggy) in Java in 2005.
I feel like APL/CLisps/etc. were the right solutions but developers/managers were/are scared when they saw some of the mathematical/proof concepts they had to use, and were afraid of when they learned about them at the university.
It wasn't because of scared management. It was because they were paying for language knowledge not business knowledge. What replaced it, mostly C++ and Python, had better tooling and a wider pool of subject expertise to draw from.
Mostly true, but there are languages which are completely useless without becoming proficient with them. In my experience Forth and J are such languages: you can "learn about" them, but you won't really understand them without using them for some time. So I suspect APL, K, Q and Eli here are similar; the question is what will I gain from becoming proficient with one of them or alternatively is it worth becoming proficient in one of them if I'm already proficient with another.
The following is an example of quite readable ELI with only a handful of symbols:
It's not bad, but when all you have is ASCII, dense notation will inevitably look like line noise.APL's graphical notation was one of its original inventions, but custom keyboards weren't a viable solution in the PC era... But today the situation is different again. High-DPI displays and touch screens are becoming standard.
Would it be possible to reinvent APL notation to take advantage of high-res graphics and natural input methods? I'd love to see a tablet-only reinvention of APL that doesn't have a keyboard at all, just a number pad and painted gestures.