AXON β AI-Native Programming Language
A compiler-first, AI-native programming language designed for AI models to write hyper-efficient native applications. Humans can't easily read or write it β that's the point.
What is AXON?
AXON (AI-Native eXecution Optimized Notation) strips away everything designed for human ergonomics β meaningful variable names, syntax sugar, implicit conversions, flexible formatting. What remains is a minimal, unambiguous, fully-explicit notation that a language model can emit deterministically, and a compiler can transform into optimal machine code with zero guesswork.
The source format is S-expressions (.axs files) β a fully parenthesized prefix notation that eliminates parsing ambiguity.
Phase 2 will introduce a binary AST format (.axb files) that removes lexing and parsing entirely.
Key Features
Dual Backend
QBE IL for fast dev builds, LLVM IR for optimized release builds
Enum Types
Nominal enums with explicit integer backing, eq/ne comparison, cast to int
Sum Types
Tagged unions with variant payloads, exhaustive matching, and payload extraction
Pattern Matching
Exhaustive match on enums, sum types, bools, integers with wildcard fallback
Function Pointers
First-class fnptr type with auto-coercion and indirect calls
Structs & Arrays
Value-type structs, fixed-size arrays with pointer access
Type-Safe Casting
Explicit cast between intβint, floatβfloat, intβfloat, enumβint
Cross-Platform
macOS (ARM64) and Linux (x86_64 / ARM64)
Zero Runtime Overhead
No GC, no dynamic dispatch, no bounds checking overhead
Compiler Pipeline
Featured Example
Enum types with exhaustive pattern matching β a key feature of AXON's type system.
(module (extern print_i64 ((n i64)) void) (enum Color i32 ((Red 0) (Green 1) (Blue 2))) (fn color_value ((c Color)) i64 (match c ((Color Red) (i64 10)) ((Color Green) (i64 20)) ((Color Blue) (i64 30)))) (fn main () i32 (block (call print_i64 (call color_value (Color Red))) (call print_i64 (call color_value (Color Green))) (call print_i64 (call color_value (Color Blue))) (i32 0))))
Output: 10 20 30
Project Stats
Project Structure
axon-lang/ βββ Makefile # Build system βββ README.md # Project overview βββ .gitlab-ci.yml # CI/CD pipeline βββ docs/ β βββ language-spec.md # Complete language specification β βββ ai-guide.md # AI agent programming guide β βββ binary-format.md # Binary AST format spec βββ src/ β βββ axon.h # Master header (types & interfaces) β βββ main.c # Compiler driver & CLI β βββ arena.c # Arena allocator β βββ lexer.c # S-expression lexer β βββ parser.c # S-expression parser β AST β βββ types.c # Type system & checker β βββ ir.c # IR construction & lowering β βββ ast.c # AST printer & utilities β βββ emit_qbe.c # QBE IL code generation β βββ emit_llvm.c # LLVM IR code generation βββ runtime/ β βββ rt.c # Runtime library (print_i64, etc.) βββ tests/ βββ programs/ # 65 program tests (.axs + .expected) βββ errors/ # 11 error tests (.axs + .error)
Roadmap
Phase 1 β Foundation Current
S-expression parser, type system, type checker, SSA IR, QBE & LLVM backends, enums, sum types, pattern matching, function pointers, structs, arrays, constants, pointers, strings, float types.
Phase 2 β Type System Expansion Active
Generics (monomorphized), distinct types, optional types, closures, modules & imports, C callback support, trait system.
Phase 3 β Advanced Features
Binary AST format (.axb), linear types, region-based memory, GUI framework, package manager, standard library.