3 ms·
Well... Kenton, now you've now got my brain stirring on whether or not the perceived complexity & opacity of ocap is an artifact of how tightly it has bound its
by im_down_w_otp 9y ago
Well... Kenton, now you've now got my brain stirring on whether or not the perceived complexity & opacity of ocap is an artifact of how tightly it has bound itself to the concepts of OOP (as something of a personal character flaw I find OOP to be fairly obfuscating beyond trivial domains for whatever reason), and whether or not FP concepts applied to a similar domain as ocap might provide me with clarity in security design/implementation the same way FP gave me clarity in program design/implementation eventually.
None of which I really have excess time to noodle about, but is now unavoidable. Thank you, sir.
- abecedarius 9y agoYou might find http://www.erights.org/elib/capability/ode/index.html http://www.erights.org/elib/capability/ode/index.html stimulating if you haven't seen it before. It showed me that OO could be more elegant than I'd thought.
- kentonv 9y agoYes! Too many people think OOP means deep class heirarchies, implementation inheritance, AbstractSingletonProxyFactoryBean, and other things you might see in Java. I think this turns a lot of people off. Good OOP is none of that. It's simply associating data with code that operates on it, in order to get two good things: abstraction and encapsulation. Abstraction is by defining virtual tables, encapsulation is by hiding implementation details as private members. Object-capability discipline leverages encapsulation as a security primitive (you can only perform the operations allowed by the public interface), and leverages abstraction to implement attenuation via wrappers (e.g. a wrapper that blocks certain methods, or a wrapper that can be revoked later). It has zero use for class hierarchies with implementation inheritance. So yeah, I think studying ocaps does help one understand how to do OOP right. And yeah, I think learning FP can indeed help you gain clarity over a different aspect of programming -- something basic about organizing computation and data structures, which complements OOP and ocaps. (I seem to be one of few people that don't see any inherent conflict between OOP and FP... they are orthogonal and can be used together.)
- kybernetikos 9y ago> I seem to be one of few people that don't see any inherent conflict between OOP and FP It really depends on which aspects you see as essential to the paradigms. If you define functional programming as programming that makes use of HOFs, or that encourages referential transparency, then you can combine those learnings with OOP nicely. It's also possible to characterise them as in opposition. For example, you say > Good OOP is none of that. It's simply associating data with code that operates on it If I wanted to characterise FP in opposition to that, I would say that Good FP is keeping the state (i.e. the data) dissociated from the code in order to gain the benefits of referential transparency, composability, reusability and abstraction (attaching code to state massively reduces your ability to abstract). FP tends to encourage the reuse of generic datastructures and vocabularies much more, while OOP likes to encourage you to create your own datatypes with their own vocabularies. Personally these days I like coding in an OO style with lots of learnings taken from FP, but the worldview that sees these as different poles on a continuum is not difficult for me to appreciate.
- charlysl 9y agoHere it is described from a FP perspective: https://books.google.com.vn/books?id=_bmyEnUnfTsC&lpg=PA56&pg=PA208#v=onepage&q&f=false https://books.google.com.vn/books?id=_bmyEnUnfTsC&lpg=PA56&p...