Skip to content

jghiringhelli/loom

Repository files navigation

Loom

Loom is a functional language that compiles to Rust. It features:

  • Module system with provides / requires interfaces 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)

Install

cargo build --release
# binary at target/release/loom

Usage

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

Phase 1 status

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.

About

The Loom language: a DSL that transpiles to idiomatic Rust. Contract-first, effect-transparent, refinement-typed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors