Open kjx opened 8 years ago
are there two separate issues there:
Uncooked is horrible. Please, raw to mean "uninitialised" not at least "execution of bottom-most object constructor has not completed normally".
I think I meant to make this about incomplete.
We could e.g. stop people instantiating traits directly (somehow).
myTrait
would be a dynamic error. The incompleteness tagging would ensure myTrait had a type that meant something horrid. But of course
object {
uses myTrait
}
would still be OK, however the incompleteness analysis should spot that the trait was missing methods and so at least wouldn't give this object a type it considered complete?
There is no issue of traits being cooked or uncooked — by design, they require no initialization. I suggest that @kjx remove all mention of cooking from the above comments.
Yes, I think that it's quite feasible to track whether or not a trait is complete, and if not, what its open requirements are. The Smalltalk traits browser did this in real time in 2002. That (the real-time update) was a bit tricky, inspiring many of the patterns in "A Pattern Language for Extensible Program Representation". But doing it in a compiler should be pretty simple.
Long term, I would like a Grace IDE to do this tracking.
how can we statically track that a trait is a trait and not a cooked object?
this must be related to type system for ensuring completely initialisation, but is an easier bit I think!