carp-lang / Carp

A statically typed lisp, without a GC, for real-time applications.
Apache License 2.0
5.47k stars 173 forks source link

docs: update memory.md #1435

Closed scolsen closed 1 year ago

scolsen commented 1 year ago

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.