Opt-Out Garbage Collection with Type safety from Rust #7624
Replies: 6 comments 1 reply
-
This would also allow for a rich expansion of types that involve the lifetime of an object. |
Beta Was this translation helpful? Give feedback.
-
Let me be clear, I don't want to do this for the whole project, just specific types within a project. |
Beta Was this translation helpful? Give feedback.
-
Seems like it might be virus like, similar to async/await. I'm not sure if you had a type with lifetime semantics it would not bleed into other types that use it. It seems like it would spread. |
Beta Was this translation helpful? Give feedback.
-
There would need to be a best practice/pattern on how to stop the spread and create an encapsulating type that stops the spread. Or decide just like async/await, it should be followed from the top to the bottom, async all the way down. |
Beta Was this translation helpful? Give feedback.
-
I would like to have this too, for at least some basic AOT compilation scenarios. There is no need for GC when a variable is exactly referenced in one place and written to, from one place, in the same thread (or something similar to Arc<Mutex> for MT) for instance. It might also reduce the final executable size. Or there could be a hybrid: those who fail the Ownership-Borrow analysis will be shipped to the big GC boi. |
Beta Was this translation helpful? Give feedback.
-
I would like to be able to opt-out of Garbage Collection and be forced into safe types from c++ and Rust that enforce the safety at compile or runtime. Like Unique pointers, borrows, or lifetimes. This would be rare but allow for much better interop with non-gargabe collected languages requiring much less Marshaling and allowing for New kinds of types around lifetimes of objects to be created in dotnet.
Beta Was this translation helpful? Give feedback.
All reactions