Reddit: SafeD - The Safe Subset of D

Walter Bright newshound1 at digitalmars.com
Mon Mar 24 18:53:13 PDT 2008


Georg Wrede wrote:
> Walter Bright wrote:
>> Julio César Carrascal Urquijo wrote:
>>
>>> How will one assert that a library function is certified for usage in 
>>> SafeD even if it uses unsafe constructs? New keywords?
>>
>> There'll have to be some syntax for that.
> 
> I hope you mean that once such a library function is Certified, it gets 
> some kind of [at least compiler readable] property stating that it is 
> SafeD compliant?

Yes.

> As to the matter of certifying the function, in trivial cases the 
> compiler could do it.

There's no reason to syntactically mark a function as safe if the 
compiler can verify it.


> But with some important special cases, I can see no other way than to 
> manually scrutinize the source code. Think of a complicated function 
> (say, some hairy tensor math operation, maybe an FFT function, or 
> whatever that's nontrivial) that internally needs to do "unsafe" 
> operations or even in-line asm, but that has been deemed safe by 
> Authoritative Professionals.

Yes, but the idea is to reduce the scope as much as possible of where 
you have to manually look for unsafe code.


More information about the Digitalmars-d-announce mailing list