[PRL] Bob Harper's new blog

David Herman dherman at ccs.neu.edu
Thu Mar 17 15:03:49 EDT 2011


> I meant 90% of dynamic evaluations.  The static percentage
> is less, but even the static percentage of calls whose code
> could be identified statically is usually much higher in
> mostly-functional languages than in OO languages.
> 
> Combinator-heavy programming in Haskell could be an
> exception to my claim.  I haven't studied Haskell programs.
> My claim is based on my personal measurements of Scheme
> programs, some of which were translated quite literally
> from programs written in other mostly functional languages
> such as Standard ML.  My claim is supported by similar
> results as reported by other researchers.

I'm still just surprised to hear you make such a broad claim. There are all sorts of styles of programming in mostly-functional languages. Combinator libraries are popular in Racket, for example.

I also still find the 90% figure incredibly high. Your point about loops is fair; it certainly does help inflate the number. But I would not be surprised if the number is highly variable depending on the community and application domain.

>> But finally, the claim that OO languages don't optimize
>> inheritance is the most dubious.
> 
> I never said that implementations of OO languages don't
> optimize inheritance.

OK. You made the original point, so you have the right to declare JIT compilers out-of-bounds. Let me concede that I find it plausible that the percentage of dynamic calls that existing AOT compilers for existing mostly-FP languages would have turned into direct jumps is higher than the percentage of dynamic calls that existing AOT compilers for existing OO languages would have turned into direct jumps. I'm still confused about your overall point. Is it that the combination of the static techniques and dynamic techniques make FP the winner?

> I never claimed that OO implementations do not optimize
> dynamic method calls.  That's your straw man, and it has
> nothing to do with what I have actually written.  If you
> had heard Allen Wirfs-Brock's invited talk at DLS 2010,
> you'd know that many of the dynamic optimizations that
> are just now beginning to be used in JS/Java/C# systems
> were pioneered long ago in languages like Lisp and
> Smalltalk.

Uh, I work with Allen, I've seen the talk, I'm well aware of the roots of these optimizations, and I myself even pointed that out in this very thread.

Dave




More information about the PRL mailing list