[PRL] basic terminology: abstraction

David Herman dherman at ccs.neu.edu
Sat Aug 23 14:46:50 EDT 2003


On Saturday, August 23, 2003, at 11:16 AM, Matthias Felleisen wrote:

> 1. Guido and I are in complete agreement. He has some intuition; I 
> just wish he
> understood 311 and friends.

Well, Guido and I are only in partial agreement. He's right that loops 
are at a higher level than recursion. I agree with him in that 
(for-each display alos) is more appropriate than a full structural 
recursion. The for-each loop is the right semantic level to think about 
"display all the strings in alos." The rest is implementation detail 
that's irrelevant at this level, which a full recursion would expose.

But in a language like Java (say, with generics), a loop is going to 
have the exact same problem:

     List<String> alos;
     ...
     for (Iterator<String> it = alos.iterator(); it.hasNext(); ) {
         String s = it.next();
         System.out.print(s);
     }

This loop exposes detail of the iteration process just like the 
recursion above. A solution is eventually coming to a future version of 
Java:

     for (String s : alos) {
         System.out.print(s);
     }

So Java programmers have to wait for Java's enlightened despots to add 
to the toolbox of loops. But higher-order, recursive functions in FPL's 
allow the developer to decide what abstraction (in the sense of 
generalization) will serve as the best abstraction (in the sense of 
semantic level) for his/her particular program.

I know I'm preaching to the preacher here, but my point is that 
although I agree with Guido that loops are a higher semantic level than 
recursion, I think he's at least implying that recursion is somehow 
"too powerful" or "too difficult" for mortal human beings. I suppose I 
can accept that recursion is harder to understand than particular loop 
constructs. After all, the abstract (general) is always harder to 
understand than the particular. But without sufficiently powerful 
abstraction (generalization) mechanisms, you can't create higher levels 
of abstraction (semantic level). In other words: feed a programmer a 
loop and he'll loop for a day; teach him how to recurse and he'll 
create loops for a lifetime.

> Now start reading Bob's paper
> from there and a lot of things become clear. (That's where Bob's 
> tremendous contribution
> is and I wish people understood this. Then again, he makes no effort 
> to communicate, so
> perhaps he deserves what he gets.)

I found Hudak's report at 
<http://citeseer.nj.nec.com/hudak96building.html> but couldn't figure 
out which Harper paper you're referring to. Which one do you mean?

Thanks,
Dave



More information about the PRL mailing list