|
|
|
|
|
by dnautics
74 days ago
|
|
> There's a formal proof asserting that if you keep up the safety invariants within an unsafe region then that will not infect other code, even in the presence of arbitrary other correctly-written unsafe blocks. In general "unsafe" does not compose. "if you keep up the safety invariants within an unsafe region" This condition is doing a lot of heavy lifting. |
|
I'm curious why you think that statement is doing heavy lifting. It's much easier to write and verify that a few lines of code are correct than it is to write and verify that an entire program is correct. But that's the norm in C and Zig, and historically people haven't been very good at it. That's why we try to do it as little as possible.