Comments 1
The problem of memory leaks is solved. Just use a proper garbage collector, period. If Rust enthusiasts do not like the solution, it is their problem.
I am not sure that the people working on Rust understand that, but the idea beyond Rust is simple - take what we have, ready or not, perfect or not, and use it NOW. That gives us Cargo, nice, and some relatively care and error free zone to be discarded with “unsafe”.
When Rust demands lifetimes in a function definition it is pure madness because the idea of a function or procedure is to create a self contained entity that does not and should not care about the things outside like lifetimes. But since we cannot do better NOW - so be it.
Yes, it is possible to prohibit even more and make the comfort zone smaller but safer and that will be the Rust thinking. But Rust would be less laughable if the direction was changed a bit. Why not implement some mechanism of memory leaks prevention when static analysis detects the possibility and issue a warning? Not an error, a warning. Compilation is prohibitively slow anyway…
Can we guarantee that there will be no memory leaks due to circular references?