http://wiki.erights.org/mediawiki/index.php?title=User:Kevin_Reid/Thoughts_on_protocol_queries&feed=atom&action=historyUser:Kevin Reid/Thoughts on protocol queries - Revision history2024-03-19T09:55:05ZRevision history for this page on the wikiMediaWiki 1.15.5-7http://wiki.erights.org/mediawiki/index.php?title=User:Kevin_Reid/Thoughts_on_protocol_queries&diff=2057&oldid=prevKevin Reid: Reverted edits by 24.123.189.2 (Talk); changed back to last version by Kevin Reid2011-04-21T14:01:50Z<p>Reverted edits by <a href="/wiki/Special:Contributions/24.123.189.2" title="Special:Contributions/24.123.189.2">24.123.189.2</a> (<a href="/mediawiki/index.php?title=User_talk:24.123.189.2&action=edit&redlink=1" class="new" title="User talk:24.123.189.2 (page does not exist)">Talk</a>); changed back to last version by <a href="/wiki/User:Kevin_Reid" title="User:Kevin Reid">Kevin Reid</a></p>
<p><b>New page</b></p><div>:''This text has not been updated other than wikification and some quick notes since September 5, 2005. I make no guarantee that it reflects my current opinion on E's direction. —[[User:Kevin Reid|Kevin Reid]] 09:12, 6 May 2010 (CDT)''<br />
<br />
{{XXX|Turn this into a design issue page.}}<br />
<br />
=Thoughts on extending protocols=<br />
<br />
==Scenario==<br />
<br />
Two [[CapTP]] peers talking. Let's handwave that the Miranda-method protocol is well-known and adequate. a sends <code>b &lt;- __getAllegedType()</code>.<br />
<br />
b has Interesting Features that it wishes to express in its type object. How does b (or b's implementation language) extend the TypeDesc protocol in a way that will not potentially create confusion due to accidental overlap of method names with other extensions?<br />
<br />
<br />
==Idea==<br />
<br />
Have a common way of querying an object "Do you implement the protocol X", where X is a string(?) identifying the protocol. This does not {{XXX|proper security term}}, as the string is deliberately public, and is intended to be common knowledge. It is as "alleged" as the alleged type itself.<br />
<br />
<br />
===Proposal #1===<br />
<br />
Make [[PassByCopy]] ProtocolGuards. Their coercion behavior is to call/send __conformTo. An object may indicate support of a protocol (the protocol being discovered by extracting the public state of the PBC'd guard) by returning [self] (since __conformTo returns self by default).<br />
<br />
(Alternate: use __optSealedDispatch and don't require tupling.)<br />
<br />
<br />
===Proposal #2===<br />
<br />
Again have [[PassByCopy]] guards, but stuff them in the supers field of the alleged type of the object in question (which in the scenario above is itself an alleged type!).<br />
<br />
Advantages of this over #1: no slightly-funny business with __conformTo returning not-quite-self. Supers is a reasonably natural place to put this, as the ProtocolGuards do indeed designate supertypes.<br />
<br />
Disadvantages: The type desc may be more expensive to retrieve across a network. Current E semantics makes it very hard to extend alleged types. (perhaps meta.context().getAllegedType()?) No built-into-the-query support for coercion to protocols.<br />
<br />
:''Later note: If the [[Signature]] plan goes into effect, supers may not exist or may not have the same meaning or lack thereof as it does now. —[[User:Kevin Reid|Kevin Reid]] 09:12, 6 May 2010 (CDT)''<br />
<br />
==Potential formats of protocol names==<br />
<br />
DNS names org.erights.e.elib.slot.Slot<br />
<br />
Relies on the DNS system's stability - global namespaceish.<br />
<br />
URIs http://www.erights.org/elib#slot.Slot<br />
<br />
Easier to create URIs than DNS names. Still relies on DNS.<br />
:''Later note: The tag: URI scheme allows dating a DNS usage. Thus it relies only on agreement on a calendar. —[[User:Kevin Reid|Kevin Reid]] 09:12, 6 May 2010 (CDT)''<br />
<br />
One of the above combined with a GUID/[[SwissNumber]]<br />
<br />
org.erights.elib.slot.Slot!09l64YiaLKTgV7Drnu_8QeQpYm9T<br />
<br />
The advantage of this over the above is that the random component makes it unlikely to collide with other protocol names, even if, e.g., DNS names change hands. For normal use, the first part of the name should be adequate to provide human-readable identification, and in the event of a first-part-collision it is highly likely that the random characters will be different at the left end.<br />
<br />
:''Later note: This style of naming corresponds to a concept I'm calling “[[Token]]” these days — an PassByCopy object which has a static random component and a human-readable component, and prints only as the human-readable component — they would be used for all 'enumeration type' purposes. —[[User:Kevin Reid|Kevin Reid]] 09:12, 6 May 2010 (CDT)''<br />
<br />
Of course, no matter what the name scheme, it is trivial to deliberately create a "collision", but this does not matter as it is always an ''alleged'' type and the object can misbehave any way it likes no matter what protocols it claims to support.<br />
<br />
<br />
==Not addressed==<br />
<br />
Means of finding authoritative documentation of a protocol.</div>Kevin Reidhttp://wiki.erights.org/mediawiki/index.php?title=User:Kevin_Reid/Thoughts_on_protocol_queries&diff=4344&oldid=prev24.123.189.2: /* Idea */2011-04-20T03:22:13Z<p><span class="autocomment">Idea</span></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 03:22, 20 April 2011</td>
</tr>
<tr><td colspan="2" class="diff-lineno">Line 12:</td>
<td colspan="2" class="diff-lineno">Line 12:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">==Idea==</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">ihefDN Hey</ins>, <ins class="diffchange diffchange-inline">that</ins>'<ins class="diffchange diffchange-inline">s </ins>the <ins class="diffchange diffchange-inline">geartest</ins>! <ins class="diffchange diffchange-inline">So </ins>with <ins class="diffchange diffchange-inline">ll </ins>this <ins class="diffchange diffchange-inline">brain power AWHFY</ins>?</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Have a common way of querying an object "Do you implement the protocol X"</del>, <del class="diffchange diffchange-inline">where X is a string(?) identifying the protocol. This does not {{XXX|proper security term}}, as the string is deliberately public, and is intended to be common knowledge. It is as "alleged" as the alleged type itself.</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">===Proposal #1===</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Make [[PassByCopy]] ProtocolGuards. Their coercion behavior is to call/send __conformTo. An object may indicate support of a protocol (the protocol being discovered by extracting the public state of the PBC</del>'<del class="diffchange diffchange-inline">d guard) by returning [self] (since __conformTo returns self by default).</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">(Alternate: use __optSealedDispatch and don't require tupling.)</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">===Proposal #2===</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Again have [[PassByCopy]] guards, but stuff them in </del>the <del class="diffchange diffchange-inline">supers field of the alleged type of the object in question (which in the scenario above is itself an alleged type</del>!<del class="diffchange diffchange-inline">).</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Advantages of this over #1: no slightly-funny business </del>with <del class="diffchange diffchange-inline">__conformTo returning not-quite-self. Supers is a reasonably natural place to put </del>this<del class="diffchange diffchange-inline">, as the ProtocolGuards do indeed designate supertypes.</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Disadvantages: The type desc may be more expensive to retrieve across a network. Current E semantics makes it very hard to extend alleged types. (perhaps meta.context().getAllegedType()</del>?<del class="diffchange diffchange-inline">) No built-into-the-query support for coercion to protocols.</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">:''Later note: If the [[Signature]] plan goes into effect, supers may not exist or may not have the same meaning or lack thereof as it does now. —[[User:Kevin Reid|Kevin Reid]] 09:12, 6 May 2010 (CDT)''</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Potential formats of protocol names==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>==Potential formats of protocol names==</div></td></tr>
<!-- diff generator: internal 2024-03-19 09:55:06 -->
</table>24.123.189.2http://wiki.erights.org/mediawiki/index.php?title=User:Kevin_Reid/Thoughts_on_protocol_queries&diff=4343&oldid=prevKevin Reid: uploading old content from September 5, 20052010-05-06T14:12:50Z<p>uploading old content from September 5, 2005</p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 14:12, 6 May 2010</td>
</tr>
<!-- diff generator: internal 2024-03-19 09:55:06 -->
</table>Kevin Reid