GC is great from the point of view, that a programmer doesn't have to think about freeing variables - they do it by themselves. However, it brings performance penalties (and so-called "spikes" in terms of latency for web-applications). There are already Rust with its lifetimes, C++ with RAII and smart pointers, etc. However, they require programmer to process them manually. What about mixing both ways: compiler derives lifetimes automatically? Then it feels like a GC, but no actual GC is used.
Let's introduce the main point of the mechanism: hierarchy. It represents a structure of a type. Hierarchy consists of layers, where each layer is a container. For example: - Fundamental types are containers for primitives, that doesn't contain any other layesr. For example: int, float, bool, string, etc. - Complex types are containers, that may contain other types internally. For example: arrays, hashmaps, classes, etc. Each hierarchy may consist of at least