Live data from Hacker News

A deep dive into APL

curtisautery.appspot.com

41–50 of 93 posts

Re: A deep dive into APL

#41
post #20

I'm just going to leave this here: http://www.ccs.neu.edu/home/shivers/papers/rank-polymorphism...

"APL, and its successor J [...] provide a notational interface to an interesting model of computation: loop-free, recursion-free array processing." How is APL loop-free, exactly? Later they say: "Under this implicit lifting, the iteration space is the argument frame rather than a sequence of loop indices." So if I understand correctly, we have iteration, but no loop. But that doesn't seem like a really important dist…

I think "loop-free" just means the language encourages you to think without loops, even if the implementation may or may not use traditional loops under the hood.

This is basically common to all languages with a strong emphasis on functional programming. Instead of looping, you perform operations directly on the arrays/matrices, and in fact APL and J are focused on matrix manipulation.

Re: A deep dive into APL

#42

Earlier quoted context omitted.

"APL, and its successor J [...] provide a notational interface to an interesting model of computation: loop-free, recursion-free array processing." How is APL loop-free, exactly? Later they say: "Under this implicit lifting, the iteration space is the argument frame rather than a sequence of loop indices." So if I understand correctly, we have iteration, but no loop. But that doesn't seem like a really important dist…

The key feature is abstract iteration, like functional maps, filters and folds, and implicit iteration, where operations "penetrate" to the items of a vector or matrix automatically, rather than explicit iteration like a "for" loop. Abstract iteration is useful because it results in programs with fewer "moving parts"- no loop induction variables to misplace or mutate in the middle of a loop body. Programs are necessa…

I see. Good answer.

Re: A deep dive into APL

#43
post #41

Earlier quoted context omitted.

"APL, and its successor J [...] provide a notational interface to an interesting model of computation: loop-free, recursion-free array processing." How is APL loop-free, exactly? Later they say: "Under this implicit lifting, the iteration space is the argument frame rather than a sequence of loop indices." So if I understand correctly, we have iteration, but no loop. But that doesn't seem like a really important dist…

I think "loop-free" just means the language encourages you to think without loops, even if the implementation may or may not use traditional loops under the hood. This is basically common to all languages with a strong emphasis on functional programming. Instead of looping, you perform operations directly on the arrays/matrices, and in fact APL and J are focused on matrix manipulation.

That makes sense. Thanks.

Re: A deep dive into APL

#44

I thought it was super cool when I found out you could overload operators in Julia. I wonder if you could re-create some APL-like syntax that way.

You might enjoy this one: https://www.youtube.com/watch?v=XVv1GipR5yU

I really did enjoy that. It reminded me of how I use R and then drop down to C++ when I need speed. This interpreter is analogous: use Julia and then go to APL when you want compact expression. Although, I'm not sure how advantageous it is. At least prima facie it's not as compelling as the speed gains you get from dropping to C++ from R.

Re: A deep dive into APL

#45

I am blown away to see how frequently APL seems to come up on HN these days, a language I used professionally for over ten years. As much as I love it I have to say one of the issues with APL is that it was way ahead of it's time. Because of that it struggled to run on computers of that era. I was introduced to the language in 1982~ish. Like I said, I used it extensively, attended and presented at APL conferences and…

Matlab and numpy serve that market today.

Re: A deep dive into APL

#46

I am blown away to see how frequently APL seems to come up on HN these days, a language I used professionally for over ten years. As much as I love it I have to say one of the issues with APL is that it was way ahead of it's time. Because of that it struggled to run on computers of that era. I was introduced to the language in 1982~ish. Like I said, I used it extensively, attended and presented at APL conferences and…

Lisp was also far ahead of its time, but many Lisp features like garbage collection and lambdas have made it in to mainstream programming languages. Has anything similar happened with APL?

Re: A deep dive into APL

#47

I am blown away to see how frequently APL seems to come up on HN these days, a language I used professionally for over ten years. As much as I love it I have to say one of the issues with APL is that it was way ahead of it's time. Because of that it struggled to run on computers of that era. I was introduced to the language in 1982~ish. Like I said, I used it extensively, attended and presented at APL conferences and…

> Not sure where to go from here. For the past few years I've been telling people about the APL family of languages. The clincher for me was seeing the video of an APL version of Conway's Life mentioned in the submission. The impressive part wasn't its brevity, it was how they approached the problem. In APL you have a 'rotate' operator that shifts data in a particular direction. If you have a vector and you rotate it…

I would really love to read an expanded version of this explanation, as it's not clear to me why or how stacking or summing rotated matrices would work for this problem.

Re: A deep dive into APL

#48

Looks like the site is hugged to death :-( My only experience with APL-like languages was playing with K for a few months. It's amazing, no other language can do so much in a few characters. Here's a list of hundreds of snippets: http://code.kx.com/wiki/Qidioms To give a taste of K style, I'll try to explain one of those snippets here. The problem statement is to merge three arrays x, y, z under control of another ar…

What do you gain from using the Clarity in function names is one of the main reasons I prefer Lisp and Scheme over languages like APL, K, and Haskell, which seem to favor the use of something like a mathematical notation, which I've always found obfuscating. This obfuscation is made worse by the aversion to comments that I've seen in some of these languages, while in Lisp and Scheme, the verbose and explicit function names are in a way self-documenting.

For someone who prefers a clear and explicit programming style, the terseness of some programming languages is a real turnoff.

Re: A deep dive into APL

#49

Earlier quoted context omitted.

> Not sure where to go from here. For the past few years I've been telling people about the APL family of languages. The clincher for me was seeing the video of an APL version of Conway's Life mentioned in the submission. The impressive part wasn't its brevity, it was how they approached the problem. In APL you have a 'rotate' operator that shifts data in a particular direction. If you have a vector and you rotate it…

I would really love to read an expanded version of this explanation, as it's not clear to me why or how stacking or summing rotated matrices would work for this problem.

Take a look at this explanation on the APL wiki: http://aplwiki.com/GameOfLife

Re: A deep dive into APL

#50
post #8

The main problem with (GNU) APL for me is the line editor: I can't feel comfortable using a REPL to write a program without keybindings like ctrl-a, ctrl-w. Everytime I try to learn APL I eventually give up.

I haven't tried it out, but maybe rlwrap can help here.

Unfortunately it doesn't seem to work.
Post reply on HN