How unbcic-tp2/r-python works
Main Components
• Main Entry Point: Represent the main.rs file as the primary entry that orchestrates the compilation process.
• Intermediate Representation (IR): Include a component for the IR layer from src/ir (and its ast.rs file). This layer represents the internal structure of the program after parsing.
• Supporting Artifacts: Indicate areas for configuration and build (Cargo.toml, Cargo.lock, CI workflows) which, though not part of the runtime flow, affect development and deployment.
Relationships and Data Flow
• Start from the Main Entry Point, which passes the source code to the Parser.
• The Parser outputs an AST that is encapsulated in the IR component.
• The output from the IR is then sent to the Type Checker for validation.
• Upon successful type checking, control is transferred to the Interpreter for execution (or further transformation/compilation).
Architectural Patterns and Design Principles
• Layered Architecture: Emphasize how each component (parsing, IR generation, type checking, execution) is isolated into separate modules.
• Modularity and Separation of Concerns: Each directory (parser, ir, tc, interpreter) has a clearly defined role.
• Educational/Experimental Nature: Acknowledge that this design facilitates experimentation within different compilation phases.
Relevant Technologies
• Continuous integration components (e.g., GitHub workflows) as part of the development ecosystem, though they might not be part of the runtime architecture.