guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Elisp lexical-let


From: Mark H Weaver
Subject: Re: Elisp lexical-let
Date: Thu, 23 Jul 2009 12:13:13 -0400

On Thu, Jul 23, 2009 at 05:24:30PM +0200, Marijn Schouten (hkBst) wrote:
> For the calls above all the dynamic accesses can be determined statically.
> Lexical accesses can always be determined statically. Thus all accesses in 
> this
> example can be determined statically and can be compiled to a location
> dereference (either read or write). Nothing in the semantics is inherently
> inefficient.

There is at least one inherent loss of efficiency with the semantics
you propose: with a lexical-let binding, the compiler can determine
statically whether the variable is non-mutable, because the only place
it could possibly be set! is within the lexical scope.  Non-mutable
variables can safely be inlined, an especially important optimization,
especially if the value is a procedure.

Also, with lexical-let, the compiler knows statically the entire set
of references, which can be helpful with many analyses, for example
whether continuations or closures can "escape" a particular scope,
whether a particular continuation might be invoked more than once,
etc.

    Regards,
      Mark




reply via email to

[Prev in Thread] Current Thread [Next in Thread]