Compiler architecture
A classic multi-pass pipeline (each stage a module under src/); src/driver.rs runs the shared front-end (read → lex → parse → resolve imports → typecheck) for all CLI commands and renders any failure through src/diagnostic.rs (the rustc-style path:line:col reporter described under Error messages).
- Lexer —
src/lexer/(logos),Lexer::tokenize(&str). - Parser —
src/parser/ast_parser.rs, hand-written recursive descent,parse(&tokens). - AST —
src/ast/nodes.rs. - Type checker —
src/typechecker/checker.rsplus its per-area child modules. - Code generator —
src/codegen/generator.rsplus its per-area child modules (inkwell, LLVM 22) → LLVM IR. - Runtime intrinsics —
src/runtime/(__write_bytes, grapheme counting, GC glue), packaged aslibquilon_rt. - LLVM —
quilon buildemits an object in-process and linkslibquilon_rtinto a native binary;quilon runuses an in-process JIT.
See CLAUDE.md for contributor guidance.