ichigo-lang
ichigo-lang copied to clipboard
write a little simply typed functional language to practice Rust
Ichigo Lang
to commemorate those fucking times
Intro
- It's trivial, just a toy, used to familiarize with Rust
- NO DEPENDENT TYPE
Quick Start
cargo run -- -i example/hello.ichigo
TODO List
- core task
- [x] parser
- [x] type checker
- [x] type inference
- [ ] evaluator
- peripheral task
- [x] REPL
- [x] pretty printer
Language Feature
- Algebraic data type
- Lambda calculus
- Pattern matching
- Unicode symbol
Quick View
ℕ = σ {
0 : ℕ
1+ : ℕ → ℕ
}
+ = λ x : ℕ . λ {
1+ y . 1+ (+ x y)
0 . x
}
ℕ𝓁 = σ {
∅ : ℕ𝓁
++ : ℕ → ℕ𝓁 → ℕ𝓁
}
take = λ {
1+ n . λ {
∅ . ∅
++ x xs . ++ x (take n xs)
}
0 . λ x . ∅
}