As part of the private conversation, Ben and I were pushing to see how far we can get *without* putting inheritance into the language. We were hopeful that interfaces would subsume inheritance. Here's where I am on this at this point.
I reviewed the use of *ad hoc* subtyping in the Coyotos kernel. There actually *are* a few places where *ad hoc *subtyping is being used, but they fall into two cases: 1. Heterogeneous lists that are threaded through the objects. This is mainly for things like ageing lists. Note that while we *don't* have a closed union in this situation, we *could*. 2. Cases where a generic object pointer is downcast. So far as I can determine, every single one of these is accompanied by a type tag. For example, we know that the object reference in a Page capability names a Page data structure, and we know it is a Page capability because its type tag says so. This might not even require dependent type - the defrepr intuitions are probably good enough. I am inclined to think that if we actually have it down to these two cases, we should maybe push harder to see if we can get the use of subtyping fully removed. The second case can clearly go. The first case is harder. In most codes, case [1] could be handled, because the objects would be reference types. When that is the case, we can stick interfaces to those objects in the actual queue [*] and let the interface implement checked downcast as part of its signature. [*] Though this raises an interesting question about interfaces as objects that I will bring up separately. What I'm inclined to do at the moment is proceed as follows: 1. Reserve syntax for subtyping, both for type definition and type specification so that we can add it compatibly later 2. Do not otherwise implement support for subtyping at this time, focusing instead on dependent types. Then I want to see what we have left that we still can't express in the Coyotos kernel, and see what (if anything) we want to do about that. shap
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
