Skip to content

ecto/loon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loon

A functional language with invisible types, safe ownership, and algebraic effects.

Try it in your browser →

[fn greet [name]
  [str "Hello, " name "!"]]

[pipe [range 1 10]
  [filter [fn [n] [> n 4]]]
  [map [fn [n] [* n n]]]
  [each println]]

Features

  • Type Inference — Full Hindley-Milner with let-polymorphism and row types. No annotations required.
  • Ownership — Rust-style move semantics and borrow checking, inferred from dataflow. No lifetimes.
  • Algebraic Effects — Declare, perform, and handle effects. Replaces exceptions, async, and mutable state.
  • Pattern Matching — Match on literals, ADT constructors, and wildcards with destructuring.
  • Macros — Template macros with quasiquoting. Procedural macros with compile-time IO.
  • Pipes — Thread data through transformation chains. No nesting, no temp variables.
  • Language Server — Diagnostics, hover types, go-to-definition, completions, inlay hints.
  • WASM — Compiles to WebAssembly with closures, ADTs, and tree-shaking.

Quick Start

curl -fsSL https://loonlang.com/install.sh | sh
loon run hello.loon        # Run a program
loon repl                  # Interactive REPL with time-travel
loon fmt hello.loon        # Format source
loon explain E0201         # Interactive error tutorial

Architecture

loon/
├── crates/
│   ├── loon-lang/        # Core: parser, type checker, interpreter
│   ├── loon-cli/         # CLI: run, repl, fmt, explain
│   ├── loon-lsp/         # Language server protocol
│   └── loon-wasm/        # WASM bindings for browser
├── web/                  # Website (written in Loon)
│   ├── public/           # Static assets, WASM bootstrap
│   └── src/              # Loon source: pages, components, router
├── tree-sitter-loon/     # Tree-sitter grammar
├── samples/              # Example programs
└── tests/                # Test suite

Development

# Run tests
cargo test --workspace

# Build WASM + dev server
cd web && npm run dev

# Build language server
cargo build -p loon-lsp --release

License

MIT

About

the lisp I always wanted

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published