I'm Rewriting IBM SPSS Statistics in 100% Safe Rust, Alone

Hacker News by 9 min read 8x views
I'm Rewriting IBM SPSS Statistics in 100% Safe Rust, Alone

Share Post

StatCraft Banner


StatCraft is a free, modern, open-source statistical application bundle built entirely in 100% clean Safe Rust. Designed as an uncompromising, clean-room substitute to proprietary statistical suites specified as IBM SPSS Statistics, StatCraft combines scholarly precision, instantaneous initiate times, and guaranteed collision immunity.

Whether you are conducting mental research, analyzing medicinal trials, instruction university statistics, or manipulating endeavor datasets, StatCraft provides an intuitive graphical interface alongside a deterministic, syntax-driven analytical engine.

StatCraft Graphical Interface
Interactive workspace: Variable View metadata dictionary, syntax implementation log, and canonical SPSS-style Output Viewer alongside organized pivot tables.


Core Pillars & Design Principles

  • 100% Safe Rust & Never Crash Guarantee: Zero unsafe blocks, zero panics (panic!, unwrap(), expect()). Malformed datasets, bare samples, or division by zero output explicit, typed Result<T, E> errors fairly than use crashes.
  • Commands, Not Handlers: Every analytical procedure and person communication is an nuclear motor command (EngineCommand). All commands assistance non-destructive Undo/Redo, serialize to norm SPSS syntax (.sps), and can be scripted headlessly.
  • Agent-Ready & MCP Bridge (Code Mode): Built-in local IPC socket (port 18493) and Model Context Protocol (MCP) server (--mcp flag). Enables external autonomous AI agents (Antigravity, Claude, ChatGPT, Ollama) to inspect metadata, execute lot syntax, execute mathematical computations, and stream live results into the Output Viewer.
  • SPSS-Style Canonical Output Viewer: Hierarchical navigation outline tree paired alongside authentic multi-level pivot tables. Results can be copied to the clipboard alongside one click as organized TSV data that pastes cleanly into Microsoft Excel without distorted columns or unwanted date conversions.
  • Vector-First UI: Rendered alongside native egui via ui.painter() and vector SVG icons. Strict zero-emoji and zero-unsupported Unicode sign guideline eliminates tofu squares (□) throughout all platforms.
  • Zero-Hardcode i18n: 100% of user-facing strings are decoupled into Project Fluent catalogs (locales/en.ftl, locales/ru.ftl) alongside real-time runtime tongue switching.
  • Resource Guard: Thread-limited builds (-j 1, codegen-units = 1) defend betterment workstations from recollection exhaustion.

Tip

📖 Comprehensive Feature Guide: An exhaustive citation of all accessible analytical procedures, data manipulations, transformation algorithms, and keyboard shortcuts is accessible in FEATURES.md (English) and FEATURES_RU.md (Русский).

1. Dual-View Data Management

  • Data View: High-performance, virtualized tabular grid displaying cases and variables. Supports instant toggling between raw numeric values and human-readable value labels (1/A).
  • Variable View: Comprehensive metadata dictionary managing:
    • Name: Normalized changeable identifiers.
    • Type: 9 canonical SPSS types (Numeric, Comma, Dot, Scientific, Date, Dollar, Custom Currency, String, Restricted Numeric).
    • Width & Decimals: Visual width and precision authority alongside tradition vector spinners.
    • Labels: Descriptive changeable titles displayed in dialogs and tables.
    • Values: Discrete and range value labels alongside dedicated modal editors.
    • Missing Values: Configurable discrete missing values and uninterrupted missing ranges.
    • Columns & Align: Table layout and alignment (Left, Center, Right).
    • Measure: Measurement flat classification (Scale, Ordinal, Nominal) alongside tradition vector measure icons.

