A Turing-incomplete configuration language with dependently-typed foundations that prioritizes correctness and safety.
Ligature is built for configuration management with professional-grade IDE integration, comprehensive error reporting, and formal verification capabilities. All programs are guaranteed to terminate with complete type safety.
// Define a validated user configuration
type User = {
name: String where length > 0,
age: Integer where >= 0 && <= 150,
email: String where contains "@"
};
let config = {
database = { host = "localhost", port = 5432 },
users = [
{ name = "Alice", age = 30, email = "alice@company.com" },
{ name = "Bob", age = 25, email = "bob@company.com" }
]
};- Correct by Design: Turing-incomplete with total functions and termination guarantees
- Professional Tooling: Complete LSP integration with cross-module navigation
- Configuration-Native: Built specifically for config management, not general programming
- Type-Level Safety: Dependent types with constraint-based validation
- Developer Experience: ML-family syntax with comprehensive error messages
- Dependent Types - Advanced type-level computation and proofs
- Constraint-Based Validation - Runtime validation with refinement types
- Pattern Matching - Exhaustive matching with guards
- Union Types - Safe data modeling with variants
- Type Classes - Principled polymorphism and interfaces
- Language Server (LSP) - Full IDE integration with VS Code and others
- Cross-Module Navigation - Go to definition and find references
- Real-Time Diagnostics - Immediate error feedback with fix suggestions
- Import Resolution - Automatic dependency tracking and module loading
- Performance Monitoring - Built-in optimization analysis
- Module System - Clean code organization and reusability
- Import System - Relative imports, register imports, and workspace resolution
- Termination Guarantee - All programs guaranteed to halt
- Memory Safety - No runtime errors or undefined behavior
Ligature is intentionally limited to ensure correctness and focus:
- ❌ Arbitrary recursion or infinite loops
- ❌ I/O operations or side effects
- ❌ Concurrency primitives
- ❌ Runtime code generation
- ❌ File system or process operations
# Install the Ligature toolchain
cargo install ligature
# Or use our development workflow
git clone https://github.com/ligature-lang/ligature
cd ligature
just install # Requires 'just' command runner-
Write a simple config - Create
config.lig:let server_config = { host = "localhost", port = 8080, debug = true };
-
Parse and validate:
just reed parse --file config.lig just reed typecheck --file config.lig
-
Set up IDE integration - Install our VS Code extension
// Primitive types
let count: Integer = 42;
let rate: Float = 3.14159;
let name: String = "Ligature";
let enabled: Boolean = true;
let unit: Unit = ();type DatabaseConfig = {
host: String where length > 0,
port: Integer where >= 1024 && <= 65535,
max_connections: Integer where > 0,
ssl_enabled: Boolean
};
let db = {
host = "db.example.com",
port = 5432,
max_connections = 100,
ssl_enabled = true
};type Result = Success String | Error String;
let handle_result = \result -> match result {
Success msg => "✓ " ++ msg,
Error err => "✗ " ++ err
};
// Type classes for polymorphism
class Show a {
show: a -> String;
}
instance Show Integer {
show = \n -> toString n;
}// Type-level computation
type If 'Cond 'Then 'Else;
type Equal 'A 'B;
type Subtype 'A 'B;
// Dependent types for complex validation
type ValidatedConfig 'Schema = {
data: 'Schema,
validated: Equal (TypeOf data) 'Schema
};Current benchmarks show excellent performance for configuration workloads:
| Operation | Throughput | Improvement |
|---|---|---|
| Function Calls | 1M+ ops/sec | 2.7x faster |
| Cache Hit Rate | 99.95% | Expression-level |
| Pattern Matching | 823K ops/sec | Optimized |
| Simple Arithmetic | 784K ops/sec | Baseline |
just reed parse --file config.lig # Parse and validate syntax
just reed typecheck --file config.lig # Type checking
just reed eval --file config.lig # Evaluate expressionsjust cacophony run --config deploy.lig # Deploy configurations
just cacophony validate --env production # Validate environmentsjust keywork install stdlib # Install standard library
just keywork init my-register # Create new register- Getting Started - Installation and first programs
- Language Reference - Complete syntax guide
- IDE Integration - Development environment setup
- Real-world Examples - Practical configuration patterns
- Type-Level Computation - Advanced type system
- Performance Guide - Optimization techniques
- Architecture Overview - System design
- API Reference - Complete API documentation
- Contributing Guidelines - How to contribute
- Developer Guide - Internal architecture
- Justfile Guide - Development workflow
We welcome contributions! Ligature is actively developed with clear contribution guidelines:
- Report Issues - GitHub Issues
- Join Discussions - GitHub Discussions
- Read the Guide - Contributing Guidelines
Licensed under the Apache License, Version 2.0. See LICENSE or https://www.apache.org/licenses/LICENSE-2.0.
Ligature draws inspiration from several excellent projects:
- Dhall - Configuration language design patterns
- Cue - Constraint-based validation and syntax ergonomics
- Lean 4 - Type theory and dependent types foundation
- Rust Analyzer - Professional LSP implementation
- Elm - Accessible ML-family syntax and error messages
This project is dedicated to Pedro Furlanetto, whose vision for well-designed programming languages and thoughtful approach to software development continues to inspire Ligature's priorities and design decisions.