Expand description
§Zombie-rs
A runtime system that reduces program memory consumption through automatic eviction and recomputation of values. Implements the Zombie monad for purely functional programs.
§Key Features
- Automatic memory management: Evict values and recompute on demand
- Tock-based identification: Unique logical timestamps for each allocation
- Sparse replay points: O(n log n) metadata for n live objects
- Greedy-Dual eviction: Intelligent eviction policy based on cost/space/staleness
- Tail call optimization: Trampolined execution for deep recursion
§Feature Flags
full(default): Enable all featuresderive: Enable#[derive(ZombieOps)]macroprofiler: Enable profiling utilities (TrackingAllocator, BenchmarkSuite)cli: Enable CLI benchmark runner dependencies
§Example
use zombie_rs::prelude::*;
Runtime::init();
let x = Zombie::new(42);
let y = x.bind(|val| Zombie::new(val * 2));
assert_eq!(y.get(), 84);§Requirements
- Programs must be purely functional (deterministic, no side effects)
- Computations should be referentially transparent
Re-exports§
pub use config::ZombieConfig;pub use error::ZombieError;pub use error::ZombieResult;pub use tock::Tock;pub use zombie::Zombie;pub use runtime::Runtime;pub use meter::ZombieOps;pub use zombie_profiler as profiler;
Modules§
- config
- Configuration for zombie runtime behavior.
- context
- Context nodes for storing computation state and enabling replay.
- error
- Error types for zombie runtime operations.
- heap
- Heap data structures for eviction scheduling.
- meter
- Time and space measurement for zombie eviction.
- prelude
- Prelude for convenient imports.
- record
- Record nodes for tracking computation state during bind operations.
- runtime
- Runtime - Global state manager for zombie computations.
- splay_
list - SplayList - A splay tree fused with a doubly linked list.
- tock
- Logical timestamp for identifying zombie allocations.
- trampoline
- Trampoline - Zero-allocation loop abstraction for stack-safe execution.
- union_
find - Union-Find with Path Compression and Union-by-Address.
- zombie
- Zombie - The core monad for lazy eviction and recomputation.
Macros§
- zombie_
bench - Quick benchmark macro - measures a single expression and prints results.
- zombie_
compare - Compare multiple implementations and print a formatted report.
Derive Macros§
- Zombie
Ops - Derive macro for implementing
ZombieOpstrait.