[e-lang] "Scope" or "Environment"? Your observations wanted
Lex Spoon
lex at lexspoon.org
Tue Aug 12 19:35:50 CDT 2008
On Aug 12, 2008, at 11:37 AM, David-Sarah Hopwood wrote:
> Kevin Reid wrote:
>> On Aug 11, 2008, at 18:16, Lex Spoon wrote:
>>
>>> Environments are closely related to the ambient authority that
>>> caps folks talk about.
>>
>> That's a bit of an alarming notion, but I can't think of a refutation
>> at the moment.
>
> The only difference is that the scope of the variables in an
> environment
> is restricted -- but that's a critical difference. In an object-
> capability
> language, restriction of scopes is the most important (or the only?)
> security mechanism.
Yes, the notion can be used for good if you push in the other
direction. :) As an example, inheritance makes it easy to toss
zillions of things into a static environment, most of which you won't
need. If the environment is giving you authority, then you might
want to not be blaise about a language feature that makes large
environments so easy to create.
Another connection with environments and capabilities is that it's a
danger sign for things to be in dynamic environments that are not in
static environments. In such cases, the language isn't helping you
reason about all the variables (or whatever) that will be available.
If those things grant authority, the language is really letting you
down. Thankfully, most languages are statically bound nowadays and
do allow you to at least know what variables are available at each
point in the code.
Or maybe it's a completely bogus comparison. It sounds nice, though.
-Lex
More information about the e-lang
mailing list