I've raised this before, and it was controversial for a lot of good reasons. At a pragmatic level, I think BitC needs a single inheritance mechanism in order to inter-operate with other languages. Inheritance is not ideal for a lot of reasons, but inter-operation is imperative in a successful language. That's a necessary and sufficient reason to incorporate it.
Yes, subtyping in the presence of polymorphism introduces inference problems. But that depends on what you infer. It is not clear (to me) that any attempt at non-local principal type inference in the presence of subtypes should occur at all. There are reasons to allow subclass types to be defined and [explicitly] used; it does not necessarily follow that their use should be inferred. In particular, it rarely seems to be true that any non-local inference involving subtypes is a most general typing. When I set aside compatibility issues, my main interest in subclasses has to do with the ability to define objects. I have used the BTree 'a example in a recent email. The problem with BTree 'a is that *object* methods want to be associated with this type. More precisely: we want the names of these methods to be scoped by the type in much the way that structure field names are scoped by the structure instance. This is little more than a matter of lexical cleanliness. You can't actually define a BTree type in Haskell. You can define a bunch of procedures in a module that collectively serve to * implement* a BTree, but you can't get them bound together in a way that minimizes namespace pollution. That seems wrong to me. Unfortunately, yes, there are also cases where I want to *extend* objects. And therein lies the start of the subtyping/inference mess. Unfortunately, we're not going to get away without solving this. Can the people on this list who keep up with such things send out your notions of the top 3 papers on this subject that you think I need to read? Thanks Jonathan
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
