100% Safe Rust & Arrow Engine
Memory safety guarantees, layered crate boundaries, and zero-panic error handling.
Compile-Time Enforced (cargo xtask layers)Crates: statcraft_core, statcraft_algo
1. The Zero-Panic Contract#
StatCraft strictly bans the following constructs in production code: unwrap(), expect(...), panic!(...), unreachable!(...), todo!(), and unsafe. All potential failures—such as singular covariance matrices, zero variances, or division by zero—are captured as typed Result<T, StatError> variants and presented gracefully in the user interface.
2. Apache Arrow Memory Model#
Instead of allocating separate heap structures for individual data cells, StatCraft represents variables as continuous, contiguous Apache Arrow arrays:
- SIMD Vectorization: Vector operations run across CPU registers without pointer chasing;
- Polars Acceleration: Fast multi-threaded group-by, filtering, and aggregation;
- Zero GC: Deterministic memory deallocation without garbage collector stutter.
3. Layer Hierarchy (L0–L6)#
The repository enforces a strict unidirectional dependency hierarchy checked via cargo xtask layers:
- L0:
statcraft_io(Codecs) - L1:
statcraft_core(DataSets & Dictionaries) - L2:
statcraft_algo(Numerical Algorithms) - L3:
statcraft_charts(Vector Charts) - L4:
statcraft_reporting(Pivot Tables) - L5:
statcraft_syntax(CommandBus & SPSS Parser) - L6:
statcraft_app(Desktop GUI)