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

Re: first-class names

From: <mike@newhall.net>

> > What do you mean by "all the costs"?  And what do you mean by
> > "canonical implementation"?
> >
> > Cheers =8-} Mike Friede
> >From earlier: "Joe Marshall" <jrm@ccs.neu.edu> wrote:
> The biggest problem with first-class environments ala MIT Scheme
> is the introduction of new bindings at runtime.  If you introduce a
> new binding, the `lexical address' (frame and offset) of a variable
> cannot be statically determined and you have to do a deep search
> every time.  It absolutely destroys any sort of compiler optimization.
>     So I think the exact question is, if bundling a symbol and its
> environment bypasses the need for a deep search every time, does this
> allow the introduction of new bindings at runtime and also some or all
> of the optimizations possible with ordinary lexical scoping?  I
> suppose for a new binding with a supplied destination environment the
> frame is statically known but the offset is not (necessarily) known.

This sounds like dynamic scoping.  You can get very fast lookup, but
it has its own problems.