In this chapter, you’ll see how Rust keeps you thinking about the computer itself. Rust keeps you focused on how the computer’s memory is being used for your program and what ownership is (who owns the data). Remember this word, ownership—it’s probably Rust’s most unique idea. We’ll start with the two types of memory a computer uses: the stack and the heap.
Oh, and there’s quite a bit more to learn about printing to build on what you learned in the last chapter. Look for that at the end!
Understanding the stack, the heap, pointers, and references is very important in Rust. We’ll start with the stack and the heap, which are two places to keep memory in computers. Here are some important points to keep in mind: