AILANG: AI-First Programming Language
Welcome to the official documentation for AILANG, an experimental programming language designed from the ground up for AI-assisted software development.
New to AILANG? Read our Vision to understand why AILANG exists and what makes it different from other programming languages.
What is AILANG?
AILANG is a pure functional programming language that makes AI assistance a first-class citizen. It features:
- Pure Functional Programming: Immutable data and explicit effects
- Algebraic Effects System: Track and control side effects in the type system
- Type Classes: Num, Eq, Ord, Show with dictionary-passing semantics
- Pattern Matching: Algebraic data types with exhaustiveness checking
- Auto-Import Prelude: Zero imports needed for type classes and comparisons
- AI-Optimized Design: Generate structured execution traces for model training
Quick Example
-- Module with effects (v0.3.0)
module examples/hello
import std/io (println)
import std/net (httpGet)
-- Recursive factorial function
export func factorial(n: int) -> int {
if n <= 1 then 1 else n * factorial(n - 1)
}
-- Function with multiple effects
export func main() -> () ! {IO, Net} {
println("Factorial of 5 is:");
println(show(factorial(5)));
let response = httpGet("https://api.example.com/data");
println(response)
}
Run with: ailang run --caps IO,Net --entry main examples/hello.ail
Getting Started
For AI Agents
-
AI Agent Integration Guide Quick start for AI coding agents (Claude, GPT, Gemini)
-
Teaching Prompt v0.3.8 Complete AILANG syntax guide for AI models
For Human Developers
-
Installation Guide Install AILANG and run your first program
-
Language Tutorial Learn the basics of AILANG programming
-
Language Reference Complete syntax and semantics reference
-
REPL Commands Interactive development with the AILANG REPL
Current Status: v0.3.8 (October 2025)
AILANG v0.3.8 is now available with multi-line ADT parser fixes and operator lowering improvements! Check the implementation status for complete details.
Working Features (v0.3.8)
- Recursion - Self-recursion, mutual recursion, with stack overflow protection
- Block Expressions - Multi-statement blocks with proper scoping
- Records - Record literals, field access, subsumption
- Type System - Hindley-Milner inference with type classes (Num, Eq, Ord, Show)
- Pattern Matching - Constructors, tuples, lists, wildcards, guards
- Module System - Cross-module imports, entrypoint execution
- Effect System - IO, FS, Clock, Net with capability-based security
- Clock Effect: Monotonic time, sleep, deterministic mode
- Net Effect: HTTP GET/POST with DNS rebinding prevention, IP blocking
- REPL - Full type checking, command history, tab completion
- Lambda Calculus - First-class functions, closures, currying
Coming in v0.4 "Deterministic Tooling"
- Deterministic Normalization -
ailang normalize
for canonical code formatting - Automated Import Suggestions -
ailang suggest-imports
fixes missing imports - Deterministic Code Repair -
ailang apply
for automated fixes - Total Recursion Combinators -
fold
,unfold
,iterateN
for functional completeness - Runtime Reflection -
reflectType
,reflectEffect
for AI self-debugging (v0.4.1+) - Training Data Export -
--emit-trace
for execution traces (v0.4.2+)
See our Vision for the full roadmap and measurable success criteria.
Documentation Structure
- Examples - Interactive code examples with explanations
- Guides - Tutorials and how-to guides
- Reference - Language specification and API docs
- Playground - Try AILANG in your browser
Contributing
AILANG is open source and welcomes contributions! Visit our GitHub repository to:
- Report issues
- Submit pull requests
- Join design discussions
- Review the roadmap
Design Philosophy
AILANG is built on several key principles:
- Explicit Over Implicit: All effects and dependencies are visible in types
- Correctness by Construction: Make invalid states unrepresentable
- AI-Friendly: Every language feature considers AI tooling needs
- Deterministic: Same input always produces same output
- Traceable: Complete execution history for debugging and training
Read the full Vision to understand why AILANG is designed for AIs first, humans second, and see empirical benchmarks showing 49% improvement in AI code generation success rates.
Resources
- GitHub Repository
- Design Documentation
- Change Log
- Development Setup
- llms.txt - AI-readable project documentation
AILANG is an experimental language under active development. APIs and syntax may change.