Live data from Hacker News

A deep dive into APL

curtisautery.appspot.com

71–80 of 93 posts

Re: A deep dive into APL

#71
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.

> This is basically common to all languages with a strong emphasis on functional programming

Also modern Fortran falls into this category. (I mention it because it's far from a functional language.)

Re: A deep dive into APL

#72

Earlier quoted context omitted.

ColorForth is not an OS. For C. Moore, an Operating System is a non-thing.

Chuck Moore writes one for every project.

That's a deep misunderstanding of what he does. When you run a single process on a single hardware, you don't need an OS.

Re: A deep dive into APL

#73

Earlier quoted context omitted.

Forcing your compiler to figure out you're doing something trivial on a rank-n array is silly. So is writing all the overhead and logic (where a typo can break things) which goes into a for or while loop instead of two characters: +/ I encourage you to try writing an FFT routine in C yourself and compare it to FFTW, where they basically wrote a compiler for doing FFTs. It's also worth doing in an interpreted language…

> Forcing your compiler to figure out you're doing something trivial on a rank-n array is silly. What is the alternative, if there is no canned procedure for it? The procedure has to be written somewhere, somehow, in some language. If compilers are silly, assembly, I guess?

The analysis to recognize whether a "canned procedure" is applicable is nontrivial, to put it lightly.

Re: A deep dive into APL

#74

Earlier quoted context omitted.

> I won't bother implementing the apparent requirement that the indices be digit characters from a string; I consider it a serious blemish on the language, if it's doing it implicitly. There's no such requirement, < (and by extension <<) returns the same result for 0 1 0 2, "0102" or "abac".

I don't mean that the program requires the input in that form, but that the problem specification (in its strict interpretation) specifies it, and I'm missing that requirement in my solution. Obviously, there is here a language-level requirement in K that 0, "0" or "a" all denote an index zero, at least in the exemplified situation. Though that may help get points on http://codegolf.stackexchange.com , it comes acros…

>Obviously, there is here a language-level requirement in K that 0, "0" or "a" all denote an index zero, at least in the exemplified situation.

no, 0 just sorts before 1, "0" before "1" and "a" before "b"

Re: A deep dive into APL

#75

Earlier quoted context omitted.

I don't mean that the program requires the input in that form, but that the problem specification (in its strict interpretation) specifies it, and I'm missing that requirement in my solution. Obviously, there is here a language-level requirement in K that 0, "0" or "a" all denote an index zero, at least in the exemplified situation. Though that may help get points on http://codegolf.stackexchange.com , it comes acros…

>Obviously, there is here a language-level requirement in K that 0, "0" or "a" all denote an index zero, at least in the exemplified situation. no, 0 just sorts before 1, "0" before "1" and "a" before "b"

I see so something like "abac" is basically mapped to 0 1 0 2 by mapping the lowest-order element in that sequence to 0, and the others following suit. In which case, it would be expected that, say, "xyxz" could be used in place of "abac".

"Auto-indexifying" a sequence in this way does seem like a useful little operation to have.

Re: A deep dive into APL

#76
post #28

Earlier quoted context omitted.

Isn't the inventor of K+/Q currently writing his own operating system? Haven't heard any progress about that in a long time, hope it actually gets some use. Sure, won't be the next Linux, but maybe more than the next ColorForth.

ColorForth is not an OS. For C. Moore, an Operating System is a non-thing.

That's splitting hairs a bit. If I boot into an programming system that lets me operate the computer, I'd call that an operating system. I don't see a significant difference between ColorForth (or other native forths) and e.g. home computer Basics, Oberon or even Lisp Machines.

And more to the point, I wouldn't assume that kOS would be closer to Unix/Windows than Forth/SmallTalk/Mesa etc.

Re: A deep dive into APL

#77

Earlier quoted context omitted.

>Obviously, there is here a language-level requirement in K that 0, "0" or "a" all denote an index zero, at least in the exemplified situation. no, 0 just sorts before 1, "0" before "1" and "a" before "b"

I see so something like "abac" is basically mapped to 0 1 0 2 by mapping the lowest-order element in that sequence to 0, and the others following suit. In which case, it would be expected that, say, "xyxz" could be used in place of "abac". "Auto-indexifying" a sequence in this way does seem like a useful little operation to have.

Grade up (or grade down) returns the index of an array in sorted order. So >"weasels" would return: 0 3 6 5 1 4 2.

Re: A deep dive into APL

#78

Earlier quoted context omitted.

Chuck Moore writes one for every project.

That's a deep misunderstanding of what he does. When you run a single process on a single hardware, you don't need an OS.

Slight sarcasm, but he has written several before I'm pretty sure and does deserve his rather mythic status.

Re: A deep dive into APL

#79

Earlier quoted context omitted.

You ever try the modern Dyalog offering with .NET, SQL, and R interop? Pretty cool stuff although I don't really use the language. There is a guy here writing a compiler for Dyalog APL that runs on a GPU, but is only a few pages of APL. If that isn't the future, I don't know what is.

I also think it's the future, the problem is that I don't believe that Dyalog APL is the future, even though it's really nice. It just should be opensource to succeed imho., why still be so greedy and take money for a language. Also the IDE is really weird. I love APL and J, but I think there is a lot of space for improvement. And I want that improvement to happen in the open. They can still charge for Consulting, Ho…

I'm curious if it would be so nice as a non-commercial project. I suppose some companies would still pay for support and development.

Re: A deep dive into APL

#80

Earlier quoted context omitted.

Second bullet point is pretty funny. I really liked linear algebra, but I'm sure it could get frustrating if you're not an expert. I wonder if it makes sense philosophically for code to be more mathematical like APL or like a spoken language like Python.

"SciPy – the embarrassing way to code" http://www.vetta.org/2008/05/scipy-the-embarrassing-way-to-c...

I enjoyed this article. Thanks!
Post reply on HN