A random mention of Walter: Memory Safety's Hardest Problem

Serg Gini kornburn at yandex.ru
Fri Aug 7 07:46:55 UTC 2026


On Thursday, 6 August 2026 at 18:21:29 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
> https://matklad.github.io/2026/07/20/memory-safety-hardest-problem.html
>
> https://www.reddit.com/r/ProgrammingLanguages/comments/1vh9h6w/memory_safetys_hardest_problem/

I like that in the sumtype docs we have similar example:
```
Memory corruption
This example shows how assignment to a SumType can be used to 
cause memory corruption in @system code. In @safe code, the 
assignment s = 123 would not be allowed.
SumType!(int*, int) s = new int;
s.tryMatch!(
     (ref int* p) {
         s = 123; // overwrites `p`
         return *p; // undefined behavior
     }
);
```

https://dlang.org/phobos/std_sumtype.html


More information about the Digitalmars-d mailing list