L4 Logo

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:

  1. Get L4 - Download the VS Code extension L4 Rules-as-code
  2. Foundation Course - Learn L4 systematically (start here!)
  3. 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

LLM Integration

View all tutorials →


Reference

Look up specific features:

View full reference →


Concepts

Understand the "why" behind L4:

View all concepts →


Community & Support


Developer Resources


L4 is published under the Apache-2.0 License.