Aexol Language
DocsAexol LanguageAexol Language Overview
Aexol is a declarative DSL for defining types, workflows, visitors, and agents. Learn the core concepts.
Aexol Language Overview
Aexol is a declarative domain-specific language for modeling software systems. Instead of writing boilerplate by hand, you describe what your system should do — its data types, business workflows, actor capabilities, and autonomous agents — and Aexol generates production-ready, type-safe code in the language of your choice.
Why Aexol?
Traditional development forces you to translate requirements into code across multiple layers: type definitions, validation logic, state machines, access control, and notification systems. Aexol collapses this into a single, human-readable specification that serves as both documentation and the source of truth for code generation.
- One source of truth — your spec is the documentation, the types, and the scaffold
- Language-agnostic — generate TypeScript, Python, Rust, Go, or JavaScript from the same spec
- Iterative by design — refine your spec and regenerate; the AI handles the wiring
- Team alignment — specs are readable by developers, PMs, and stakeholders alike
Core Concepts
Aexol is built around five core concepts. Every specification combines these to describe a complete system.
| Concept | Purpose | Example |
|---|---|---|
| Types | Define data structures with fields | type Product { id: string; name: string; price: number } |
| Enums | Define fixed sets of named values | enum OrderStatus { pending; processing; shipped } |
| Workflows | Model state machines with transitions | pending -> processing when payment_confirmed |
| Visitors | Define hierarchical capability trees for actors | visitor Customer { "browse products"; "place orders" } |
| Agents | Define autonomous entities with capabilities | agent PaymentProcessor { "process payments"; "issue refunds" } |
Quick Example
Here is a small e-commerce specification that uses all five concepts together:
type Product {
id: string
name: string
price: number
inStock: boolean
categories: string[]
}
type Order {
id: string
customerId: string
items: OrderItem[]
total: number
status: OrderStatus
}
type OrderItem {
productId: string
quantity: number
unitPrice: number
}
enum OrderStatus {
pending
payment_received
processing
shipped
delivered
cancelled
}
workflow OrderFlow {
initial: pending
pending -> payment_received when payment_confirmed
payment_received -> processing when stock_reserved
processing -> shipped when items_packed
shipped -> delivered when customer_confirms
pending -> cancelled when timeout
payment_received -> cancelled when refund_requested
}
visitor Customer {
"browse products"
"place orders"
"view order history"
"track shipments"
}
visitor Admin {
"manage inventory"
"view all orders"
"manage products"
"view reports"
}
agent InventoryBot {
"reserve stock"
"release stock"
"update stock levels"
}
agent NotificationService {
"send order confirmation"
"send shipping update"
"send delivery notification"
}
✨ Edit in StudioHow It Works
- Define — Write your specification in Aexol using Studio or any text editor with LSP support
- Validate — The parser catches syntax errors, missing references, and structural issues in real time
- Generate — Produce type-safe code in TypeScript, Python, Rust, Go, or JavaScript via Studio
- Refine — Iterate on the generated artifacts with AI assistance; regenerate as your spec evolves
The same specification can generate backend models, frontend types, state machine classes, access control logic, and notification wiring — all from one file.
Supported Output Languages
Aexol generates idiomatic, type-safe code in five languages:
| Language | Output |
|---|---|
| TypeScript | Interfaces, discriminated unions, state machine classes |
| Python | Dataclasses, enums, Pydantic models |
| Rust | Structs, enums with #[derive], pattern-matched transitions |
| Go | Structs, typed constants, interface-based state machines |
| JavaScript | JSDoc-annotated classes, plain objects with validation |
When to Use Aexol
Aexol shines in these scenarios:
- Greenfield projects — define your domain model before writing any code; generate the scaffold and iterate
- API design — model your resources, statuses, and actor capabilities; generate type-safe clients and server stubs
- State machines — replace ad-hoc status fields with formal, validated workflows that generate enforceable transition logic
- Team alignment — use the spec as a shared language between developers, product managers, and domain experts
- Rapid prototyping — sketch your system in minutes, generate working code, and refine with AI assistance
Aexol is less suited for projects where the domain model is already deeply embedded in an existing codebase with no appetite for scaffolding from a spec.
Where to Go Next
- Tutorial — Build a complete e-commerce specification step by step
- Language Reference — Complete syntax reference for types, enums, visitors, roles, workflows, and agents
- Workflows & Recipes — State machine patterns and ready-to-use recipes for common scenarios
- Studio Overview — Browser-based IDE with real-time validation, code generation, and team collaboration