safety model in D

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Nov 3 15:54:27 PST 2009


Leandro Lucarella wrote:
> Andrei Alexandrescu, el  3 de noviembre a las 16:33 me escribiste:
>> SafeD is, unfortunately, not finished at the moment. I want to leave
>> in place a stub that won't lock our options. Here's what we
>> currently have:
>>
>> module(system) calvin;
>>
>> This means calvin can do unsafe things.
>>
>> module(safe) susie;
>>
>> This means susie commits to extra checks and therefore only a subset of D.
>>
>> module hobbes;
>>
>> This means hobbes abides to whatever the default safety setting is.
>>
>> The default safety setting is up to the compiler. In dmd by default
>> it is "system", and can be overridden with "-safe".
> 
> What's the rationale for letting the compiler decide? I can't see nothing
> but trouble about this. A module will tipically be writen to be safe or
> system, I think the default should be defined (I'm not sure what the
> default should be though).

The parenthesis pretty much destroys your point :o).

I don't think letting the implementation decide is a faulty model. If 
you know what you want, you say it. Otherwise it means you don't care.


Andrei



More information about the Digitalmars-d mailing list