Aristid is an experimental grammatical compression engine based on L-Systems and recursion, using an innovative approach to text compression inspired by grammar and linguistic patterns.
- Grammatical Compression: Instead of traditional algorithms, Aristid analyzes linguistic patterns
- L-Systems (Lindenmayer Systems): Based on formal grammars for recursive expansion/compression
- Native Rust Engine: Core implemented in Rust for maximum performance
- Self-learning: Rule matrix that evolves with usage
- Cross-platform: Supports Windows, macOS, and Linux
- Easy integration: Windows context menu and CLI interface
npm install -g aristid# Clone the repository
git clone https://github.com/johanlabs/aristid
cd aristid
# Install dependencies and build
yarn install
yarn build# Compress a file
aristid file.txt
# Reconstruct from .ari
aristid file.ariAfter installation:
- Right-click on any file
- Select "Aristid" from the menu
- The file will be processed automatically
# Install menu
npm run install-menu
# Remove menu
npm run uninstall-menuaristid/
├── core/ # Native Rust engine (napi-rs)
├── src/ # JavaScript interface
│ ├── cli.js # Command line interface
│ ├── handler.js # Flow manager
│ └── matrix_manager.js # Rule matrix manager
├── matrix/ # Grammatical rules
├── scripts/ # Utility scripts
└── index.js # Node.js binding
- Grammatical Analysis: Identifies patterns and rules in text
- Rule Extraction: Creates L-System rules based on repetitions
- Substitution: Replaces patterns with optimized tokens
- Serialization: Saves seed + rules in
.ariformat
- Loading: Reads seed and rules from
.arifile - Rule Application: Executes L-System for expansion
- Reconstruction: Generates original text from grammar
- Saving: Produces
_florescido.txtfile
{
"seed": "base64_encoded_seed",
"rules": "base64_encoded_binary_rules"
}Run the included benchmark:
npm run benchmarkThe benchmark tests:
- Compression/decompression speed
- Reduction rate
- Data integrity
- Rust engine performance
- Node.js 20+
- Rust 1.70+
- Yarn 4.x
- Native build tools (gcc, make, etc.)
# Build in release mode
yarn build
# Build in debug mode
yarn build:debug
# Run tests
cd core && yarn test
# Format code
cd core && yarn format
# Lint
cd core && yarn lint// src/lib.rs
#[napi]
fn encode_grammar(input: Buffer, matrix: Buffer) -> EncodeResult {
// Compression logic
}
#[napi]
fn decode_grammar(seed: Buffer, matrix: Buffer) -> Buffer {
// Reconstruction logic
}Aristid uses a rule matrix that evolves with usage:
- Located at
matrix/user_solo.ari-matrix - Stores learned grammatical rules
- Optimized binary format
- Incremental learning
- ✅ Windows (x64, ia32, arm64)
- ✅ macOS (x64, arm64, universal)
- ✅ Linux (x64-gnu, x64-musl, arm64, arm, riscv64, s390x)
- ✅ FreeBSD (x64)
- ✅ Android (arm64, arm)
- Node.js 20.x
- Node.js 22.x
- Node.js 24.x
- Fork the project
- Create your branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under MIT License. See LICENSE for more information.
- napi-rs: For the amazing Rust/Node.js integration
- The Hitchhiker's Guide to the Galaxy: For philosophical inspiration
- Rust Brasil Community: For technical support
Found a bug or have a suggestion? Open an issue.
Aristid - Because space is vast, and compression can be grammatical. 🚀