# justsomeone-e/rovelang architecture

> Architecture diagram of the GitHub repository justsomeone-e/rovelang, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/justsomeone-e/rovelang
- Repository: https://github.com/justsomeone-e/rovelang

## Overview

Rove is a statically typed compiled language. Its principal workflow takes source through lexing, parsing, type checking and module resolution into verified Typed HIR, then lowers to target code for native, WebAssembly, JavaScript, Python or Rust workflows. Users can enter through the CLI or compiler API; the repository also includes language-server tooling, an interactive tour and native self-hosting. The README documents the semantic pipeline; unsampled implementation details are represented only where the tree supports a subsystem.

Main entry points: [`src/codegen/codegen.py`](https://github.com/justsomeone-e/rovelang/blob/main/src/codegen/codegen.py) (Codegen selection), [`src/compiler.py`](https://github.com/justsomeone-e/rovelang/blob/main/src/compiler.py) (Compiler orchestration), [`src/core/type_checker.py`](https://github.com/justsomeone-e/rovelang/blob/main/src/core/type_checker.py) (Type checker), [`src/cli.py`](https://github.com/justsomeone-e/rovelang/blob/main/src/cli.py) (CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Language Front End"]
  node_compiler["Compiler orchestration<br/>[compiler.py]"]
  node_lexer["Lexer<br/>[lexer.py]"]
  node_parser["Parser<br/>[parser.py]"]
  node_checker["Type checker<br/>[type_checker.py]"]
  node_modules["Module loader<br/>[module_loader.py]"]
end

subgraph group_ir["IR and Backends"]
  node_hir["Typed HIR<br/>[model.py]"]
  node_hir_lower["HIR lowering<br/>[lowering.py]"]
  node_hir_verify["HIR verifier<br/>[verifier.py]"]
  node_mir["MIR lowering<br/>[lowering.py]"]
  node_mir_verify["MIR verifier<br/>[verifier.py]"]
  node_codegen["Codegen selection<br/>[codegen.py]"]
  node_cpp["C++ backend<br/>[hir_cpp.py]"]
  node_wasm["WASM backend<br/>[codegen_wasm.py]"]
  node_js["JavaScript backend<br/>[hir_javascript.py]"]
  node_python["Python backend<br/>[hir_python.py]"]
  node_rust["Rust backend<br/>[hir_rust.py]"]
end

subgraph group_interfaces["User Tooling"]
  node_cli["CLI<br/>[cli.py]"]
  node_api["Compiler API<br/>[api.py]"]
  node_lsp["Language server<br/>[lsp_server.py]"]
  node_vscode["VS Code extension<br/>[extension.js]"]
end

subgraph group_extras["Learning and Hosting"]
  node_tour["Interactive tour<br/>[tour.py]"]
  node_tour_runner["Tour runner<br/>[runner.py]"]
  node_selfhost["Self-host bootstrap<br/>[bootstrap.py]"]
end

node_developer(("Rove developer"))
node_source["Rove source"]
node_output["Generated program"]

node_developer -->|"invokes"| node_cli
node_developer -->|"uses"| node_api
node_developer -->|"edits with"| node_vscode
node_developer -->|"learns with"| node_tour
node_source -->|"supplies"| node_cli
node_source -->|"supplies"| node_api
node_cli -->|"calls"| node_compiler
node_api -->|"calls"| node_compiler
node_compiler -->|"tokenizes"| node_lexer
node_lexer -->|"tokens"| node_parser
node_parser -->|"AST"| node_checker
node_checker -->|"resolves imports"| node_modules
node_checker -->|"checked program"| node_hir_lower
node_hir_lower -->|"builds HIR"| node_hir
node_hir -->|"verified against"| node_hir_verify
node_compiler -->|"lowers HIR"| node_mir
node_mir -->|"verifies MIR"| node_mir_verify
node_compiler -->|"selects backend"| node_codegen
node_codegen -->|"dispatches"| node_cpp
node_codegen -->|"dispatches"| node_wasm
node_codegen -->|"dispatches"| node_js
node_codegen -->|"dispatches"| node_python
node_codegen -->|"dispatches"| node_rust
node_cpp -->|"emits"| node_output
node_wasm -->|"emits"| node_output
node_js -->|"emits"| node_output
node_python -->|"emits"| node_output
node_rust -->|"emits"| node_output
node_vscode -->|"connects"| node_lsp
node_tour -->|"runs exercises"| node_tour_runner
node_selfhost -.->|"bootstraps"| node_compiler

click node_cli "https://github.com/justsomeone-e/rovelang/blob/main/src/cli.py"
click node_api "https://github.com/justsomeone-e/rovelang/blob/main/src/api.py"
click node_compiler "https://github.com/justsomeone-e/rovelang/blob/main/src/compiler.py"
click node_lexer "https://github.com/justsomeone-e/rovelang/blob/main/src/core/lexer.py"
click node_parser "https://github.com/justsomeone-e/rovelang/blob/main/src/core/parser.py"
click node_checker "https://github.com/justsomeone-e/rovelang/blob/main/src/core/type_checker.py"
click node_modules "https://github.com/justsomeone-e/rovelang/blob/main/src/core/module_loader.py"
click node_hir "https://github.com/justsomeone-e/rovelang/blob/main/src/ir/model.py"
click node_hir_lower "https://github.com/justsomeone-e/rovelang/blob/main/src/ir/lowering.py"
click node_hir_verify "https://github.com/justsomeone-e/rovelang/blob/main/src/ir/verifier.py"
click node_mir "https://github.com/justsomeone-e/rovelang/blob/main/src/mir/lowering.py"
click node_mir_verify "https://github.com/justsomeone-e/rovelang/blob/main/src/mir/verifier.py"
click node_codegen "https://github.com/justsomeone-e/rovelang/blob/main/src/codegen/codegen.py"
click node_cpp "https://github.com/justsomeone-e/rovelang/blob/main/src/codegen/hir_cpp.py"
click node_wasm "https://github.com/justsomeone-e/rovelang/blob/main/src/mir/codegen_wasm.py"
click node_js "https://github.com/justsomeone-e/rovelang/blob/main/src/codegen/hir_javascript.py"
click node_python "https://github.com/justsomeone-e/rovelang/blob/main/src/codegen/hir_python.py"
click node_rust "https://github.com/justsomeone-e/rovelang/blob/main/src/codegen/hir_rust.py"
click node_lsp "https://github.com/justsomeone-e/rovelang/blob/main/src/toolchain/lsp_server.py"
click node_vscode "https://github.com/justsomeone-e/rovelang/blob/main/vscode-extension/extension.js"
click node_tour "https://github.com/justsomeone-e/rovelang/blob/main/tour/tour.py"
click node_tour_runner "https://github.com/justsomeone-e/rovelang/blob/main/tour/runner.py"
click node_selfhost "https://github.com/justsomeone-e/rovelang/blob/main/src/self_host/bootstrap.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_compiler,node_lexer,node_parser,node_checker,node_modules toneBlue
class node_hir,node_hir_lower,node_hir_verify,node_mir,node_mir_verify,node_codegen,node_cpp,node_wasm,node_js,node_python,node_rust toneAmber
class node_cli,node_api,node_lsp,node_vscode toneMint
class node_tour,node_tour_runner,node_selfhost toneRose
class node_developer,node_source,node_output toneIndigo
```

## Components

### Language Front End

- [Compiler orchestration](https://github.com/justsomeone-e/rovelang/blob/main/src/compiler.py): `src/compiler.py`
- [Lexer](https://github.com/justsomeone-e/rovelang/blob/main/src/core/lexer.py): `src/core/lexer.py`
- [Parser](https://github.com/justsomeone-e/rovelang/blob/main/src/core/parser.py): `src/core/parser.py`
- [Type checker](https://github.com/justsomeone-e/rovelang/blob/main/src/core/type_checker.py): `src/core/type_checker.py`
- [Module loader](https://github.com/justsomeone-e/rovelang/blob/main/src/core/module_loader.py): `src/core/module_loader.py`

### IR and Backends

- [Typed HIR](https://github.com/justsomeone-e/rovelang/blob/main/src/ir/model.py): `src/ir/model.py`
- [HIR lowering](https://github.com/justsomeone-e/rovelang/blob/main/src/ir/lowering.py): `src/ir/lowering.py`
- [HIR verifier](https://github.com/justsomeone-e/rovelang/blob/main/src/ir/verifier.py): `src/ir/verifier.py`
- [MIR lowering](https://github.com/justsomeone-e/rovelang/blob/main/src/mir/lowering.py): `src/mir/lowering.py`
- [MIR verifier](https://github.com/justsomeone-e/rovelang/blob/main/src/mir/verifier.py): `src/mir/verifier.py`
- [Codegen selection](https://github.com/justsomeone-e/rovelang/blob/main/src/codegen/codegen.py): `src/codegen/codegen.py`
- [C++ backend](https://github.com/justsomeone-e/rovelang/blob/main/src/codegen/hir_cpp.py): `src/codegen/hir_cpp.py`
- [WASM backend](https://github.com/justsomeone-e/rovelang/blob/main/src/mir/codegen_wasm.py): `src/mir/codegen_wasm.py`
- [JavaScript backend](https://github.com/justsomeone-e/rovelang/blob/main/src/codegen/hir_javascript.py): `src/codegen/hir_javascript.py`
- [Python backend](https://github.com/justsomeone-e/rovelang/blob/main/src/codegen/hir_python.py): `src/codegen/hir_python.py`
- [Rust backend](https://github.com/justsomeone-e/rovelang/blob/main/src/codegen/hir_rust.py): `src/codegen/hir_rust.py`

### User Tooling

- [CLI](https://github.com/justsomeone-e/rovelang/blob/main/src/cli.py): `src/cli.py`
- [Compiler API](https://github.com/justsomeone-e/rovelang/blob/main/src/api.py): `src/api.py`
- [Language server](https://github.com/justsomeone-e/rovelang/blob/main/src/toolchain/lsp_server.py): `src/toolchain/lsp_server.py`
- [VS Code extension](https://github.com/justsomeone-e/rovelang/blob/main/vscode-extension/extension.js): `vscode-extension/extension.js`

### Learning and Hosting

- [Interactive tour](https://github.com/justsomeone-e/rovelang/blob/main/tour/tour.py): `tour/tour.py`
- [Tour runner](https://github.com/justsomeone-e/rovelang/blob/main/tour/runner.py): `tour/runner.py`
- [Self-host bootstrap](https://github.com/justsomeone-e/rovelang/blob/main/src/self_host/bootstrap.py): `src/self_host/bootstrap.py`

### Other components

- **Rove developer**
- **Rove source**
- **Generated program**

## Connections

- Rove developer → CLI: invokes
- Rove developer → Compiler API: uses
- Rove developer → VS Code extension: edits with
- Rove developer → Interactive tour: learns with
- Rove source → CLI: supplies
- Rove source → Compiler API: supplies
- CLI → Compiler orchestration: calls
- Compiler API → Compiler orchestration: calls
- Compiler orchestration → Lexer: tokenizes
- Lexer → Parser: tokens
- Parser → Type checker: AST
- Type checker → Module loader: resolves imports
- Type checker → HIR lowering: checked program
- HIR lowering → Typed HIR: builds HIR
- Typed HIR → HIR verifier: verified against
- Compiler orchestration → MIR lowering: lowers HIR
- MIR lowering → MIR verifier: verifies MIR
- Compiler orchestration → Codegen selection: selects backend
- Codegen selection → C++ backend: dispatches
- Codegen selection → WASM backend: dispatches
- Codegen selection → JavaScript backend: dispatches
- Codegen selection → Python backend: dispatches
- Codegen selection → Rust backend: dispatches
- C++ backend → Generated program: emits
- WASM backend → Generated program: emits
- JavaScript backend → Generated program: emits
- Python backend → Generated program: emits
- Rust backend → Generated program: emits
- VS Code extension → Language server: connects
- Interactive tour → Tour runner: runs exercises
- Self-host bootstrap → Compiler orchestration: bootstraps
