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.

ConceptPurposeExample
TypesDefine data structures with fieldstype Product { id: string; name: string; price: number }
EnumsDefine fixed sets of named valuesenum OrderStatus { pending; processing; shipped }
WorkflowsModel state machines with transitionspending -> processing when payment_confirmed
VisitorsDefine hierarchical capability trees for actorsvisitor Customer { "browse products"; "place orders" }
AgentsDefine autonomous entities with capabilitiesagent 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 Studio

How It Works

  1. Define — Write your specification in Aexol using Studio or any text editor with LSP support
  2. Validate — The parser catches syntax errors, missing references, and structural issues in real time
  3. Generate — Produce type-safe code in TypeScript, Python, Rust, Go, or JavaScript via Studio
  4. 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:

LanguageOutput
TypeScriptInterfaces, discriminated unions, state machine classes
PythonDataclasses, enums, Pydantic models
RustStructs, enums with #[derive], pattern-matched transitions
GoStructs, typed constants, interface-based state machines
JavaScriptJSDoc-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