[e-lang] Bindings and guard-based auditing

Thomas Leonard tal at it-innovation.soton.ac.uk
Tue May 25 04:18:24 PDT 2010


On Mon, 2010-05-24 at 09:50 -0400, Kevin Reid wrote:
[...]
> > OK, so the problem is:
> >
> > - we want to know the guard (reliably)
> > - we want to allow custom slots
> > - we don't trust custom slots to enforce their claimed guard
> >
> > Perhaps we could wrap wacky slots in a known wrapper? e.g.
> >
> > def &myVar := makeGuardedSlot(myWackySlot)
> >
> > Where makeGuardedSlot would call myWackySlot.getGuard and store a copy
> > of the guard. GuardedSlot would check the value against the guard  
> > every
> > time you called get().
> >
> > An auditor could see that the slot was a GuardedSlot, and thus trust  
> > it
> > to ensure the values it returned always conformed to the guard. But  
> > for
> > the common case (FinalSlot) it would work fine anyway without  
> > wrapping.
> 
> It's not that 'we want to know the guard': it's that we want to know  
> an arbitrary amount of information about the slot. The binding-based  
> system allows that to be done -- it makes no assumptions about, for  
> example, whether the auditor cares about whether the slot is mutable.  
> There is no fixed list of approved slot types (in your proposal,  
> FinalSlot and GuardedSlot) which auditors get information about.

Ah, I hadn't spotted that the binding is vouching for the slot itself
(not just the values it returns).

Still, I don't see the advantage. The information we may want the
auditor to see for any name includes:

- the slot's auditors (e.g. "this is a FinalSlot")
- the slot's guard (e.g. "the value is always DeepFrozen")
- the slot's value (e.g. "true")
- other selected properties of the slot

How does a piece of code say what the auditor is allowed to see?

If I say:

def x := 3
def &y := makeWackySlot(4)

def obj implements Auditor {
  to getValue() { return x + y }
}

what can Auditor see by default? How do I control this?


-- 
Dr Thomas Leonard
IT Innovation Centre
2 Venture Road
Southampton
Hampshire SO16 7NP

Tel: +44 0 23 8076 0834
Fax: +44 0 23 8076 0833
mailto:tal at it-innovation.soton.ac.uk
http://www.it-innovation.soton.ac.uk 



More information about the e-lang mailing list