[PRL] Bob Harper's new blog

Matthias Felleisen matthias at ccs.neu.edu
Thu Mar 17 13:26:00 EDT 2011


On Mar 17, 2011, at 1:20 PM, Joe Marshall wrote:

>> On Mar 17, 2011, at 11:44 AM, will at ccs.neu.edu wrote:
>>> 
>>>    In current OO languages, loops are expressed without using calls.
> 
> On Thu, Mar 17, 2011 at 9:27 AM, Matthias Felleisen
> <matthias at ccs.neu.edu> wrote:
>> 
>> I don't understand this reason.
> 
> This takes a *huge* burden off the compiler because it requires the
> programmer to manually optimize tail calls into forms that are
> trivial to compile.  The remaining calls are much more likely to be
> `hard to compile efficiently' for any compiler, so the compiler
> writers are able to claim `we perform well on function calls' when
> in fact they completely punt on the easy cases and make the
> user do the work.
> 
> (As an example, in Scheme it is easy to write a tail call to
> a statically known procedure where the dynamic environment
> is not known until runtime.  Basically, you make a tail call
> within the same procedure but across lexical scopes.  Good
> lisp compilers handle this efficiently.  You can't even express
> this in Java.)


Ah it is great to see someone explain to me what I have preached for oh so many years. Onwards. 


More information about the PRL mailing list