2. Parametric & Descriptive Statistical Procedures

  • Descriptive Statistics: Mean, Std. Error Mean, Standard Deviation, Variance, Minimum, Maximum, Range, Sum, Skewness (with SE), Kurtosis (with SE), and Valid N (listwise).
  • Frequencies: Frequency counts, percentages, valid percentages, cumulative percentages, discrete missing value breakdown, percentiles, and quartiles.
  • One-Sample T-Test: Student's $t$-test against customizable test values, degrees of freedom, two-tailed significance, average differences, confidence intervals ($95%$ default or user-defined), and dual-table SPSS output.
  • Independent-Samples T-Test: Two-group difference alongside automatic Levene's Test for Equality of Variances ($F$, $p$), Student's $t$-test (Equal Variances Assumed), Welch's $t$-test (Equal Variances Not Assumed), and complete Group Statistics table.
  • Paired-Samples T-Test: Dependent collection difference providing Paired Samples Statistics, Pearson Correlation coefficients ($r$, $p$), and Paired Differences test tables.
  • One-Way ANOVA: One-Way Analysis of Variance alongside Fisher's $F$-test, between-groups and within-groups sums of squares, Levene's Test of Homogeneity of Variances, and descriptive statistics.

3. Canonical Output Viewer

  • Outline Tree Navigation: Interactive document tree on the remaining panel to jump immediately to any procedure, log, or table.
  • Pivot Tables: Multi-tier nested tables alongside authentic SPSS headers, alternating row striping, and right-aligned numeric formatting.
  • TSV Clipboard Export: One-click [ Copy Table (TSV) ] clasp alongside instant ocular feedback and right-click environment menus. Exports tables alongside spotless headers and row separators specifically organized for Excel import.
  • Execution Protocols: Monospace log blocks documenting executed SPSS syntax (GET DATA, DESCRIPTIVES, T-TEST, ONEWAY).

4. StatCraft Bridge & AI Agents (Model Context Protocol / Code Mode)

StatCraft is the world's archetypal statistical application bundle natively armed alongside the Model Context Protocol (MCP) and straightforward two-way authority via autonomous AI agents (Antigravity, Claude, ChatGPT, Ollama, and local LLMs).

🔍 Why StatCraft Bridge? Zero SPSS Experience Required (Click to expand)

You No Longer Need to Learn SPSS: Statistical Analysis in Natural Language

Historically, performing rigorous statistical inspection required mastering bequest statistical GUI suites (SPSS, SAS, Stata) or penning complex code in R and Python. Researchers had to memorize arcane syntax commands (DESCRIPTIVES VARIABLES=...), navigate dozens of nested dialog boxes, or compose data wrangling scripts from scratch.

With StatCraft Bridge, that obstacle is entirely gone: Connect your favorite AI aide to StatCraft and depict what you desire in plain individual language:

"Inspect the loaded study dataset. Compare the average pay between males and females using an independent-samples t-test, inspect Levene's test for equality of variances, and explain in uncomplicated conditions whether the difference is statistically significant."

The AI delegate volition autonomously:

  1. Query dataset metadata and changeable dictionaries via the bridge;
  2. Generate and execute commands through StatCraft's core;
  3. Retrieve verified mathematical output tables;
  4. Present a plain-language summary alongside consequence sizes and $p$-value interpretations.

Why Use StatCraft Bridge Instead of Plain LLM Chat?

  1. Absolute Mathematical Exactness vs. LLM Hallucinations: Large Language Models frequently hallucinate whenever handling thousands of numbers, calculating means, or estimating non-linear test statistics. StatCraft serves as the deterministic calculation oracle: the LLM guides the inquiry, during native Rust handles the math alongside $\le 10^{-6}$ precision verified against SciPy and SPSS algorithms.
  2. Real-Time Visual Synchronization on Your Screen: As the delegate executes procedures, the StatCraft desktop GUI updates live in forefront of you. Authentic Pivot Tables appear in the Output Viewer, syntax logs document the audit trail, and all results can be copied into Excel alongside a sole click.
  3. 100% Local & Privacy-Preserving: The socket extend runs locally (127.0.0.1:18493). Your medical, corporate, or personal investigation data never leaves your workstation.
  4. Autonomous Code Mode: Agents can run arbitrary SPSS syntax scripts (.sps), kind cases, display subsets, recode scales, grip missing values, and trigger any of StatCraft's statistical modeling procedures.

