On Sun, 2009-09-06 at 14:55 -0700, Joe Marshall wrote:
> I guess we'll first have to narrow down what we mean by `first-class
> environments'
> If you can only obtain a first-class environment by an explicit call to
> `the-environment', then you have fewer problems. But if you can call
> `procedure-environment' on any procedure, you've pretty much opened up
> the entire world.
I'm conservative enough to not be too enthusiastic about
`procedure-environment' We also have to be careful and
conservative about specifying allowable side-effects upon
environments.
> If you can eval `define' in a first-class environment, that can change
> the binding
> contours. If you wish to restrict how that works, then there are
> fewer problems.
There are in-betweens there, too. You could say either that
a shadowing define is undefined or that it has no defined effect on
code earlier defined in the same environment.
> >> The reason the compiler cannot compile the code is because the
> >> code cannot be statically reasoned about. If the *compiler* can't
> >> reason about the code, a human has no hope.
> >
> > That's a load of crap, if you will please pardon the
> > expression. A compiler can reason thusly: "Ah, I see
> > that this has to be left to the run-time interpreter because
> > there is no optimized static representation of this code."
>
> I didn't mean the compiler couldn't defer to a runtime model.
> I meant that it *had* to punt to the runtime. That is, the
> compiler looks at the code and says ``Hmmm. Too dynamic,
> I got no clue, I'll compile this as `(eval ,code ,environment)''
That ("(eval ,code ...)") is a perfectly fine definition
of the semantics of a compiler. All the rest is optimization
for special cases.
>
> > A human can reason principally by constructive induction
> > for many useful programs.
>
> They fail miserably when it gets complicated.
You suffer that problem already, as soon as you admit
lambda, for example.
-t
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss