interview

uses the ASCII keyboard. It’s completely arbitrary, but it makes me keep the language small.

BC You speak about the arbitrariness in using the ASCII keyboard. I heard one feature being described as this: “When Arthur ran out of punctuation, he used a leading underscore to denote system primitives.” When I read that I thought to myself, “That’s a little ridiculous,” but then I thought of all the goofy punctuation characters we have in other languages: C uses nearly all of them; many languages use the balance. And we use them in different contexts and different ways. AW Certainly it’s unfamiliar, and people say, “Oh, it looks like line noise.” But even kids can learn this quickly. BC Obviously, a point of pride for K is the ability to phrase things concisely. Is there any length that is too short, where you’ve actually squeezed too much information out in terms of its readability? AW Yes, and I expect I cross that boundary a lot. But if every line has up to seven operations, then I think that’s manageable. In fact, we can remember seven things. BC Right. People are able to retain a seven-digit phone number, but it drops off quickly at eight, nine, ten digits. AW If you’re Cantonese, then it’s ten. I have a very good friend, Roger Hui, who implements J. He was born in Hong Kong but grew up in Edmonton as I did. One day I asked him, “Roger, do you do math in English or Cantonese?” He smiled at me and said, “I do it in Cantonese because it’s faster and it’s completely regular.” BC This raises an interesting question. When I heard about your early exposure to APL, a part of me wondered if this was like growing up with tonal languages. I think for most people who do not grow up with a tonal language, the brain simply cannot hear or express some of the tone differences because we use tone differently in nontonal languages. Do you think that your exposure to this kind of programming at such a young age actually influenced your thinking at a more nascent level? AW I think so, and I think that if kids got it even younger, they would have a bigger advantage. I’ve noticed over the years that I miss things because I didn’t start young enough. BC To ask a slightly broader question, what is the connection between computer language and thought? To what degree does our choice of how we express software change the way we think about the problem? AW I think it does a lot. That was the point of Ken Iverson’s Turing Award paper, “Notation as a Tool of Thought.” I did pure mathematics in school, but later I was a teaching assistant for a graduate course in computer algorithms. I could see that the professor was getting

killed by the notation. He was trying to express the idea of different kinds of matrix inner products, saying if you have a directed graph and you’re looking at connections, then you write this triple nested loop in Fortran or Algol. It took him an hour to express it. What he really wanted to show was that for a connected graph it was an or-dot-and. If it’s a graph of pipe capacities, then maybe it’s a plus-dot-min. If he’d had APL or K as a notation, he could have covered that in a few seconds or maybe a minute, but because of the notation he couldn’t do it.

Another thing I saw that really killed me was in a class on provability, again, a graduate course where I was grading the students’ work. In the ’70s there was a lot of work on trying to prove programs correct. In this course the students had to do binary search and prove with these provability techniques that they were actually doing binary search. They handed in these long papers that were just so well argued, but the programs didn’t work. I don’t think a single one handled the edge conditions

“If you can find a shorter,

more elegant program that
isn’t much slower than my code,
I want to hear about it.”
—Arthur Whitney

correctly. I could read the code and see the mistake, but I couldn’t read the proofs.

Ken believed that notation should be as high level as possible because, for example, if matrix product is plus-dot-times, there’s no question about that being correct. BC By raising the level of abstraction, you make it easier for things to be correct by inspection.

AW Yes. I have about 1,000 customers around the world in different banks and hedge funds on the equity side (where everything’s going fine). I think the ratio of comment to code for them is actually much greater than one. I never comment anything because I’m always trying to make it so the code itself is the comment.

BC Do you ever look at your own code and think, “What the hell was I doing here?”

AW No, I guess I don’t.

BC Wow! I confess that I tend to write comments for my future self. I know that when I come back to code I’ve

References:

mailto:feedback@queue.acm.org

Archives