Re: [friam] Classification of actor languages

"Mark S. Miller" <[email protected]> Mon, 16 Feb 2015 12:37:54 -0800
Newsgroups gmane.comp.lang.e.general
Message-ID <CABHxS9hdC-Tz2DaMD2y9ADdhHvS1+Yx+mHLLgj7AtqptW_hH4g@mail.gmail.com>
--===============1887011032353925544==
Content-Type: multipart/alternative; boundary=001a1134a90e881cce050f3a8f19

--001a1134a90e881cce050f3a8f19
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

My favorite time example. If Bob is given only the upCounter and Carol is
given only the downCounter, then Bob can only increment and see the result,
and Carol can only decrement and see the result.

For the same thing in Dr.SES, see also slides 14 and 31 of <
http://soft.vub.ac.be/events/mobicrant_talks/talk2_OO_security.pdf>.



def makeCounterPair() {
    var count :=3D 0
    def upCounter {
        to incr() { return count +=3D 1 }
    }
    def downCounter {
        to decr() { return count -=3D 1 }
    }
    return [upCounter, downCounter]
}

? def [u, d] :=3D makeCounterPair()
# value: [<upCounter>, <downCounter>]

? u.incr()
# value: 1

? u.incr()
# value: 2

? d.incr()
# problem: <NoSuchMethodException: <a downCounter>.incr/0>

? d.decr()
# value: 1

Figure 6.5: Two Counting Facets Sharing a Slot. makeCounterPair makes a
Slot, and it makes and returns two objects sharing access to that Slot.
These three objects form a lexical composite. The returned objects are
facets of this composite. The Slot is encapsulated within this composite.






On Mon, Feb 16, 2015 at 12:23 PM, Tom Van Cutsem <[email protected]> wrote=
:

> Hi Carl,
>
> 2015-02-14 1:19 GMT+01:00 Carl Hewitt <[email protected]>:
>
>>  Of course, an Actor can implement multiple interfaces.
>>
>>
>>
>> I am wondering how a =E2=80=9Cfacet=E2=80=9D relates to an interface.
>>
>
> Indeed, an actor can implement multiple interfaces, but this typically
> means that anyone having a reference to the actor can send any message fr=
om
> the union of all interface methods. By contrast, in a vat with multiple
> facets, a reference to a facet provides access to only the methods expose=
d
> by that facet. Thus, facets make it easier to restrict authority.
>
> Of course, one could encode facets in a pure actor model, by passing a
> token designating the facet as part of the message. The actor can be
> programmed to dispatch the message to an internal object only if the toke=
n
> matches. But this would be an encoding of the vat model in a pure actor
> model.
>
> Cheers,
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "friam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to friam+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
> To post to this group, send email to friam-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
> Visit this group at http://groups.google.com/group/friam.
> For more options, visit https://groups.google.com/d/optout.
>



--=20
    Cheers,
    --MarkM

--001a1134a90e881cce050f3a8f19
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>My favorite time example. If Bob is given only the up=
Counter and Carol is given only the downCounter, then Bob can only incremen=
t and see the result, and Carol can only decrement and see the result.</div=
><div><br></div><div>For the same thing in Dr.SES, see also slides 14 and 3=
1 of &lt;<a href=3D"http://soft.vub.ac.be/events/mobicrant_talks/talk2_OO_s=
ecurity.pdf">http://soft.vub.ac.be/events/mobicrant_talks/talk2_OO_security=
.pdf</a>&gt;.</div><div><br></div><div><br></div><div><br></div>
	=09
=09
=09
		def makeCounterPair() {<div>=C2=A0 =C2=A0 var count :=3D 0<div>=C2=A0 =C2=
=A0 def upCounter {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 to incr() { return count=
 +=3D 1 }<br>=C2=A0 =C2=A0 }</div><div>=C2=A0 =C2=A0 def downCounter {<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 to decr() { return count -=3D 1 }<br>=C2=A0 =C2=
=A0 }</div><div>=C2=A0 =C2=A0 return [upCounter, downCounter]</div><div>}<b=
r></div><div><br>? def [u, d] :=3D makeCounterPair()<br># value: [&lt;upCou=
nter&gt;, &lt;downCounter&gt;]<br><br>? u.incr()<br># value: 1<br><br>? u.i=
ncr()<br># value: 2<br><br>? d.incr()<br># problem: &lt;NoSuchMethodExcepti=
on: &lt;a downCounter&gt;.incr/0&gt;<br><br>? d.decr()<br># value: 1<br><br=
>Figure 6.5: Two Counting Facets Sharing a Slot. makeCounterPair makes a Sl=
ot, and it makes and returns two objects sharing access to that Slot. These=
 three objects form a lexical composite. The returned objects are facets of=
 this composite. The Slot is encapsulated within this composite.<br><br><br=
><br><br>=C2=A0</div></div></div><div class=3D"gmail_extra"><br><div class=
=3D"gmail_quote">On Mon, Feb 16, 2015 at 12:23 PM, Tom Van Cutsem <span dir=
=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">tomvc.=
[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div d=
ir=3D"ltr">Hi Carl,<br><div class=3D"gmail_extra"><br><div class=3D"gmail_q=
uote"><span class=3D"">2015-02-14 1:19 GMT+01:00 Carl Hewitt <span dir=3D"l=
tr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">hewitt@irob=
ust.org</a>&gt;</span>:<br><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







<div lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div>
<p class=3D"MsoNormal"><span style=3D"color:rgb(31,73,125);font-family:Cali=
bri,sans-serif;font-size:11pt">Of course, an Actor can implement multiple i=
nterfaces.</span><br></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Ca=
libri&quot;,sans-serif;color:#1f497d"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;font-family:&quot;Ca=
libri&quot;,sans-serif;color:#1f497d">I am wondering how a =E2=80=9Cfacet=
=E2=80=9D relates to an interface.</span></p></div></div></blockquote><div>=
<br></div></span><div>Indeed, an actor can implement multiple interfaces, b=
ut this typically means that anyone having a reference to the actor can sen=
d any message from the union of all interface methods. By contrast, in a va=
t with multiple facets, a reference to a facet provides access to only the =
methods exposed by that facet. Thus, facets make it easier to restrict auth=
ority.</div><div><br></div><div>Of course, one could encode facets in a pur=
e actor model, by passing a token designating the facet as part of the mess=
age. The actor can be programmed to dispatch the message to an internal obj=
ect only if the token matches. But this would be an encoding of the vat mod=
el in a pure actor model.</div><div><br></div><div>Cheers,</div><div>Tom</d=
iv></div></div></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;friam&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:friam+unsubscribe-/[email protected]" target=3D"_bl=
ank">friam+unsubscribe-/[email protected]</a>.<br>
To post to this group, send email to <a href=3D"mailto:[email protected]=
om" target=3D"_blank">friam-/[email protected]</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/group/friam" target=
=3D"_blank">http://groups.google.com/group/friam</a>.<br>
For more options, visit <a href=3D"https://groups.google.com/d/optout" targ=
et=3D"_blank">https://groups.google.com/d/optout</a>.<br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=
<div class=3D"gmail_signature">=C2=A0 =C2=A0 Cheers,<br>=C2=A0 =C2=A0 --Mar=
kM</div>
</div>

--001a1134a90e881cce050f3a8f19--

--===============1887011032353925544==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
e-lang mailing list
[email protected]
http://www.eros-os.org/mailman/listinfo/e-lang

--===============1887011032353925544==--