[PRL] Bob Harper's new blog

Dave Herman dherman at ccs.neu.edu
Thu Mar 17 12:08:09 EDT 2011


Now *this* I really have to question.

First, with the popularity of combinator libraries like Parsec (ok, you could arguably claim Haskell isn't mostly-functional, but regardless, combinator libraries are everywhere). Second, you aren't clear whether you mean 90% of static occurrences of calls or 90% of dynamic evaluations of calls (I question the figure either way).

But finally, the claim that OO languages don't optimize inheritance is the most dubious. For example, most JS engines use the dynamic optimization of Polymorphic Inline Caches (PIC's) to short-cut method lookups. This technique goes back at least to the 90's if not 80's. And that's only in the last few years that JS engines have begun seriously optimizing. JVM technology has over a decade of optimization (over a century of person-years of work, I'm told) on top of that. I don't know their particular techniques, but the idea that they wouldn't optimize dynamic dispatch -- the number one control abstraction in the whole Java language -- just doesn't pass the smell test.

Dave
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

will at ccs.neu.edu wrote:

Matthias Felleisen wrote: > How does the dynamic dispatch of inheritance differ from > the 'random' jumps induced by calls to first-class functions > in FPLs? It's a matter of degree. The ideology of higher-order functions is not as harmful as the ideology of inheritance. In most programs that are written in mostly-functional languages, well over 90% of the procedure calls are made to functions whose code could be determined at compile time. Currently available compilers do a pretty good job of determining those targets, replacing indirect jumps by direct branches. In most programs that are written in current object-oriented languages such as Java and C#, most method calls involve dynamic dispatch at run time. There are several reasons for this: In current OO languages, loops are expressed without using calls. The OO culture continues to emphasize inheritance, which has the effect of deprecating static, final, and private methods that can't be overridden in a subclass. Most o
 f the
currently available OO compilers don't even try to determine the target of a dynamic method call, mainly because the mere possibility of inheritance usually defeats that kind of optimization. Will_____________________________________________
PRL mailing list PRL at lists.ccs.neu.edu https://lists.ccs.neu.edu/bin/listinfo/prl 

-------------- next part --------------
HTML attachment scrubbed and removed


More information about the PRL mailing list