A functional language with invisible types, safe ownership, and algebraic effects.
[fn greet [name]
[str "Hello, " name "!"]]
[pipe [range 1 10]
[filter [fn [n] [> n 4]]]
[map [fn [n] [* n n]]]
[each println]]
- 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.
curl -fsSL https://loonlang.com/install.sh | shloon run hello.loon # Run a program
loon repl # Interactive REPL with time-travel
loon fmt hello.loon # Format source
loon explain E0201 # Interactive error tutorialloon/
├── 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
# Run tests
cargo test --workspace
# Build WASM + dev server
cd web && npm run dev
# Build language server
cargo build -p loon-lsp --release