Shouldn't safety be the default.

Leonardo leotada523 at gmail.com
Thu Jan 4 18:36:50 UTC 2024


On Friday, 29 December 2023 at 02:04:01 UTC, Walter Bright wrote:
> On 12/27/2023 12:29 AM, Siarhei Siamashka wrote:
>> My understanding is that people are suggesting a new global 
>> compiler switch to optionally disable safety (allow `@system` 
>> and `@trusted` to be called from `@safe`), which would indeed 
>> allow compiling old abandoned libraries and use them from the 
>> new code during the transition period.
>
> Hmm, that is an interesting idea. The implementation might be 
> tricky, though, as @safe/trusted/system are baked into the 
> typing system at a fundamental level.

**My idea**:
Add @unsafe to act like @trusted, that can be applied on modules, 
enabling call from @safe but only if a compiler switch was 
enabled to allow use of @unsafe code. Then change default to 
@safe.


More information about the Digitalmars-d mailing list