<story><title>You can&apos;t Rust that</title><url>http://lucumr.pocoo.org/2018/3/31/you-cant-rust-that/</url></story><parent_chain><item><author>jnordwick</author><text>Is is even remotely true though? C++ probably moves things around more than rust, and I thought rust would want to reduce cache churn. It isn&amp;#x27;t like GC were things magically change locations.&lt;p&gt;I&amp;#x27;m not really sure I understand what he&amp;#x27;s getting at with that description.</text></item><item><author>pcwalton</author><text>I really like the way you captured one of the fundamental differences between Rust and C++ as &amp;quot;Things Move&amp;quot;. That&amp;#x27;s an interesting way to summarize it that I hadn&amp;#x27;t really considered before—and I designed a lot of that system :)</text></item></parent_chain><comment><author>oconnor663</author><text>&amp;gt; I thought rust would want to reduce cache churn&lt;p&gt;I think the main way Rust reduces cache churn, is that it makes it safer to pass references&amp;#x2F;pointers around instead of making copies. For example, if I have f(char*) in C, I might be worried about what f is doing with that pointer. It might save it somewhere, or try to free it, or who knows what. In C++, I might prefer to write f(std::string) to avoid those worries, but that comes at the cost of unnecessarily copying the string. (You could pass it by reference to avoid the copy, but then you still have to worry about f saving the reference.) In Rust, I can safely write f(&amp;amp;str), and I know f can&amp;#x27;t do anything dirty with that reference.</text></comment>
<story><title>You can&apos;t Rust that</title><url>http://lucumr.pocoo.org/2018/3/31/you-cant-rust-that/</url></story><parent_chain><item><author>jnordwick</author><text>Is is even remotely true though? C++ probably moves things around more than rust, and I thought rust would want to reduce cache churn. It isn&amp;#x27;t like GC were things magically change locations.&lt;p&gt;I&amp;#x27;m not really sure I understand what he&amp;#x27;s getting at with that description.</text></item><item><author>pcwalton</author><text>I really like the way you captured one of the fundamental differences between Rust and C++ as &amp;quot;Things Move&amp;quot;. That&amp;#x27;s an interesting way to summarize it that I hadn&amp;#x27;t really considered before—and I designed a lot of that system :)</text></item></parent_chain><comment><author>staticassertion</author><text>They&amp;#x27;re talking about move semantics, not actual memory moving around.&lt;p&gt;In c++ you get copy semantics by default, requiring std::mov to get move semantics. In rust it is the opposite.</text></comment>