A modern, expressive programming language for data science and scientific computing, featuring a self-hosting compiler, comprehensive tooling, and enterprise-grade quality standards.
Table of Contents
- Installation
- Quick Start
- Features
- Language Features
- Core Commands
- Safety & Concurrency
- WebAssembly
- MCP Server
- Contributing
- License
Features
- Self-Hosting Compiler: Compiles Ruchy source to native binaries via Rust transpilation
- Interactive REPL: Full-featured read-eval-print loop for exploratory programming
- Pattern Matching: Algebraic data types with exhaustive match expressions
- Labeled Loops: Named loop control with break/continue to outer scopes
- Async/Await: First-class async support with tokio runtime
- Thread Safety: All globals are thread-safe by default via
LazyLock<Mutex<T>> - WebAssembly: Compile to WASM for browser and edge deployment
- MCP Server: Model Context Protocol integration for Claude
- 16,102 Tests: Comprehensive test suite with zero clippy warnings
Installation
Quick Start
# Start interactive REPL
# Run a script
# Evaluate expression
# Compile to binary
Language Features
// Variables and functions
let name = "Ruchy"
fun greet(who) {
println(f"Hello, {who}!")
}
greet(name)
// Pattern matching
let value = Some(42)
match value {
Some(x) => println(f"Got {x}"),
None => println("Nothing"),
}
// Labeled loops (v4.0)
'outer: for i in 0..10 {
for j in 0..10 {
if i * j > 50 {
break 'outer
}
}
}
// Collections
let numbers = [1, 2, 3, 4, 5]
let doubled = numbers.map(|x| x * 2)
println(f"Doubled: {doubled:?}")
Core Commands
| Command | Description |
|---|---|
ruchy |
Start interactive REPL |
ruchy <file> |
Run a Ruchy script |
ruchy -e "<code>" |
Evaluate expression |
ruchy compile <file> |
Compile to binary |
ruchy transpile <file> |
Transpile to Rust |
ruchy check <file> |
Syntax check |
ruchy lint <file> |
Lint code |
ruchy fmt <path> |
Format code |
ruchy test <path> |
Run tests |
Safety & Concurrency
Ruchy generates 100% safe Rust code with full concurrency support:
- Thread-safe globals via
LazyLock<Mutex<T>> - Full async/await support (tokio runtime)
- Channels, atomics, and all Rust concurrency primitives
- Zero unsafe code in generated output
// Thread-safe by default
let mut counter = 0
fun increment() {
counter = counter + 1 // Thread-safe
}
// Async functions
async fun fetch(url: String) -> String {
let response = http::get(url).await?
response.text().await
}
WebAssembly
# Compile to WASM
# Run WASM module
MCP Server
Ruchy provides a Model Context Protocol server for Claude integration:
Add to Claude Desktop config:
Quality Standards
- 16,102 tests passing
- Zero clippy warnings
- 200-point falsification validation framework
- Toyota Way quality principles
- PMAT A+ code standards
Documentation
- Language Specification
- Development Roadmap
- Ruchy Book - Comprehensive guide
- 🤖 Coursera Hugging Face AI Development Specialization - Build Production AI systems with Hugging Face in Pure Rust
Contributing
Contributions are welcome! Please see the CONTRIBUTING.md guide for details.
MSRV
Minimum Supported Rust Version: 1.91 — the aprender monorepo crates (aprender,
aprender-core, aprender-compute 0.65) declare rust-version = 1.91, so the workspace
cannot honestly claim less [PMAT-094].
See Also
License
MIT License - see LICENSE for details.
Author
Noah Gift - github.com/paiml/ruchy