I wanted to better understand Carp's memory management system before diving in to fix some things, so I figured I'd write about it to enhance my own understanding. First off, however, I felt it might be nice to have a general, relatively approachable introduction to the general concepts behind a linear type system for newcomers to reference. Part of this was sparked by @eriksvedang's insightful comment that lifetimes have much to do with multiple scopes and moving values across different lexical bindings.
I wanted to better understand Carp's memory management system before diving in to fix some things, so I figured I'd write about it to enhance my own understanding. First off, however, I felt it might be nice to have a general, relatively approachable introduction to the general concepts behind a linear type system for newcomers to reference. Part of this was sparked by @eriksvedang's insightful comment that lifetimes have much to do with multiple scopes and moving values across different lexical bindings.