Memory Safety's Hardest Problem(matklad.github.io)
matklad.github.io
Memory Safety's Hardest Problem
https://matklad.github.io/2026/07/20/memory-safety-hardest-problem.html
2 comments
This sounds pretty similar to Java's array-of-templates problem. Is it really more of a problem than parent pointers?
``` $ cat test.mojo from std.utils import Variant
def main(): var x : Variant[Int, Pointer[Int, ImmStaticOrigin]] # set it to int x = 12345 # get a reference to the int (dynamically checked). ref elt_ref = x[Int]
```