About removing global variables

lex at cc.gatech.edu lex at cc.gatech.edu
Sun Nov 28 16:32:30 UTC 2004


Jecel Assumpcao Jr <jecel at merlintec.com> wrote:
> Globals are specially bad from a security viewpoint. They violate POLA
> (principal of least authority) by making a set of objects available to
> every single object in the system.

It does not violate POLA in Squeak's case, because the LA is simply very
large.  Squeak is a late-bound computer authoring system, and it is a
*feature* that you can type "Display" to access the low-level bitmap,
"Sensor" to talk to the mouse, and "Smalltalk" to talk to the system
itself.  You are supposed to be able to read in audio and, in response,
change the globals table and recompile classes.  Yes it's weird, but
that's the point.  We don't know what future designers will want.

Thus, if you were to implement Squeak in a language without global
variables, what you'd do is create one scope that has all of Squeak's
current globals, and then do everything inside that scope.  All you'd do
is replace global variables, with practically global variables.

But before people go crazy, yes I think it is possible to make an
authoring system where the least authorities aren't so large.  In fact,
I agree that such an authoring system would be marevelous to have.  It's
just a completely different system than Squeak.  Squeak is an
environment for building its own successor!  To achieve that goal,
Squeak should allow fast iteration of design ideas.  This fast iteration
is incompatible with chopping authority into little bits.

Let's plan that, if and when people do build secure authoring
environments similar to Squeak of today, we still continue to have
something highly maleable like the current Squeak.  Speed of iteration
matters, and is one of Squeak's biggest selling points.  Squeak has lots
of goodies, and it also has lots of flexibility for doing whatever crazy
thing you can dream up.  This is a rare and important combination, and
we should be careful to hang on to it.

Finally, if we had to choose just one system, for some reason, I would
vote for the maleable one instead of the secure one.  It is more
important to build the next Great Thing, than to make a better Current
Thing.

Lex



More information about the Squeak-dev mailing list