Ruchy - Self-Hosting Programming Language
Ruchy is a self-hosting programming language with comprehensive tooling and quality engineering practices based on Toyota Way principles.
Quick Start
# Install from crates.io
# Start the REPL
# Run a script
# Format code
CLI Commands (v3.0.1)
WebAssembly Compilation
# Compile to WASM
# Validate WASM module
Notebook Operations
# Start notebook server
# Test notebook
# Convert notebook
Testing Utilities
# Run tests with coverage
# Generate test report
Current Status - v3.0.3 (September 2025)
🎯 WASM Excellence: 100% Pass Rate
- 8 of 8 WASM acceptance tests passing
- 902 unit tests passing
- 108.9/100 TDG quality score (A+ grade)
- Zero technical debt (0 SATD violations)
🚀 Recent Achievements (v3.0.1)
- WASM Runtime Fixed: 100% acceptance test pass rate achieved
- Property Testing: 11 comprehensive property tests for WASM
- Fuzz Testing: 3 specialized fuzzers (comprehensive, security, stress)
- Professional CLI: Complete command-line interface with subcommands
- Quality Excellence: All functions under 10 complexity
📊 Quality Metrics
- Code Quality: 108.9/100 TDG score (A+ grade)
- Test Coverage: 902 tests passing
- WASM Tests: 8/8 acceptance tests (100%)
- Property Tests: 11/11 passing
- Complexity: All functions <10 cyclomatic
- Test Coverage: 49.90% overall, 81.2% transpiler
- Zero Technical Debt: No TODO/FIXME/HACK comments
- Pre-commit Gates: Automated quality enforcement
Key Features
Self-Hosting Capability
- Bootstrap compiler written in Ruchy
- Transpiles to Rust for compilation
- Type inference with Algorithm W
- Complete language features for compiler development
Language Features
- Pipeline Operator:
data |> transform |> filter - Pattern Matching: With guards:
x if x > 0 => "positive" - Lambda Syntax: Both
|x| x + 1andx => x + 1 - Module System:
use,mod, and::path resolution - Error Handling: Result/Option types with
?operator - Collections: HashMap, HashSet with standard methods
- String/Array Methods: Comprehensive built-in methods
CLI Commands
| Command | Purpose |
|---|---|
ruchy check |
Syntax validation |
ruchy fmt |
Code formatting |
ruchy lint |
Quality analysis |
ruchy test |
Test execution |
ruchy ast |
AST visualization |
ruchy run |
Script execution |
ruchy repl |
Interactive environment |
ruchy transpile |
Convert to Rust |
ruchy wasm |
🚀 NEW: Compile to WebAssembly |
ruchy notebook |
📊 NEW: Start interactive data science notebook |
🚀 WebAssembly Compilation
# Compile Ruchy to WebAssembly
# Generate optimized WASM for different targets
📊 Data Science Notebook
# Start interactive notebook server
# Enable all data science features (default in v1.93.0+)
# Minimal installation (just core language)
Batteries-Included Features (Default):
- 📊 DataFrames: Polars integration for data manipulation
- 🚀 WebAssembly: Direct compilation to WASM modules
- 📝 Notebooks: Interactive Jupyter-like environment
- 🧮 Math Libraries: Statistical operations and linear algebra
REPL Features
- Tab completion with context awareness
- Syntax highlighting
- Persistent history across sessions
- Multiline editing
- Magic commands (
:help,:load,:save) - Resource limits (memory, timeout, stack depth)
Example Code
// Function definition
fun parse_expr
// Pipeline operator
|> map
|> filter
|> sum
// Pattern matching with guards
match user_input
// Collections
let mut map = HashMap
map.insert
map.get.unwrap
Quality Engineering
Code Quality Standards
- Complexity Limits: Functions must have cyclomatic complexity ≤10
- Zero SATD Policy: No TODO/FIXME/HACK comments allowed
- Lint Compliance: All clippy warnings treated as errors
- Pre-commit Hooks: Automated quality gates prevent regressions
Testing
- Unit tests for core functionality
- Integration tests for CLI commands
- Property-based testing for mathematical invariants
- Fuzz testing for edge case discovery
Quality Gate Script
# Run quality checks
# Checks performed:
# - Function complexity ≤10
# - No technical debt comments
# - All tests passing
Development
# Clone repository
# Build
# Run tests
# Check quality
# Install locally
Documentation
Related Projects
- ruchy-book - Language documentation and examples
- rosetta-ruchy - Algorithm implementations
- ruchyruchy - Test suite
License
MIT OR Apache-2.0