Skip to content

ll-lang User Guide

A practical guide for programmers (human or LLM) who want to write .lll programs, compile them with lllc, and target F#, TypeScript, Python, Java, C#, with optional experimental LLVM IR output.

ll-lang is a statically typed functional language with Hindley-Milner inference, algebraic data types, traits, semantic tags, and unit algebra.

Contents

  1. Installation — build the compiler, run hello world
  2. Syntax — modules, bindings, lambdas, if, match, ADTs, traits
  3. Types and inference — H-M, polymorphism, annotations
  4. Tags and units — tags, phantom types, unit algebra
  5. Traits — declarations, impls, constrained generics, dispatch
  6. Modules — module headers, imports, project mode (lll.toml)
  7. Error codes — compact diagnostics (E001..E008, E020, E024..E031)
  8. CLI — build/check/run/new/install/self commands (+ experimental reverse)
  9. MCP serverlllc mcp tools for LLM clients
  10. Compilation targets--target fs|ts|py|java|cs|llvm
  11. Java target details — Java backend mapping details
  12. LLM prompting — short guide for ll-lang prompting

Status

Compiler phases 1 to 10 are complete. Current stable surface includes:

  • End-to-end pipeline (lexer -> parser -> elaborator -> HM infer -> codegen)
  • Multi-file projects with lll.toml and target selection
  • Self-hosted stdlib/compiler bootstrap flow
  • Canonical default operator fixities from Std.Operators
  • MCP server for structured LLM tooling
  • Targets: F#, TypeScript, Python, Java, C#

Current caveats:

  • LLVM backend is intentionally subset-based compared to the primary F# backend.
  • lllc reverse is available as experimental tooling and is outside 1.0 compatibility guarantees.
  • See Release Contract 1.0.