Q++ Architecture¶
Compiler Pipeline¶
- Lexer — Tokenizes source into tokens (identifiers, keywords, literals, operators)
- Parser — Builds AST from token stream (recursive descent)
- Semantic Analysis — Type checking, symbol resolution
- Code Generator — Emits LLVM IR, then object code
Backend¶
- LLVM backend — Compiles directly to machine code via LLVM IR
- Emits object file to
build/output.o, then links withlld(LLVM linker) and runtime - No C compilation; no gcc/clang/MSVC required for end users
- Bundled
lld-link.exe(Windows) orld.lld(Linux) for linking
Runtime¶
- Precompiled
runtime.obj/runtime.oprovides stdlib helpers (str, vec, fmt, etc.) - Built from C sources in
runtime/at release time; shipped with installer/portable - Linked with user code at compile time
Package Manager¶
qpp.toml— Manifest with package metadata and dependenciesqpp.lock— Lock file for reproducible builds- Resolves dependencies from registry or Git
Output¶
- Compiles to native executables via LLVM (object file → lld → executable)
- Optional
--emit-llvmoutputs.llIR for debugging