[Top][All Lists]
[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
- Elisp lexical-let, Daniel Kraft, 2009/07/21
- Re: Elisp lexical-let, Ken Raeburn, 2009/07/22
- Re: Elisp lexical-let, Daniel Kraft, 2009/07/23
- Re: Elisp lexical-let, Andy Wingo, 2009/07/23
- Re: Elisp lexical-let, Daniel Kraft, 2009/07/24
- Re: Elisp lexical-let, Andy Wingo, 2009/07/23
Re: Elisp lexical-let, Andy Wingo, 2009/07/23