Live data from Hacker News

APL – a Glimpse of Heaven (2006)

archive.vector.org.uk

31–40 of 47 posts

Re: APL – a Glimpse of Heaven (2006)

#31

I have an issue with APL. My grandfather who is a researcher in forest science (sorry English is not my main language), made his own software in APL to manage his own forest. Now, he is becoming old, and trying to get me to get the software, and to understand it for when he will pass. The thing is, I'm a C++ dev professionally, but whenever I see his code in APL, I cringe. I can't get to make him understand that buil…

Before trashing a complicated program in a serious programming language and replacing it with Excel, consider this:

http://lemire.me/blog/archives/2014/05/23/you-shouldnt-use-a...

It can actually be fun learning radically different programming languages. I find it improves my programming in my primary language. And you're in the lucky position of having someone who can help you learn.

Re: APL – a Glimpse of Heaven (2006)

#32
post #14

I've dabbled in J, and it's left me with a permanent sense of slight disillusionment with regards to every other numerical programming language I've used. It seems mind-boggling that NumPy, MATLAB, and even Julia lack the versatile broadcasting rules of APL family languages. In J, if you write a simple function that composes several built-in operators, your function is fully vectorized and can act on lists and arrays…

I am still optimistic about Julia in this regard. That phantom limb pain after having used J is there, but the nice thing is that Julia is very extensible, for example hopefully soon infrastructure to cast a 2x4x4 array into a length 4 vector of 2x4 arrays without copying memory will be implemented which is an important step forward to mimic APL style programming if you think about it.

Re: APL – a Glimpse of Heaven (2006)

#33
post #14

I've dabbled in J, and it's left me with a permanent sense of slight disillusionment with regards to every other numerical programming language I've used. It seems mind-boggling that NumPy, MATLAB, and even Julia lack the versatile broadcasting rules of APL family languages. In J, if you write a simple function that composes several built-in operators, your function is fully vectorized and can act on lists and arrays…

And this broadcasting mechanism seems very amenable to fusion and targeting of GPU resources. Perhaps Julia could add broadcast, kinda like a list comprehension.

Re: APL – a Glimpse of Heaven (2006)

#34
post #15

I did quite a bit of APL programming when I was younger. When describing APL, people talk about the strange symbols, the mathematics, etc... but I have never seen anyone describe something I only realized after some time: APL makes you approach problems quite differently, when you are familiar with it. I stopped thinking in 'steps' applied to the individual data points, but rather I solved the problem in my head (and…

Loosely speaking, this is how I program in SQL. Each table is plane floating in a multidimensional space, each relation get pinned from one plane to another, joins are spikey balls, sub queries are recursive non-euclidean spaces, etc. Although I'd say the SQL is more readable than J but the mental visualization you describe is nearly identical.

Re: APL – a Glimpse of Heaven (2006)

#35

Earlier quoted context omitted.

Man, I hope when I have grandchildren, they won't want to throw a bundle of my life's work in the trash. Maybe github instead?

Well, I don't want to... but I have no time nor real interest in trying to understand what he did in APL. My only issue is that he is not interested in hearing from me that nobody will take over what he did.. He won't listen ;( He thinks everything else sucks.. I tried to make him read some stuff about python for example. He said this sucked also ! lol

Just because some tech is old doesn't make it bad. People solving and writing programs in 60s and 70s were just as smart as we are, work to extract their wisdom.

Re: APL – a Glimpse of Heaven (2006)

#36
post #22
post #20

All I could think of while reading this was, how am I supposed to type all those weird characters?

You can use Emacs: https://github.com/lokedhs/gnu-apl-mode Yes, I'm advertising my own work here.

I set this up two days ago. Haven't learned APL yet, but your mode will help, thanks!

Re: APL – a Glimpse of Heaven (2006)

#37
post #34
post #15

I did quite a bit of APL programming when I was younger. When describing APL, people talk about the strange symbols, the mathematics, etc... but I have never seen anyone describe something I only realized after some time: APL makes you approach problems quite differently, when you are familiar with it. I stopped thinking in 'steps' applied to the individual data points, but rather I solved the problem in my head (and…

Loosely speaking, this is how I program in SQL. Each table is plane floating in a multidimensional space, each relation get pinned from one plane to another, joins are spikey balls, sub queries are recursive non-euclidean spaces, etc. Although I'd say the SQL is more readable than J but the mental visualization you describe is nearly identical.

I agree. "Grokking SQL" (or rather the relational and set concepts behind it) makes it possible to mentally map how you want the query to behave.

Although SQL is way, way more verbose than J/APL it is still extremely readable, even if the query is massive. Untrained SQL users always point to big queries as some sort of code smell when in fact most queries are logically partitioned by virtue of how they work.

Re: APL – a Glimpse of Heaven (2006)

#38
post #35

Earlier quoted context omitted.

Well, I don't want to... but I have no time nor real interest in trying to understand what he did in APL. My only issue is that he is not interested in hearing from me that nobody will take over what he did.. He won't listen ;( He thinks everything else sucks.. I tried to make him read some stuff about python for example. He said this sucked also ! lol

Just because some tech is old doesn't make it bad. People solving and writing programs in 60s and 70s were just as smart as we are, work to extract their wisdom.

And worked with limitations sufficiently strong that they had to extract every ounce of functionality out of the hardware they had at their disposal.

Re: APL – a Glimpse of Heaven (2006)

#39
Another descendent of APL is the K programming language from Arthur Whitney (whose One page APL interpreter inspired the J implementation)

I would say that K:J is like C:C++ in terms of complexity (not of heritage). I personally prefer the K and C to J and C++ but to each their own.

Re: APL – a Glimpse of Heaven (2006)

#40
post #37
post #34

Earlier quoted context omitted.

Loosely speaking, this is how I program in SQL. Each table is plane floating in a multidimensional space, each relation get pinned from one plane to another, joins are spikey balls, sub queries are recursive non-euclidean spaces, etc. Although I'd say the SQL is more readable than J but the mental visualization you describe is nearly identical.

I agree. "Grokking SQL" (or rather the relational and set concepts behind it) makes it possible to mentally map how you want the query to behave. Although SQL is way, way more verbose than J/APL it is still extremely readable, even if the query is massive. Untrained SQL users always point to big queries as some sort of code smell when in fact most queries are logically partitioned by virtue of how they work.

I replaced a 5k line system with a 140 line SQL query. So massive SQL can have pretty significant multiplier in main code reduction.
Post reply on HN