
L4 Language Documentation
Welcome to the L4 language documentation. L4 is a domain-specific language for law that enables computer-readable formalizations of contracts, legislation, and regulations.
Getting Started
New to L4? Start here:
- Get L4 - Download the VS Code extension
- Foundation Course - Learn L4 systematically (start here!)
- Your First L4 File - Hands-on in 15 minutes
Documentation Types
Our documentation is organized by what you need:
| Type | Purpose | When to Use |
|---|---|---|
| Courses | Learning-oriented | "Teach me L4" |
| Tutorials | Task-oriented | "How do I do X?" |
| Reference | Information-oriented | "What is X?" |
| Concepts | Understanding-oriented | "Why does X work this way?" |
Courses
Structured learning paths from beginner to advanced:
Foundation Course
Learn L4 from scratch. No prior programming experience required.
- Module 0: Introduction - What is L4?
- Module 1: Your First Legal Rule
- Module 2: Legal Entities and Types
- Module 3: Control Flow
- Module 4: Functions
- Module 5: Regulative Rules (Obligations & Permissions)
- Module 6: Capstone Project
Time: ~4-6 hours total
Advanced Course
Deep dives for production use.
- Module A1: Real Regulatory Schemes
- Module A2: Cross-Cutting Concerns
- Module A3: Complex Contracts
- Module A4: Production Patterns
Prerequisites: Foundation Course
Tutorials
Task-focused guides for specific goals:
Getting Started
- Your First L4 File - Create, run, test (15 min)
- Encoding Legislation - Turn legal text into L4 (30 min)
- Wedding Vows Example - Fun intro to regulative rules (20 min)
- Common Patterns - Quick reference (30 min)
LLM Integration
- Getting Started with LLM - Hybrid AI + formal reasoning
- Legislative Ingestion - LLM-assisted encoding
Reference
Look up specific features:
- Syntax Reference - Complete syntax guide
- Types - L4 Types
- Functions - Functions as rules
- Regulative - Regulative language
- Libraries - Standard library
- Operators - Operators and precedence
Concepts
Understand the "why" behind L4:
- Design Principles - Why L4 works this way
- Regulative Rules - Obligations, permissions, prohibitions
- Algebraic Types - L4's type system
Community & Support
- Discord - Chat with the community
- GitHub Issues - Report bugs, request features
- Legalese Services - Professional implementation services
Developer Resources
- Latest Stable Build -
- L4 IDE Repository - Open-Source code
L4 is published under the Apache-2.0 License.