Live data from Hacker News

Rob Pike explains why every programmer should know about the array languages

arraycast.com

31–39 of 39 posts

Re: Rob Pike explains why every programmer should know about the array languages

#31
post #9

Earlier quoted context omitted.

It's entirely possible for an expert programmer and pl designer to have never heard of ML-based languages or FP as a name for the concept.

Would Haskel or some other functional language be a part of a typical CS curriculum? I remember having a course about programming paradigms which introduced different languages and we wrote a small project based on functional languages.

I expect that in good universities, with rich curriculum.

At very least one of Lisp or Scheme variants, ML variants or Prolog variants.

Re: Rob Pike explains why every programmer should know about the array languages

#32
post #6

> whenever something APL related comes up on Hacker News, it's always in the form of arcana you'll laugh at rather than fascinating work being being done by very smart people. I find that offensive, but I'm not going to push back on that. I don't talk on Hacker News. But I've seen a lot of interesting things being posted about it, and the comments are always almost universally, like: "what the hell is that for?". And…

Syntax matters. Sure, you can learn to read and write what superficially looks like line noise, but the market has spoken: very few people want to . Look at the success of Tensorflow and PyTorch. They’re also tensor / array programming systems. They’re wildly popular, with at least two orders of magnitude more users each than all array languages put together. The difference is that they’re built on top of Python, whi…

> What’s the point of an array-based language if it’s slower and harder to write than the equivalent in mainstream languages!?

How many times would you throw away a 1000 line program and start over with completely different data structures and algorithms, just to try a different approach? What about a 10 line program? Or a 1-line program?

When it's basically free to rewrite your entire program, you tend to explore more. That's one benefit terseness affords you.

Re: Rob Pike explains why every programmer should know about the array languages

#33

Earlier quoted context omitted.

Syntax matters. Sure, you can learn to read and write what superficially looks like line noise, but the market has spoken: very few people want to . Look at the success of Tensorflow and PyTorch. They’re also tensor / array programming systems. They’re wildly popular, with at least two orders of magnitude more users each than all array languages put together. The difference is that they’re built on top of Python, whi…

> What’s the point of an array-based language if it’s slower and harder to write than the equivalent in mainstream languages!? How many times would you throw away a 1000 line program and start over with completely different data structures and algorithms, just to try a different approach? What about a 10 line program? Or a 1-line program? When it's basically free to rewrite your entire program, you tend to explore mo…

With auto complete I rarely type more that a character or two of any single thing. I doubt it takes me much longer to compose a traditional program compared to array language syntax with modern tooling.

Re: Rob Pike explains why every programmer should know about the array languages

#34
post #33

Earlier quoted context omitted.

> What’s the point of an array-based language if it’s slower and harder to write than the equivalent in mainstream languages!? How many times would you throw away a 1000 line program and start over with completely different data structures and algorithms, just to try a different approach? What about a 10 line program? Or a 1-line program? When it's basically free to rewrite your entire program, you tend to explore mo…

With auto complete I rarely type more that a character or two of any single thing. I doubt it takes me much longer to compose a traditional program compared to array language syntax with modern tooling.

The (human) memory footprint of the more verbose program is much larger though, requiring it to be thought of in smaller chunks, and thus in a slower manner. You can't keep the mental model of a 1000 line program entirely in your memory, but a 10 line program is different, even if the individual lines are more dense.

Re: Rob Pike explains why every programmer should know about the array languages

#35
post #6

> whenever something APL related comes up on Hacker News, it's always in the form of arcana you'll laugh at rather than fascinating work being being done by very smart people. I find that offensive, but I'm not going to push back on that. I don't talk on Hacker News. But I've seen a lot of interesting things being posted about it, and the comments are always almost universally, like: "what the hell is that for?". And…

Syntax matters. Sure, you can learn to read and write what superficially looks like line noise, but the market has spoken: very few people want to . Look at the success of Tensorflow and PyTorch. They’re also tensor / array programming systems. They’re wildly popular, with at least two orders of magnitude more users each than all array languages put together. The difference is that they’re built on top of Python, whi…

> They’re wildly popular, with at least two orders of magnitude more users each than all array languages put together

Except for Excel. Which is probably three orders of magnitude more popular, if that is how you measure things.

Re: Rob Pike explains why every programmer should know about the array languages

#36
post #6

> whenever something APL related comes up on Hacker News, it's always in the form of arcana you'll laugh at rather than fascinating work being being done by very smart people. I find that offensive, but I'm not going to push back on that. I don't talk on Hacker News. But I've seen a lot of interesting things being posted about it, and the comments are always almost universally, like: "what the hell is that for?". And…

