Loom is a functional language that compiles to Rust. It features:
- Module system with
provides/requiresinterfaces for dependency injection - Product types (
type Point = x: Float, y: Float end) - Sum types (
enum Color = | Red | Green | Blue end) - Refined types (
type Email = String where valid_email) - Effect tracking (
fn fetch :: Int -> Effect<[IO], User>) - Design-by-contract (
require:/ensure:clauses →debug_assert!) - Pipe operator (
a |> f |> g)
cargo build --release
# binary at target/release/loom
loom compile src/pricing.loom # writes src/pricing.rs
loom compile src/pricing.loom -o out.rs # custom output path
loom compile src/pricing.loom --check-only # type/effect check only
| Feature | Status |
|---|---|
| Lexer (logos) | ✅ |
| Recursive-descent parser | ✅ |
| Type checker (symbol resolution) | ✅ |
| Effect checker (transitive effects) | ✅ |
| Rust code emitter | ✅ |
CLI (loom compile) |
✅ |
| Full expression parser | ✅ |
| Corpus examples | ✅ |
Phase 2 will add: type inference, full pattern exhaustiveness checking, WASM back-end, and language server support.