[e-lang] anyone ever look at refactoring code to use object-capabilities?

Sandro Magi smagi at higherlogics.com
Wed May 23 22:44:03 EDT 2007


Brett Cannon wrote:
> 
> 
> On 5/23/07, *Sandro Magi* <smagi at higherlogics.com
> <mailto:smagi at higherlogics.com>> wrote:
> 
>     Plash [1] is the closest effort that comes to mind.
> 
> Thanks for the link.  Since it works outside a program and is not
> language-level it doesn't seem to squash my idea at first glance.


See also Emily:
http://www.hpl.hp.com/techreports/2006/HPL-2006-116.pdf
http://www.skyhunter.com/marcs/emilyWalnut.html

Essentially taming OCaml to be capability secure. It's not an automated
translation, but it gives an idea how much work may be involved.

>     In order to integrate private namespaces with legacy code in a more
>     fine-grained fashion and without altering said code, you could introduce
>     lightweight language processes which encapsulates a namespace. I'm sure
>     there are other approaches, but I have processes on the brain. :-) 
> 
> 
> =)  I am thinking more along the lines of possible syntactic refactoring
> so I am willing to change the code.  Python has a syntax refactoring
> tool being used to transition from Python 2.6 to Python 3.0 which keeps
> all unaffected code (including comments) as-is.  So doing a
> syntax-to-syntax translation is fine and what I was thinking of (this is
> an idea that was hatched today during a one hour meeting so the stupid
> parts of it have yet to surface).

As has been mentioned here before (or perhaps on cap-talk), it's
possible to automatically translate any ambient authority program into
one with explicit authority passing (ie. capabilities). However, many
functions would then have monstrous parameter lists.

An automated syntactic translator that could then analyze and
restructure this bloated call graph and reduce the parameter lists to
the least authority would be very interesting, but seems quite
challenging. You might be able to achieve an interesting approximation
to POLA though.

Sandro


More information about the e-lang mailing list