News for hackers. Stuff that matters.
Re:A History of APL in Fifty Functions (2016) by Y_Y on Thursday November 21, 2019 @05:45AM (#21592925)
I wish the "Iverson bracket" (number 0 in this list) had caught on in a bigger way. It can really simplify writing conditional expressions, as opposed to e.g. a case expression.
Re:A History of APL in Fifty Functions (2016) by contravariant on Thursday November 21, 2019 @06:11AM (#21593048)
It's also an exceptionally useful technique in mathematics if you've got a few nested sums with dependend indices. By writing the condition in an Iverson bracket it becomes trivial to change the order of summation or change one of the variables.
Re:A History of APL in Fifty Functions (2016) by dubya on Thursday November 21, 2019 @10:11AM (#21594796)
I don't know if Knuth popularized it, but it's somewhat common in combinatorics. Similar idea to using indicator functions when doing change of variables in calculus.

https://arxiv.org/abs/math/9205211

Re:A History of APL in Fifty Functions (2016) by david_draco on Thursday November 21, 2019 @06:00AM (#21593004)
You can do that easily in numpy. ((x>0)-(x<0))*1 will give zeros and ones.
Re:A History of APL in Fifty Functions (2016) by andrewla on Thursday November 21, 2019 @09:08AM (#21594109)
I think the most interesting bit of trivia here is the discussion of Bertelsen's Number: 50847478, which is famous as being a published but incorrect count of the primes less than 1e9. 50847534 is the correct answer, but the incorrect number was derived in the 19th century and has persisted in textbooks through the 20th.

In some ways, with computers, this is pretty trivial; what's impressive is that this was computed long before computers were available, and although incorrect, was remarkably close. Computers have spoiled us.

Re:A History of APL in Fifty Functions (2016) by derefr on Thursday November 21, 2019 @11:36AM (#21595945)
Cool, but I was disappointed to find that it assumes you already know enough APL to understand the extensional definitions or analogies it gives. I was hoping it would be more of a “bootstrapping APL from a simple, explicitly-defined-in-the-text set of operators” kind of thing.
Re:A History of APL in Fifty Functions (2016) by tumba on Thursday November 21, 2019 @12:17PM (#21596550)
APL is not so much a model of computation as a new notation for semantics which already exist. The real semantic explanation of APL is set theory and traditional mathematics.

Probably the best deep ground-level explanation of APL is Iverson’s paper “Notation as a tool of thought.” [0]

The bootstrapping explanation you describe sounds a lot like what Paul Graham did in “On Lisp” [1] and in a much more complex fashion, Queinnec in “Lisp in Small Pieces” [2], both highly recommended.

[0] https://www.jsoftware.com/papers/tot.htm

[1] http://www.paulgraham.com/onlisptext.html

[2] https://www.amazon.com/dp/0521545668

Re:A History of APL in Fifty Functions (2016) by kd0amg on Thursday November 21, 2019 @01:11PM (#21597326)
It takes a fair amount of work on top of "set theory and traditional mathematics" if you want to actually state a semantics for APL.
Re:A History of APL in Fifty Functions (2016) by xvilka on Thursday November 21, 2019 @12:44PM (#21596976)
If anyone is willing to contribute to making APL more popular - feel free to send a pull request to Learn X in Y minutes site[1].

[1] https://github.com/adambard/learnxinyminutes-docs/issues/358...

Re:A History of APL in Fifty Functions (2016) by coldcode on Thursday November 21, 2019 @08:24AM (#21593726)
I learned APL in the mid 70's in college but never got to use it for much (I do remember writing a table tennis game which was pretty bizarre). But I always remember how amazing it was to learn the "combos" that did so much work in so few symbols. It was like learning to master a video game like Street Fighter. But APL was always a mostly write-only language, unless you used it every day, your code quickly became WTF-is-that.
Re:A History of APL in Fifty Functions (2016) by Athas on Thursday November 21, 2019 @06:53AM (#21593234)
APL really is a wonderful core notation, even though the full language is rather crufty. I've long been saddened that its promises of parallelism never seemed to work out.
Re:A History of APL in Fifty Functions (2016) by lelf on Thursday November 21, 2019 @07:34AM (#21593458)
Modern APL incarnations (kdb, dyalog apl) are quite damn parallel.
Re:A History of APL in Fifty Functions (2016) by Athas on Thursday November 21, 2019 @08:09AM (#21593642)
I've never used K, but isn't Dyalog mostly parallel through isolates? Last I checked, basic array operations were not automatically executed in parallel. Did this change?
Re:A History of APL in Fifty Functions (2016) by jharsman on Thursday November 21, 2019 @09:16AM (#21594173)
Dyalog launches multiple threads for certain operations if the arrays are large enough to justify the overhead.
Re:A History of APL in Fifty Functions (2016) by derefr on Thursday November 21, 2019 @11:38AM (#21595976)
That seems like the right approach for CPU-targeted code. Has an APL descendant ever been created to target a GPGPU compute-kernel, or even to compile to an FPGA netlist description of a DSP?
Re:A History of APL in Fifty Functions (2016) by jodrellblank on Thursday November 21, 2019 @12:30PM (#21596761)
Aaron Hsu’s co-dfns is a compiler of a subset of APL, written in APL, which compiles to GPU code.

Do a HN Algolia search for his username “arcfide” to find a lot of discussion, and there’s a couple of YouTube video talks, one of him talking through the codebase on a livestream, another a recording of a conference style tall introducing it to people.

It needs Dyalog APL, but that’s now easily available for non commercial use.

Re:A History of APL in Fifty Functions (2016) by lelf on Thursday November 21, 2019 @12:20PM (#21596593)
Re:A History of APL in Fifty Functions (2016) by smabie on Thursday November 21, 2019 @07:26AM (#21593410)
kdb+/q supports massive parallelism.
Re:A History of APL in Fifty Functions (2016) by ngcc_hk on Thursday November 21, 2019 @05:18AM (#21592817)
Interesting. Hope it can be written for APL novice.
Re:A History of APL in Fifty Functions (2016) by contingencies on Thursday November 21, 2019 @10:15AM (#21594853)
Disappointing they didn't webfont the thing. ⍢
Re:A History of APL in Fifty Functions (2016) by aloukissas on Thursday November 21, 2019 @11:26AM (#21595815)
Did anyone else also think about dry-aged steaks when reading this title? If you're in LA, you'll know what I mean :D
Re:A History of APL in Fifty Functions (2016) by aloukissas on Thursday November 21, 2019 @02:23PM (#21598312)
Haha so apparently you can get downvoted for humor in HN #whysoserious
Re:A History of APL in Fifty Functions (2016) by FullyFunctional on Thursday November 21, 2019 @09:20PM (#21601888)
Because HN is not Reddit. The value of HN comes from good and insightful comments. Humor is noise and noise drowns the signal. EDIT: Humor is a problem per se if it accompanies useful comments.