A new way to manage memory: no garbage collection, extremely fast & safe access
6 hours ago
- U has no tracing garbage collector; ownership forms a DAG with strong parent-to-child references, and zero refcount on an owner frees its entire subtree without global pauses.
- A slab chain allocator per owner allocates via bump pointers and grows by power-of-two slabs, so deallocation cost is O(log n) slab frees and effectively constant for typical scopes.
- Dynamic values use NaN-boxed tagged 8-byte representations, avoiding separate heap allocation for leaf values like integers, bools, and none.
- Lists use stable power-of-two slabs: existing elements never move on append, random access uses bitwise slab arithmetic from a compact slab-pointer header, and iteration walks contiguous slab memory.
- Maps are implemented as stable ordered dense storage: parallel key/value lists with insertion-index as the authoritative pointer; the reverse key-to-index resolver is derived acceleration, not the map itself.
- Map optimization avoids reverse lookup whenever possible: iterator provenance, compiler-constant keys, symbols, and cached shapes let many accesses compile directly to stable-index reads.
- Resolver generations allow the reverse index to change algorithm (scan, SwissTable, radix, compact hash) without renumbering authoritative map storage; sealed generations become immutable and can be queried in parallel.
- Deletion and reinsertion use tombstones and append-on-reinsert; compaction that renumbers entries creates a new map storage generation and invalidates only caches not guarded by generation identity.
- Ownership, capabilities, and determinism are explicit: effectful operations require passed capabilities, back-references are weak and resolve to none after referent death, preventing ownership cycles.
- Tree-like data structures can be implemented via Maps with persistent sharing; concurrency can use immutable versions with CAS on the root and epoch/reclamation-based lock-free reads.