Second response not about deep copy but about simplifying deep copy operation. Actually, I understood the reason of deep-copy-only conversions immediately after sending the question. And "big source code overhead from nothing" means: we almost always have to write conversion manually rather than do it automatically. The proposal is adding auto conversion operation between Shared and Owned boxes. May be it should looks like C++ copy or move constructors. In case of move conversion, the operation can be allowed only if there is only one Shared box is owned a value. For copy conversion it can make deep object copy automatically.
Regards, Alex. 2013/4/23 Graydon Hoare <[email protected]> > > If you have constructive suggestions about how to generally convert a > possibly-cyclic graph of possibly-multiply-referenced substructures into a > proper tree without incurring a deep copy, we'd all be interested to hear > it. Otherwise this is behaving as expected (and documented). We're all > aware that the separation of heaps incurs some costs along with its > benefits. > > I'm sorry if it comes as a surprise but it's the cost we carry in order to > gain the many, many benefits of linearity in owned types. As far as I know > one can't really have it both ways. Other languages don't get out of this > for free either. They either incur the costs of pervasive memory > contention, locking and concurrent garbage collection, or they copy > _everything_ (like erlang) when transmitting. > > Non-constructive criticism like "big source code overhead from nothing", > "shocked", "ugly" and such are not helpful (in addition to drifting outside > the participation guidelines for the project[1]). > > -Graydon > > [1] https://github.com/mozilla/**rust/wiki/Note-development-** > policy#conduct<https://github.com/mozilla/rust/wiki/Note-development-policy#conduct> >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