How to Connect Your AI Agent

  • Desktop GUI: Open Extensions -> MCP Bridge / Copilot in StatCraft. The dialog provides live server status, action logs, and one-click configuration snippets for Antigravity, Claude Desktop, and Cursor.
  • Headless CLI (stdio MCP): Configure statcraft.exe --mcp inner your MCP client settings.

Layered Architecture (L0 – L6)

StatCraft is engineered in strict compliance alongside the ArtCraft Layering Law. Dependencies stream strictly downwards:

L6: statcraft_app Desktop GUI (egui / eframe / DialogKit / Output Viewer) └── L5: statcraft_syntax CommandBus, SPS syntax parser, motor transactions ├── L4: statcraft_reporting Pivot array models, TSV / HTML / Text export └── L2: statcraft_algo Pure statistical math (Golden Oracle vs SciPy) └── L1: statcraft_core In-memory dataset, RawTable, VariableDictionary └── L0: statcraft_io Data codecs (CSV/TSV streaming, Excel .xlsx/.xls/.ods, SPSS .sav/.zsav) Cross-cutting usefulness crates: * statcraft_bridge Local IPC socket (18493) and Model Context Protocol (MCP) server * statcraft_i18n Fluent localization motor alongside zero hardcoded strings * xtask Developer tools: file-guard, layers, design-guard, parity, test-corpus 

Clone the repository and initiate the desktop application:

git copy https://github.com/kobaltgit/StatCraft.git cd StatCraft # Run StatCraft in publish manner (strictly single-threaded compiler guard) cargo run --package statcraft_app --release -j 1

Running Tests and Quality Guards

StatCraft enforces a strict Definition of Done (DoD). All tests and architectural linters must continue alongside zero warnings:

# Run all workspace unit, integration, and aureate oracle tests cargo test --workspace -j 1 # Check document size limits throughout all crates (anti-monolith guard) cargo run -p xtask -j 1 -- file-guard # Check architectural layering rules (L0 - L6 strict downwards dependencies) cargo run -p xtask -j 1 -- layers # Check dialog UI scheme scheme compliance (DialogKit guard) cargo run -p xtask -j 1 -- design-guard # Verify SPSS characteristic parity status cargo run -p xtask -j 1 -- parity

Crate / Path Responsibility
crates/statcraft_app Desktop person interface, docking windows, DialogKit, data grid, output viewer
crates/statcraft_syntax Engine command bus, transactions, undo/redo, SPSS syntax serializer
crates/statcraft_algo Pure mathematical algorithms (t-tests, ANOVA, regression, correlations, aspect PCA, nonparametrics, frequencies)
crates/statcraft_core In-memory DataSet, RawTable, VariableDictionary, measure scales, metadata
crates/statcraft_io Data codecs: streaming CSV/TSV, Excel workbooks (.xlsx/.xls/.ods), and SPSS records (.sav/.zsav)
crates/statcraft_i18n Localization motor powered by Project Fluent (locales/*.ftl)
xtask CI/CD automation: file-guard, layers, design-guard, parity
docs/ Architecture guides, scheme specs, roadmaps, and betterment chronicle


StatCraft is an ambitious, mathematically rigorous, clean-room statistical suite built in 100% clean Safe Rust alongside zero bequest C/Fortran code. Developing clean-room analytical algorithms (parametric & non-parametric tests, ANOVA, Levene, regression, syntax pipelines, and canonical pivot tables) requires huge investigation and mathematical verification.

If StatCraft helps your scholarly research, university coursework, or statistical workflows, and you would akin to assistance its ongoing development:


This project is dual-licensed under:

You may choose either licence at your option.

All brand resources and logos in assets/ are asset of the StatCraft project (kobaltGIT).

Other Article Hacker News
↑
Close Right Ads
Close Left Ads