safety model in D

Bill Baxter wbaxter at gmail.com
Tue Nov 3 16:00:42 PST 2009


On Tue, Nov 3, 2009 at 3:54 PM, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> 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.

How can you not care?  Either your module uses unsafe features or it
doesn't.  So it seems if you don't specify, then your module must pass
the strictest checks, because otherwise it's not a "don't care"
situation -- it's a "system"-only situation.

--bb



More information about the Digitalmars-d mailing list