{ "code": 200, "data": { "description": "", "html": "
# AICL Language Specification v0.1\n\n**AI-Centric Language: Specification-First Programming**\n\nAuthor: Philippe-Antoine  \nVersion: 0.1.0  \nDate: 2026-06-13  \nStatus: Draft\n\n---\n\n## 1. Overview\n\nAICL (AI-Centric Language) is a specification-first programming language where software is defined through structured architectural intent rather than implementation instructions. Instead of writing executable code directly, developers specify objectives, architectural layers, anticipated failure modes, recovery procedures, constraints, validation criteria, and optimization goals.\n\nThe AICL compiler transforms these high-level architectural specifications into executable software through a multi-stage compilation pipeline.\n\n---\n\n## 2. Design Principles\n\n1. **Architecture is the program** — The specification IS the source code\n2. **Risks are first-class** — Failure modeling is mandatory, not optional\n3. **Validation is built-in** — Success criteria are part of the language\n4. **Strict grammar** — Deterministic parsing, not free-form natural language\n5. **AI-native compilation** — The compiler reasons about architecture, not just translates\n\n---\n\n## 3. Formal Grammar (BNF)\n\n```\n       ::= 
*\n
::= \n | \n | \n | \n | \n | \n | \n | \n | \n | \n | \n | \n | \n | \n | \n | \n\n ::= \"Goal:\" \n::= \"Constraint:\" \n ::= \"Risk:\" \n ::= \"Recovery:\" \n::= \"Validation:\" \n ::= \"Optimize:\" \n ::= \"Priority:\" \n\n ::= \"Layer:\" *\n ::= \"Sublayer:\" \n\n ::= \"Entity\" \n ::= INDENT + DEDENT\n ::= \":\" \n\n ::= \"Behavior\" \n ::= INDENT ( | | )+ DEDENT\n ::= \"Input:\" \n ::= \"Output:\" \n ::= \"Action:\" \n\n ::= \"Condition:\" \n ::= INDENT DEDENT\n ::= \"When\" \n ::= \"Then\" \n\n ::= \"Event:\" \n ::= INDENT DEDENT\n ::= \"On\" \n\n ::= \"Parallel:\" \n ::= INDENT + DEDENT\n\n ::= \"Learn:\" \n ::= INDENT \"Goal:\" DEDENT\n\n ::= \"Adapt:\" \n ::= INDENT \"Based:\" DEDENT\n\n ::= \"Security:\" \n ::= INDENT ( | )* DEDENT\n ::= \"Encrypt:\" \n ::= \"Protect:\" \n\n ::= \"Native:\" \n ::= \"{\" \"}\"\n\n ::= \"string\" | \"integer\" | \"float\" | \"boolean\"\n | \"datetime\" | \"list\" | \"dict\" | \"set\" | \"any\"\n | \"void\" | \"bytes\" | \n\n ::= ( | | \"_\")*\n ::= \n ::= \n ::= \n```\n\n---\n\n## 4. Keywords\n\nAICL has 27 reserved keywords:\n\n| Keyword | Level | Purpose |\n|---------|-------|---------|\n| Goal | 1 | Define system objective |\n| Constraint | 1 | Define system limitation |\n| Risk | 1 | Define failure condition |\n| Recovery | 1 | Define corrective action |\n| Layer | 1 | Define architectural layer |\n| Sublayer | 1 | Define sub-layer within a layer |\n| Validation | 1 | Define success criterion |\n| Entity | 2 | Define data entity |\n| Behavior | 3 | Define entity behavior |\n| Input | 3 | Define behavior input |\n| Output | 3 | Define behavior output |\n| Action | 3/5 | Define action to perform |\n| Condition | 4 | Define conditional behavior |\n| When | 4 | Condition trigger |\n| Then | 4 | Condition consequence |\n| Event | 5 | Define event-driven behavior |\n| On | 5 | Event trigger |\n| Parallel | 6 | Define concurrent execution |\n| Optimize | 7 | Define optimization target |\n| Priority | 7 | Define optimization priority |\n| Learn | 8 | Define learning objective |\n| Adapt | 8 | Define adaptive behavior |\n| Based | 8 | Adaptation criterion |\n| Security | 9 | Define security requirements |\n| Encrypt | 9 | Encryption directive |\n| Protect | 9 | Protection directive |\n| Native | 10 | Inline native code |\n\n---\n\n## 5. Language Levels\n\n### Level 1 — Architecture (Mandatory)\nCore architectural specification: Goal, Constraint, Risk, Recovery, Layer, Validation.\n\n### Level 2 — Entities\nData structure definitions with typed fields.\n\n### Level 3 — Behaviors\nDefine what entities do, with inputs, outputs, and actions.\n\n### Level 4 — Conditions\nReplace traditional if/else with When/Then clauses.\n\n### Level 5 — Events\nEvent-driven programming with On/Action pairs.\n\n### Level 6 — Concurrency\nParallel execution of layers, with compiler deciding threading strategy.\n\n### Level 7 — Optimization\nOptimization targets and priorities.\n\n### Level 8 — Learning\nMachine learning integration and adaptive behavior.\n\n### Level 9 — Security\nBuilt-in security directives (encryption, protection).\n\n### Level 10 — Native Code\nEscape hatch for low-level implementation in any language.\n\n---\n\n## 6. Compilation Pipeline\n\n1. **Specification Parsing** — Parse AICL source into AST\n2. **Architecture Validation** — Check structural completeness\n3. **Dependency Analysis** — Determine layer dependencies\n4. **Risk Analysis** — Pair risks with recovery procedures\n5. **Recovery Synthesis** — Generate recovery logic\n6. **Code Generation** — Generate target language code\n7. **Test Generation** — Generate tests from validations\n8. **Optimization** — Apply optimization strategies\n9. **Final Construction** — Produce final executable output\n\n---\n\n## 7. Minimal Valid Program\n\n```\nGoal:\nHello World\n\nLayer:\nCore\n\nValidation:\nOutput is produced\n```\n\n---\n\n## 8. File Extension\n\nAICL source files use the `.aicl` extension.\n\n---\n\n## 9. Comments\n\nLines starting with `#` are treated as comments and ignored by the parser.\n\n---\n\n## 10. Type System\n\n| AICL Type | Python Target | Description |\n|-----------|--------------|-------------|\n| string | str | Text data |\n| integer | int | Whole numbers |\n| float | float | Floating-point numbers |\n| boolean | bool | True/False values |\n| datetime | datetime | Date and time |\n| list | List[Any] | Ordered collection |\n| dict | Dict[str, Any] | Key-value mapping |\n| set | set | Unique collection |\n| any | Any | Dynamic type |\n| void | None | No return value |\n| bytes | bytes | Binary data |\n
", "title": "", "url": "https://raw.githubusercontent.com/AFKmoney/AICL/main/spec/grammar.md", "usage": { "tokens": 1842 } }, "meta": { "usage": { "tokens": 1842 } }, "status": 20000 }