-preview=safer for D

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Mon Dec 16 14:24:53 UTC 2024


On 17/12/2024 3:10 AM, Lance Bachmeier wrote:
> On Sunday, 15 December 2024 at 12:05:46 UTC, matheus wrote:
> 
>> Some people are lazy and they will just write/do things to get the job 
>> done unfortunately.
> 
> "Lazy" and "unfortunately" are not accurate. Memory safety comes with a 
> non-trivial cost, and in many cases, no benefit.

Neither is this fully accurate.

Memory safety when it properly models memory movement, does offer 
benefits in terms of optimization. Both logical bugs, and memory safety 
related issues can be caught.

Full program security analysis is incredibly expensive and I honestly 
don't think D will ever have it. You basically need a proof assistant at 
that point and you have to ditch the separate compilation model.

But there is a certain amount we can do, without going into a multi-pass 
DFA, whilst still being separate compilation. That can catch logic bugs 
and provide optimizations without being crazy on the unnecessary errors.

The question therefore, is how to tune it, and that is not an easy 
question to answer (still working on that one!).

A lot of this is bread and butter topics of backend engineers from the 
80's. It is being reapplied to the frontend these days, rather than 
being a whole new area of research.



More information about the Digitalmars-d mailing list