[Grace-core] Type declarations

James Noble kjx at ecs.vuw.ac.nz
Thu Mar 20 18:23:02 PDT 2014


> I don't understand this.  If there is no structural type information in a branded type, how can you check that I'm telling the truth when I claim that an object has a branded type?  Presumably, you want to make sure that the interfaces AND the brands match when checking a branded type.

right. so you do that by defining a type that has both a brand and structural content.
the brand itself doesn't have any structural content

in a sense, that's the point of the paper we're working on without you - 
if you've already got a structural system, just add brands and you're done:
you don't have to build a full nominal system alongside (like Unity)
and the resulting system is smaller & simpler than starting with a nominal system and adding structural types  (Whiteoak, Scala)

> My suggestion for the declaration keyword would be "const" or "manifest", in the sense of compile-time constant, used just like we use def right now.   The right-hand–side of a const or manifest declaration must be compile-time evaluable.  Interfaces are one example of that; your pattern types are another, if I understand correctly.

that way lies Dart...

> That said, I LIKE using type to mean set of methods and with their types.  I believe that it's what type OUGHT to mean, in an OO language.  But the "type theorists" don't agree ...

and that's what it means in Grace, and will continue to mean in Grace. 

J


More information about the Grace-core mailing list