Just intuitively, this seems to be using a feature designed to guarantee safety in a way that doesn’t guarantee safety, which raises questions about what the point is.
Author here: to get the compiler to help me as the programmer to produce correct code (not accidentally using handles after GC) without being massively manual, but (at least currently) accepting that it is not a guarantee and thus runtime checks (bounds checks in my case) are needed to retain memory safety.
Just use unsafe then you have all of the good points of rust, like being able to say you wrote it in rust with none of the downsides, like having to write safe code in rust, or that code being slow.
This reminds me of the old Monty Python sketch:
https://www.youtube.com/watch?v=uLlv_aZjHXc (Argument Clinic)
Compare also 'A Unified Theory of Garbage Collection' https://web.eecs.umich.edu/~weimerw/2008-415/reading/bacon-g...
Just intuitively, this seems to be using a feature designed to guarantee safety in a way that doesn’t guarantee safety, which raises questions about what the point is.
Author here: to get the compiler to help me as the programmer to produce correct code (not accidentally using handles after GC) without being massively manual, but (at least currently) accepting that it is not a guarantee and thus runtime checks (bounds checks in my case) are needed to retain memory safety.
Just use unsafe then you have all of the good points of rust, like being able to say you wrote it in rust with none of the downsides, like having to write safe code in rust, or that code being slow.