Skip to content

Comment on APL – a Glimpse of Heaven (2006)

Comments

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 properly, and even arrays of arrays. In MATLAB, the same function stands a pretty good chance of only accepting scalar inputs unless you put extra effort into making it vectorized, and almost certainly won't do the right thing when given higher-dimensional arrays. Julia seems to likewise default to being mostly scalar-oriented, and only makes it less painful by having efficient JIT, but still lacks the expressiveness advantage.

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.

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

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.