Re: Coercion, membranes, serialization, and printing are the same thing
James Noble <[email protected]> Tue, 29 Oct 2013 09:56:18 +1300
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
> Thanks for the reference. I was aware of this work, it's also cited by Wernli's DLS2012 paper. argh sorry for the gratuitous citation trolling... > 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. right. And I still think that's a good conceptual model > 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. Yes. Or rather, it's not really implicit ownership (because putting objects inside a membrane is explicit in program code) --- but it's doing that without language / VM level support. > Now, this approach is really only viable in an ocap language, because membranes can easily be circumvented when there is global shared mutable state. of course... > 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 oh that is cool! > rather than by augmenting objects with ownership pointers (the latter would require either changing the VM or doing a full source-to-source translation). right. Donald Gordon hacked the Bean Shell implementation, and many moons ago I did something reflexive in Self... > 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. right. And that's the distinction I'd make between implicit and explicit: explicit says "this stuff belongs behind a boundary" in some way in code; implicit says it in comments, and is just (hopefully) careful not to let things leak. James