On 9 March 2010 22:25, Jonathan S. Shapiro <[email protected]> wrote: > BitC 0.10 suffers some confusion about the term "const". For reference > types, it fails to distinguish between a constant field containing a > reference and a reference to constant data. This is a fairly minor > annoyance, but one that we need to clean up. > > For our notion of "const", BitC 0.10 chose to implement a notion of > immutability rather than a notion of read-only references. I continue to > believe that deep immutability is a good notion, but I think we neglected > something important from the standpoint of interoperability: const-by-alias > is a crucial part of the type systems of languages that we need to call, so > we need the ability to express this notion in our type system. From a typing > perspective, doing "deep read-only" and "shallow read-only" references isn't > that big a leap. > > So here are the questions: > > Should we retain the notion of deep immutability? Is there a use-case?
I would pose the question differently: is there a use case for shallow read-only.? For me the answer is: 90+ % of the use cases are data which do not contain references for which deep read-only is the same as shallow read-only. IMHO shallow read-only is not of much use when it differs from deep read-only and is only an artifact of the limitations of the respective runtimes which cannot uphold stronger properties. Having a description of the limitations of used runtime might be still useful, though. Thanks Michal _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
