4 ms·
Do we know yet any ways to get "pointers cannot dangle and you don't need a GC and you don't need Rust-style borrow checking" other than region-based memory man
by snaky 9y ago
Do we know yet any ways to get "pointers cannot dangle and you don't need a GC and you don't need Rust-style borrow checking" other than region-based memory management (MLton, Cyclone)?
- kod 9y agoHow are you distinguishing Rust from Cyclone? Seems like the same foundation.
- frankmcsherry 9y agoOwnership / affine types? It's hard to say, because some folks will jump up and down and say "reference counting is GC!", and then some folks could just as justifiably say "regions are GC!"
- sitkack 9y agoAnything less than being able to track memory lifetime at compilation is GC. Some folks will jump up and down and say "variable sized allocation is sloppy!" GC is a spectrum on which reference counting lives. Is there an arch that supports bidirectional references?
- snaky 9y agoMaybe linear types actually, affine is not enough?
- frankmcsherry 9y agoI suspect affine is fine, but I'm not an authority. The distinction (as I understand it) is only that linear types require that you consume all instances, whereas affine allow you to leak if you want. Leaking doesn't seem to lead to dangling pointers, but I've been wrong before.