On Mon, May 16, 2011 at 11:49 AM, Graydon Hoare <[email protected]> wrote: > I've really not seen any single answer for the "best" storage management > system; automatic or manual. Apologies if it sounds like I'm proposing RC as > that champion. It's surely got flaws (code footprint, cache write traffic > and acyclicality; nontrivial issues!) My experience is merely that it's > predictable, has low latency and heap overhead, scales well with large > heaps, and hybridizes acceptably with other schemes such as the mark/sweep > we'll probably be using for cyclic data. And it's simple! There's not much > to tune so you don't spend much time "tuning the GC". There's really only > one knob: how many rc operations the compiler can elide by static analysis. > Makes it comparatively easy to reason about. >
There's only one thing I've noticed about RC (never having worked with a system that used it before): it seems to be a source of compiler bugs. Just in writing code that seems to be a bit more functional and deeply-nested than some of the existing code in rustc, I've found two bugs involving the compiler forgetting to emit drop code in the right place. With GC, the compiler typically has to do some work too -- that is, specifying data layout -- but we'll have to do that anyway. This would be a great exercise for a compiler verification framework, but since we're not proving the compiler correct, the potential for refcounting bugs makes me a bit nervous. Cheers, Tim -- Tim Chevalier * http://cs.pdx.edu/~tjc/ * Often in error, never in doubt "an intelligent person fights for lost causes,realizing that others are merely effects" -- E.E. Cummings _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
