Crespi - Documentation¶
Language: Español | English
Crespi is a bilingual programming language with English as the primary syntax and Spanish available via language pack, designed to make programming more accessible to Spanish speakers.
Contents¶
Getting Started¶
- Quick Start - Your first program in Crespi
Language Reference¶
- Keywords - All reserved words
- Operators - Arithmetic, comparison, and logical operators
- Built-in Functions - Default available functions
- Data Types - Crespi's type system
- Grammar (ANTLR4) - Reference grammar
Execution¶
- Interpreter - Run code directly
- Compiler - Compile to native executable
- Feature Parity - Interpreter vs compiler support matrix
Architecture¶
- Overview - High-level architecture
- Crate Structure - Rust crate organization
Contributing¶
- Contributing Guide - How to contribute
- Code Style - Coding standards
Language Guide¶
- Variables and Constants
- Control Flow
- Functions
- Lists and Dictionaries
- Classes and Objects
- Advanced Features
Key Features¶
Bilingual Syntax¶
English is canonical; a Spanish language pack provides localized aliases. See the Spanish docs for localized examples.
// English (primary)
var name = "Ana"
let PI = 3.14159
if name == "Ana" {
print("Hello, Ana!")
}
Readable Operators¶
Crespi allows using operators in symbolic or textual form:
// Symbolic form
var sum = 5 + 3
// Textual form (Spanish operators)
var sumText = 5 mas 3
Object-Oriented Programming¶
class Person(let name, let age) {
fn greet() {
print("Hello, I'm " + this.name)
}
}
var ana = Person("Ana", 25)
ana.greet()
First-Class Functions¶
fn double(x) {
return x * 2
}
fn apply(func, value) {
return func(value)
}
print(apply(double, 5)) // 10
Installation¶
Requirements¶
- Rust 1.70+
- Cargo
Build from Source¶
git clone https://github.com/user/crespi-lang.git
cd crespi-lang
cargo build --release
Run¶
# Interactive REPL
cargo run
# Run a file
cargo run -- program.crespi
Resources¶
- Examples - Example programs
- IDE Support - VS Code extension and LSP
- WASM Runtime - WebAssembly bindings
- Web Platform - Learn in the browser