rust-lang/rust — pull request #18221 by jkleint (2014-10-22 03:44:57+00:00)
Title: Guide: motivate Box and Rc pointers with need, uses, benefits, examples

Explain that Rust has different pointer types because there is a
tradeoff between flexibility and efficiency. Briefly explain what a call
stack is, since people coming from scripting languages may be
unfamiliar. Explain that stack variables can't outlive their function,
which motivates storing things in the heap. Briefly explain the heap,
and the advantages of Rust's approach to it. Clarify that boxes are
pointer types that you deref with * just like references. Scope isn't
the most accurate framework to think about deallocation (since you
return boxes and otherwise move values out of scopes); it's more "when
the value is done being used," i.e., lifetime. Provide a connection
between Rust's pointer types by locating them on a flexibiltiy /
performance scale. Explain the compiler can't statically analyze
lifetimes with multiple referrers; hence the need for (runtime)
reference counting.