-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experiment with Lobster-like memory management #143
Comments
That restriction is necessary to prevent iterator invalidation and data races. A better name for mutable references would have been unique references. From the linked page:
Please no implicit reference counting. Also reference counting requires heap allocation, which may not even be possible in
Rust doesn't use any non-local type inference (except for |
@bjorn3 allowing multiple mutable pointers to alias is a debate that we do not need. The main remaining point is to eliminate lifetime annotations. The reason for this is that a lot of the power of Lobster centers around its “Flow Sensitive Type Specialization”, meaning it type checks functions in call-graph order, and specializes them based on types. It's up to rust developers to, after a rigorous analysis, determine if the “Flow Sensitive Type Specialization” (or a variant) is absolutely not applicable in any extent to rust. |
Yes. Otherwise, it relies on certain assumptions (e.g. presence of a memory management unit) that would not be appropriate on a language level and it relies on certain rules in terms of lifetimes that would make usage of this unpredictable. Namely, lifetime rules are encoded in type signatures in Rust. This means changes purely interior to a function should not alter calling the function in Rust. Lobster's description here contains no such limitation. So it may be very appropriate for Lobster but not necessarily appropriate for Rust. |
http://aardappel.github.io/lobster/memory_management.html
Reading this blog has been mind-blowing to me, as there would be an algorithm that would:
Rust has an issue about implementing automatic garbage collection:
rust-lang/rfcs#415
The reason would be to massively help the language to become more mainstream by reducing the learning curve, and the cognitive overhead of day to day programming thus increasing developper productivity on their problem domain.
Experimenting with Lobster-like memory management, if a success, would bring us closer to that goal, without any tax on runtime performance.
This seems to me like the future: almost automatic, compile time garbage collection.
Rust would really gain momentum with such a killer feature.
The text was updated successfully, but these errors were encountered: