Side-effect free containers for E

Ken Kahn kenkahn@toontalk.com
Fri, 11 Aug 2000 13:52:44 -0700


Tyler wrote:

>
> I think the learning and cognitive load would actually be lower after
> the switch to immutable containers. Instead of two very different
> classes that had confusingly similar protocols, you would only have
> one class. One is less than two. Moreover, there are no differences to
> remember when there is only one. Also, instead of having to repeatedly
> do an "easy" switch, there would be no switch to do. Nothing is easier
> than something.
>
> In short, the library would be simpler after this change.
>

My understanding of this whole thread is that with respect to security
issues there is a big difference between passing mutable vs immutable
containers. While E's special strength is its handling of security issues,
there are other considerations when chosing between mutable and immutable
containers. Perhaps one is writing code for a part of a system that will
operate locally within a single vat. Depending upon the degree and kind of
sharing and the expected usage patterns, you might make your choice about
mutability. For some kinds of uses of containers the choice might be based
solely on performance issues. Wouldn't such a programmer want to be able to
switch easily between 2 kinds of objects that have very similar behaviors?

> I'm surprised to hear this argument from you since I understood from
> Markm that you were the first to think of the backward diff technique
> for implementing immutable hashtables. Are you making this argument
> based on experience you gained while working with immutable
> hashtables? If so, please elaborate.
>

I did that work in the context of Prolog where mutable containers fit poorly
into the computation model. So immutable hashtables and arrays were
introduced into LM-Prolog to give Prolog most of the benefits of mutable
containers without the semantic problems. As I recall our experiences (this
was circa 1983), immutable containers worked well with a small overhead over
dirtier alternatives. And occasionally they led to some very nice uses when
the history of updates branched. But I wouldn't say they dominated mutable
containers in all cases.

Best,

-ken