[Grace-core] Multiple inheritance & module inheritance

Kim Bruce kim at cs.pomona.edu
Mon Mar 16 14:36:51 PDT 2015


My book refers to these things as ClassType’s and they behave very different from object types (as you observe).  I’ve been working to try to avoid writing down the ClassTypes as programmers will hate writing them down.  The whole idea of statically determinable types (at least in my mind) was to have a system so transparent that the ClassTypes could easily be inferred by the system.

Perhaps I should return to that (provably type-safe) system and start over.  My impression (and correct me if I am wrong) is that those interested in the dynamic language want things to be much more flexible than are compatible with a static type system, even one with type Dynamic.

I’m getting the sense that the simplicity is obtained by either dropping almost all restrictions or by going completely statically typed, while intermediate positions (e.g., banning overloading) make things more difficult.

Kim



> On Mar 16, 2015, at 2:06 PM, Andrew P Black <andrew.p.black at gmail.com> wrote:
> 
> Kim,
> 
> What you are observing is that just because module m is correct, and can be proved so by a fairly simple type system, does not mean that every possible module m' that inherits from m and overrides arbitrary parts of m is also correct and type-safe.  
> 
> If you want to do static checks for this, it's always seemed to me that m needs two quite different types.  The first is the user's type, or the interface type, which provides information about the external interface of m — which is what existing Grace types do.
> 
> The second is the heir's type, which provides information about the internal structure of m.  In your example, it provides the information that a.new -> Alpha and Alpha <: type {x -> Number} (which is in the confidential interface type), but also that b.new uses a internally, with that type. 
> 
> Figuring out what's in an heirs type seems like a good thesis project.
> 
> 	Andrew
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20150316/7b89d41f/attachment.html>


More information about the Grace-core mailing list