[M3devel] blue sky proposal :)
Henning Thielemann
lemming at henning-thielemann.de
Sat Mar 22 23:12:17 CET 2008
On Sat, 22 Mar 2008, Tony Hosking wrote:
> Messing with VM protection mechanisms *will* impact performance, both to set
> things up and to maintain. For example, the GC needs to write to those pages
> as it operates, so you are going to put extra work on the GC. Yuck!
>
> Here is the germ of an alternative idea -- let add a READONLY declaration,
> with enforcement by the compiler. Should READONLY be a property of types?
> i.e.,
>
> READONLY RECORD f: T; g: T; END (* records of this type can never be
> modified (i.e., f, g can only be initialized in a constructor) *)
>
> Or should READONLY be a property of designators? i.e.,
>
> RECORD READONLY f: T; g: T END (* READONLY fields can never be modified
> (i.e., f cannot be modified, but g can be modified) *)
>
> This needs fleshing out. For example, if READONLY attaches to types, then
> what are the assignment rules for non-readonly and readonly? More
> complicated still, what are the subtype rules?
Similar things are discussed in "Systems programming with Modula-3" by
Greg Nelson et.al., aren't they?
More information about the M3devel
mailing list