Compiler Architecture
This document describes the current high-level structure of the Arden compiler.
It is intentionally architectural, not a changelog dump.
Pipeline
Arden roughly follows this flow:
- lex source into tokens
- parse tokens into an AST
- resolve and type-check declarations and expressions
- run borrow checking
- lower to LLVM IR
- compile and link a native artifact
Main Source Areas
Frontend
src/lexer/- tokenizationsrc/parser/- AST constructionsrc/ast/- AST definitions
Semantic Analysis
src/typeck/- type collection, resolution, checking, effectssrc/borrowck/- ownership and borrowing validationsrc/import_check/- import validationsrc/project_rewrite/- project-mode rewriting / symbol normalization
Project / Build Logic
src/project/-arden.tomlloading and project configurationsrc/cache/- project cache and reuse metadatasrc/dependency/- dependency graph and invalidation logicsrc/symbol_lookup/- symbol indexing and lookup support
Backend
src/codegen/- LLVM IR loweringsrc/linker/- final artifact linkingsrc/stdlib/- intrinsic stdlib wiring used by semantic/codegen stages
Tooling
src/formatter/-arden fmtsrc/lint/-arden lint/arden fixsrc/test_runner/-arden testsrc/bindgen/-arden bindgensrc/lsp/-arden lsp
Tests
src/tests/- integration-style compiler tests- module-local
tests.rsfiles - unit and behavior-focused coverage
Project Mode
Project mode is driven by arden.toml.
Important behavior:
- files are listed explicitly
- the entrypoint is explicit
- project commands such as
build,run,check,test,fmt, andinfouse project configuration - project builds can reuse cached work from
.ardencache/
Related docs:
Native Toolchain
Arden lowers through LLVM and links through Clang.
Current linker policy is explicit:
- Linux requires
mold - macOS requires LLVM
lld - Windows requires LLVM
lld
This is also reflected in CI and release workflows.
Build Cache
Project builds maintain cache data under .ardencache/.
At a high level, that cache is used to:
- detect unchanged builds
- reuse parsed or rewritten project state where possible
- reduce rebuild work after partial edits
For user-facing timing inspection:
arden build --timings
arden check --timings
CLI Entry
The main CLI entrypoint is:
src/main.rs
That command surface is documented in: