The Stack and the Heap analogy

From Grassland Wiki
Revision as of 14:42, 19 December 2020 by Davidt (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

One can think of Grassland as a way of reducing the Shannon entropy of the natural environment using stack and heap based construct. Where Grassland is the stack and the real world is the heap.

The stack and heap are programming constructs used in computer science. Basically. the stack is composed of "pointers". a pointer is a type of programming language object that references a location/address in memory where a value is stored. It's like the page number you see written in a book's index or glossary. The number itself "points" to a location in the book where whatever you're looking for is stored. In some programs the required memory cannot be known beforehand because it might depend on user input which can often be of arbitrary size and type. So this memory is allocated dynamically on the heap and the pointers stored efficiently in the stack point to the arbitrary user data on the heap.

The digital objects in Grassland are pointers that point to 4+ dimensional "address" (e.g. the exact position of your right arm) on a heap full of other humans, cars, trees etc. The stack's purpose is to keep these addresses stored in one contiguous, easily referenced location to let the software running inside machines efficiently find and interact with multiple objects stored in a cluttered manner on the heap. Because it'd be impossible to use software if it had to traverse the entire heap every time it tried to do something.