News for hackers. Stuff that matters.
Re:A comparison of Rust's borrow checker to the one in C# by smaudet on Thursday October 31, 2024 @01:10PM (#42008893)
If you could even just pass an array of objects to be collected or something, this would so much easier.

Magic, code or otherwise, sucks when the spell/library/runtime has different expectations than your own.

You expect levitation to apply to people, but the runtime only levitates carbon based life forms. You end up levitating people without their affects (weapons/armor), to the embarrassment of everyone.

There should be no magic, everything should be parameterized, the GC is a dangerous call, but it should be exposed as well (and lots of dire warnings issued to those using it).

Re:A comparison of Rust's borrow checker to the one in C# by munificent on Thursday October 31, 2024 @04:34PM (#42011221)
> If you could even just pass an array of objects to be collected or something

If you have a bunch of objects in an array that you have a reference to such that you can pass it, then, by definition, those objects are not garbage, since they're still accessible to the program.

Re:A comparison of Rust's borrow checker to the one in C# by smaudet on Thursday October 31, 2024 @04:42PM (#42011301)
Yes. Use a WriteOnlyArray or whatever, Semantics aside though...

There should be some middle ground between RAII and invoking Dispose/delete and full blown automatic GC.