How o24s/stelaro works
Stelaro is a Rust implementation of a custom programming-language compiler; LLVM-based code generation is documented as work in progress. The principal workflow is source input through lexing, parsing, name resolution, AST-to-SIR lowering, and type checking, with diagnostics and shared compiler context supporting those stages. The interface and library expose compiler orchestration, but the excerpts do not establish every call in that orchestration. Code-generation details were not sampled, so that capability is shown only as a documented, unverified branch.
Main entry points: sir.rs SIR Representation · parser.rs Parser · mod.rs Type Checker · lib.rs Compiler Library
Components 17
Source Front End
- Compiler Library
src/lib.rs - Compiler Interface
src/stelaro_interface/interface.rs - Compiler Passes
src/stelaro_interface/passes.rs - Lexer
src/stelaro_lexer/lexer.rs - Tokens and AST
src/stelaro_ast/ast.rs - Parser
src/stelaro_parse/parser.rs
Semantic Analysis
- Name Resolver
src/stelaro_resolve/mod.rs - AST Lowering
src/stelaro_ast_lowering/mod.rs - SIR Representation
src/stelaro_sir/sir.rs - Type Checker
src/stelaro_sir_typecheck/mod.rs - Type System
src/stelaro_ty/ty.rs
Compiler Infrastructure
- Compiler Context
src/stelaro_context/mod.rs - Session and Options
src/stelaro_session/config.rs - Source Map
src/stelaro_common/source_map.rs - Diagnostics
src/stelaro_diagnostics/diag.rs
Compiler Output
- LLVM Code Generation
src/stelaro_codegen
Other components
- Compiler User
Connections 19
- Compiler User → Compiler Library: invokes compiler
- Compiler Library → Compiler Interface: exposes
src/lib.rs - Compiler Library → Compiler Passes: exposes
src/lib.rs - Compiler Passes → Parser: uses parsing
src/stelaro_interface/passes.rs - Parser → Lexer: creates lexer
- Lexer → Tokens and AST: produces tokens
src/stelaro_lexer/lexer.rs - Parser → Tokens and AST: builds AST
src/stelaro_parse/parser.rs - Compiler Passes → Compiler Context: uses context
src/stelaro_interface/passes.rs - AST Lowering → SIR Representation: builds SIR
src/stelaro_ast_lowering/mod.rs - Name Resolver → SIR Representation: records resolutions
src/stelaro_resolve/mod.rs - Type Checker → SIR Representation: checks SIR
src/stelaro_sir_typecheck/mod.rs - Type Checker → Type System: infers types
src/stelaro_sir_typecheck/mod.rs - Compiler Context → SIR Representation: stores SIR
src/stelaro_context/mod.rs - Compiler Context → Session and Options: holds session
src/stelaro_context/mod.rs - Session and Options → Source Map: configures source map
src/stelaro_session/session.rs - Lexer → Diagnostics: emits errors
src/stelaro_lexer/lexer.rs - Parser → Diagnostics: reports parse errors
- Type Checker → Diagnostics: reports errors
src/stelaro_sir_typecheck/mod.rs - SIR Representation → LLVM Code Generation: feeds code generation