Syntax matters. Sure, you can learn to read and write what superficially looks like line noise, but the market has spoken: very few people want to . Look at the success of Tensorflow and PyTorch. They’re also tensor / array programming systems. They’re wildly popular, with at least two orders of magnitude more users each than all array languages put together. The difference is that they’re built on top of Python, whi…

> Syntax matters.

Indeed it does! Not to try to be confrontational, but have you written any substantial programs in an array language like APL? I'm sure that any APL programmer will be the first to tell you that writing APL would be unbearable if those "unreadable" symbols were replaced with names! Why? Because in APL, each symbol is a unit of meaning, and there's simply no reason for each unit of meaning to be more than a single character. Why should I type `add folded divided_by count` when I can just write `+/÷≢`?

> Sure, you can learn to read and write what superficially looks like line noise, but the market has spoken: very few people want to.

True! And it will surely always be true! But no one would want to write APL without the symbols. ("But isn't Tensorflow just like APL without the symbols?" No. Tensorflow is based on the array paradigm, but it is very, very different from an array __language__ like APL.)

> obscure syntax over English

This is effectively like berating the Chinese for inventing a writing system that looks nothing like the Latin script. Is it totally different? Yes. Does that make it inherently bad? No. (Can it still be bad? Yes! But I don't think APL and friends are as bad as people might think.)

Anyway, that's my two cents on the obscure syntax of array languages are a tool, not a problem. They'll always limit the userbase, there's no doubt about that, but I couldn't imagine a world without them.

Re: Rob Pike explains why every programmer should know about the array languages

#37

I wish the licensing of APLs were more free. Yes, GNU APL exists and related languages like J are free. However, if you want the APL symbol set your choices are few: GNU APL, Dyalog, or one-man hobby projects. As far as I can tell, GNU APL is more of a historical time capsule than a practical development language. The array language community seems friendly and exceedingly competent. It also appears to have a strong…

I second the recommendation for BQN.

You know, there's a reason why there's so many "one-man hobby project" implementations of, say, APL. It's actually not that hard! If you're willing to spend a week (yes, a week), you can have your own barebones implementation of APL. And from there, it's really sort of your playground, which is neat. Thought of a cool idea? Implement it! Obviously, most people won't want to do this, investing time (even if it's not that much) in something they don't really even have any experience invested in. But it's an easier option than you might expect.

Re: Rob Pike explains why every programmer should know about the array languages

#38

Earlier quoted context omitted.

It's entirely possible for an expert programmer and pl designer to have never heard of ML-based languages or FP as a name for the concept.

Possibly. It's wierd he's so enamored with apl which just seems to me like languages focused an algebra designed around arrays. Algebra based designs can be formed around many data structures and many languages generalize this concept like Haskell. With Haskell you can create your own algebraic DSL around arrays and anything else you can think of. It seems he's enamored with the specific array instance of algebra bas…

APL wasn't originally a programming language at all. Ken Iverson designed it as a mathematical notation to express and reason about computer algorithms. "Notation as a tool of thought," is how he thought about it. It was implemented as a programming language years after he created the notation in 1960.

An APL-like Haskell DSL could be interesting, but to match APL's expressiveness you'd basically need to reimplement all of APL. For maximum generality, one could just skip both APL and Haskell and just use the lambda calculus. I found that a bit hard to work with, though.

As far as Numpy and all, they are all directly descended from APL. The difference is that it takes 10 lines of Python to match 10 characters of APL. While the array languages' terseness can be excessive, doing it in Python is not very pleasant either.

Anyway, here's somebody who knows more than I do talking about what they like about APL's successor, J: https://www.youtube.com/watch?v=RWYkx6-L04Q

Re: Rob Pike explains why every programmer should know about the array languages

#39

Earlier quoted context omitted.

Maybe so. I guess you're talking about option types, although it's not obvious to me that these do any better given the requirement that errors are always explicitly shown in the code. So maybe your problem is with that requirement instead. But why are you listening to a podcast in the hopes the guest will admit his ignorance and tell you something you already know, instead of to learn new things?

>I guess you're talking about option types, I'm talking about a more general concept. A kind of type that can be either one thing or another. For example an Int or an Error. You have Product types which are types that are two things at the same time an (int and an error) and you have sum types (int or an error). To illustrate say I have two types that consists of a small finite set of values type A and type B. A = 1…

> or maybe he just didn't know about it

They knew about it, they considered it, and they decided not to do it. Sometimes it's just that simple. It has been mentioned in the FAQ since day one: https://go.dev/doc/faq#variant_types

Post reply on HN