Re: Coercion, membranes, serialization, and printing are the same thing

Tom Van Cutsem <[email protected]> Mon, 28 Oct 2013 16:17:58 -0400
Newsgroups gmane.comp.lang.e.general
Message-ID <CAKDfNj_M8E8dy-G1fRnOn7yPOLDeQ87r14SCY=4GgK5m97ap7A@mail.gmail.com>
Hi James,

2013/10/19 James Noble <[email protected]>
>
> there's an older paper on dynamic ownership here -
> http://dl.acm.org/citation.cfm?id=1297090 & attached.
>

Thanks for the reference. I was aware of this work, it's also cited by
Wernli's DLS2012 paper.

One thing that's still different from a membrane-based approach to
implementing ownership, is that your work on dynamic ownership (and also
Wernli's work on Filters), augments objects with explicit ownership
pointers, and adds runtime checks on all method calls to verify ownership.

What I'm considering with membranes is to define ownership *implicitly*:
all objects wrapped by the same membrane would be considered "owned" by the
same owner. Then, instead of intercepting all method calls to perform
runtime ownership checks, only the proxies at the boundary of the membrane
would perform the ownership checks.

Now, this approach is really only viable in an ocap language, because
membranes can easily be circumvented when there is global shared mutable
state.

I've implemented a first prototype of membrane-based ownership in
JavaScript (extensive README available here <
https://github.com/tvcutsem/harmony-reflect/tree/master/examples/ownership>).
It's based on Wernli's ideas of filters, but implemented using membranes
and proxies rather than by augmenting objects with ownership pointers (the
latter would require either changing the VM or doing a full
source-to-source translation).


> I think the question of where & how ownership ("property rights") should
> be enforced is an interesting one.
> Patterns like being careful about private or protected names can give
> effect to ownership in Java;
> in Javascript, nested lambda scopes can protect names --- but you'll need
> another (static?) analysis
> to ensure that objects that are intended to be confined are not leaked out.
> (see eg. here: http://dx.doi.org/10.1145/949343.949339,
> http://www.cs.tau.ac.il/~msagiv/courses/encapsulate/p82-vitek.pdf)
>
> But in terms of capturing programmer's intention ---- audibility ---
> being able to say "this engine is mine", and being sure that gives rise to
> some dependable semantics, is going to be safer than depending on rather
> fiddly programming patterns.
>

Agreed!

Even with support for ownership (static or dynamic), there is still a
danger that the programmer forgets to express the right ownership
boundaries, but at least having a language abstraction to express the
ownership boundaries is a step in the right direction.

Regards,
Tom

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