On 9/18/11 12:08 PM, Graydon Hoare wrote:
I'm extending -- perhaps unfairly -- the idea in that feature to
single-element accessors on the grounds that few languages have *any*
strategy handle safe reference-to-interior-allocation lifetimes other
than "allocate everything in the heap and gc when you can". Which
obviously feels even worse to me.

Well, it is a hard problem, and one that the research literature has not solved. The road we're going down is nontrivial static analysis for memory management, and I'm uncomfortable with baking static analysis that isn't well-studied into a language definition, even independent of the fact that I think the static analysis that's implemented is too difficult for programmers to reason about.

I'm actually fine with programmers having to use a few extra levels of indirection here and there to maintain safety. If you have to add ~ or @ here and there, so be it. I'd rather see us spend our efforts on developing a fast allocator.

If the allocation overhead is really unacceptable, well, we have an unsafe sublanguage is there. We can layer the static analysis on top of that at a later date if we want to.

To me, safe no-copy references to interiors are less interesting than getting move semantics right (destructive reads vs. alias burying).

Patrick
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to