Re:Counterexamples in Type Systems: programs that crash, seg...
by marcosdumay on Tuesday June 06, 2023 @12:38PM
(#36215446)
It's not the GC that guarantees safety. It's the encapsulation of every memory access inside a safe interface in the language's semantics. All the GC does is to make it possible to create the most popular interfaces over a finite memory.
And yeah, any bug on the interface or its implementation will lead to unsafe memory usage.
But anyway, no, if you make an interface where it's important to get memory corruption, you won't get memory corruption. It doesn't matter if the most inapt programmer on the world uses it. And the idea that people can manually manage memory on programs that are hundreds of megabytes large and created by many developers (or a single one at many different times) is about as wrong as the first part.
And yeah, any bug on the interface or its implementation will lead to unsafe memory usage.
But anyway, no, if you make an interface where it's important to get memory corruption, you won't get memory corruption. It doesn't matter if the most inapt programmer on the world uses it. And the idea that people can manually manage memory on programs that are hundreds of megabytes large and created by many developers (or a single one at many different times) is about as wrong as the first part.