safety model in D

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Nov 4 08:45:54 PST 2009


Leandro Lucarella wrote:
> Andrei Alexandrescu, el  3 de noviembre a las 17:54 me escribiste:
>> 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 guess this is a joke, but I have to ask: why? I'm not sure about plenty
> of stuff, that doesn't mean they are pointless.

Oh, I see what you mean. The problem is that many are as unsure as you 
are about what the default should be. If too many are unsure, maybe the 
decision should be left as a choice.

>> 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.
> 
> I can't understand how you can't care. Maybe I'm misunderstanding the
> proposal, since nobody else seems to see a problem here.

It's not a proposal as much as a discussion opener, but my suggestion is
that if you just say module without any qualification, you leave it to
the person compiling to choose the safety level.


Andrei



More information about the Digitalmars-d mailing list