How vbxq/aelys_lang works
Aelys is a programming-language compiler, exposed through a command-line compiler and a public API. Its principal workflow turns source files into native code: the driver resolves imports, frontend stages produce syntax structures, semantic analysis type-checks and infers types, and successive IR/backend stages prepare and emit native output. The README emphasizes managed-memory and nogc checking, modules, and LLVM-based native compilation. The supplied excerpts do not show the compile command’s orchestration or all driver calls, so uncertain wiring is omitted; documented but unsampled capabilities are represented at their enclosing source directories.
Main entry points: mod.rs Compiler Driver · infer.rs Type Inference · link.rs LLVM Link And Runtime · compile.rs Compile Command
Components 21
Source Frontend
- Lexer
frontend/src/lexer/mod.rs - Parser
frontend/src/parser/mod.rs - Syntax AST
syntax/src/ast/mod.rs
Modules And Semantics
- Module Resolution
driver/src/modules/resolve.rs - Module Graph
driver/src/modules/graph.rs - Type Inference
sema/src/infer.rs - Typed AST
sema/src/typed_ast/mod.rs - Diagnostics
common/src/diagnostic/mod.rs
IR And Optimization
- AST Optimizer
opt/src/passes/optimizer.rs - AIR Lowering
air/src/lower/program.rs - AIR Checks And Passes
air/src/passes/mod.rs
Native Backend
- LLVM Codegen
codegen/src/api/context.rs - LLVM Link And Runtime
driver/src/api/llvm/link.rs
CLI And Runtime
- Aelys CLI
cli/src/main.rs - Compile Command
cli/src/cli/commands/compile.rs - Public API
aelys/src/api/mod.rs - Compiler Driver
driver/src/api/mod.rs - Managed Memory Runtime
core/src/lib.rs
Other components
- Programmer
- Aelys Sources
- Native Program
Connections 22
- Programmer → Aelys CLI: invokes
- Aelys CLI → Compile Command: dispatches
- Compile Command → Compiler Driver: requests compilation
- Compiler Driver → Module Resolution: resolves imports
- Module Resolution → Module Graph: builds graph
- Compiler Driver → Lexer: lexes sources
- Lexer → Parser: supplies tokens
- Parser → Syntax AST: builds AST
- Compiler Driver → Type Inference: type-checks
- Type Inference → Typed AST: produces
- Type Inference → Diagnostics: reports errors
- Compiler Driver → AST Optimizer: optimizes AST
- Compiler Driver → AIR Lowering: lowers program
- AIR Lowering → AIR Checks And Passes: produces AIR
- Compiler Driver → LLVM Codegen: generates LLVM
- LLVM Codegen → LLVM Link And Runtime: supplies module
- LLVM Link And Runtime → Native Program: emits and links
- LLVM Link And Runtime → Managed Memory Runtime: links runtime
- Programmer → Aelys Sources: writes
- Compile Command → Aelys Sources: compiles
- Programmer → Native Program: runs
- Public API → Compiler Driver: re-exports API