# ponvasanthpon/transcompilator architecture

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

- Interactive diagram: https://gitdiagram.com/ponvasanthpon/transcompilator
- Repository: https://github.com/ponvasanthpon/transcompilator

## Overview

TransCompilator compiles structured English into deterministic Core-7 IR and then to static x86_64 ELF64 executables; the reference interpreter runs the same IR. The graph follows the documented source-to-result stages and preserves the CLI, editor, and language-server surfaces. Semantic internals are grouped by role; their exact implementation paths come from the tree, while relationships not shown in excerpts are limited to README-documented links. The editor and LSP are documented as using compiler crates without shelling out.

Main entry points: [`crates/tc-semantics/src/lower/mod.rs`](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/lower/mod.rs) (Semantic Lowering), [`crates/tc-cli/src/main.rs`](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-cli/src/main.rs) (tc CLI), [`crates/tc-ir/src/verify.rs`](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-ir/src/verify.rs) (IR Verification), [`crates/tc-syntax/src/clause.rs`](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-syntax/src/clause.rs) (Clause Syntax)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_front["English Front End"]
  node_segment["Paragraph Segmentation<br/>[segment.rs]"]
  node_syntax["Clause Syntax<br/>[clause.rs]"]
  node_lexicon[("English Lexicon<br/>[lib.rs]")]
end

subgraph group_semantic["Semantic Analysis"]
  node_intent["Intent Gate<br/>[intent.rs]"]
  node_discourse["Discourse Resolution<br/>[discourse.rs]"]
  node_clause_graph["Clause Graph Analysis<br/>[clause_graph.rs]"]
  node_sem_lower["Semantic Lowering<br/>[mod.rs]"]
  node_expr["Expression Parsing<br/>[expr.rs]"]
  node_quantifier["Quantifier Lowering<br/>[quantifier.rs]"]
end

subgraph group_core["Typed Core"]
  node_type_ast["Typed AST<br/>[ast.rs]"]
  node_resolve["Module Resolution<br/>[resolve.rs]"]
  node_typecheck["Type Checking<br/>[check.rs]"]
  node_ir["Core-7 IR<br/>[ir.rs]"]
  node_verify["IR Verification<br/>[verify.rs]"]
end

subgraph group_runtime["Execution Targets"]
  node_emit["x86 Assembly Emitter<br/>[emit.rs]"]
  node_link["Static ELF Linker<br/>[link.rs]"]
  node_interpreter["Reference Interpreter<br/>[interp.rs]"]
  node_binary["ELF64 Executable"]
end

subgraph group_tools["Developer Tools"]
  node_cli["tc CLI<br/>[main.rs]"]
  node_editor["Terminal Editor<br/>[app.rs]"]
  node_lsp["Language Server<br/>[handlers.rs]"]
  node_zed["Zed Integration<br/>[lib.rs]"]
end

node_user(("Program Author"))

node_user -->|"invokes"| node_cli
node_cli -->|"submits source"| node_segment
node_segment -->|"segments clauses"| node_syntax
node_syntax -->|"feeds analysis"| node_intent
node_lexicon -->|"supports parsing"| node_syntax
node_lexicon -->|"supports classification"| node_intent
node_intent -->|"classifies intent"| node_discourse
node_discourse -->|"resolves references"| node_clause_graph
node_clause_graph -->|"informs lowering"| node_sem_lower
node_sem_lower -->|"parses expressions"| node_expr
node_sem_lower -->|"lowers quantifiers"| node_quantifier
node_sem_lower -->|"produces typed AST"| node_type_ast
node_type_ast -->|"resolves modules"| node_resolve
node_resolve -->|"provides resolved program"| node_typecheck
node_typecheck -->|"lowers verified program"| node_ir
node_ir -->|"validates"| node_verify
node_verify -->|"feeds code generation"| node_emit
node_emit -->|"emits assembly"| node_link
node_link -->|"links executable"| node_binary
node_verify -->|"executes IR"| node_interpreter
node_cli -->|"runs program"| node_interpreter
node_cli -->|"builds target"| node_link
node_user -->|"edits source"| node_editor
node_editor -.->|"uses compiler crates"| node_sem_lower
node_user -->|"requests analysis"| node_lsp
node_lsp -.->|"uses compiler crates"| node_sem_lower
node_zed -.->|"integrates language server"| node_lsp

click node_cli "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-cli/src/main.rs"
click node_segment "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-syntax/src/segment.rs"
click node_syntax "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-syntax/src/clause.rs"
click node_lexicon "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-lexicon/src/lib.rs"
click node_intent "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/intent.rs"
click node_discourse "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/discourse.rs"
click node_clause_graph "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/clause_graph.rs"
click node_sem_lower "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/lower/mod.rs"
click node_expr "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/expr.rs"
click node_quantifier "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/quantifier.rs"
click node_type_ast "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-typeck/src/ast.rs"
click node_resolve "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-typeck/src/resolve.rs"
click node_typecheck "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-typeck/src/check.rs"
click node_ir "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-ir/src/ir.rs"
click node_verify "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-ir/src/verify.rs"
click node_emit "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-codegen-x86/src/emit.rs"
click node_link "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-codegen-x86/src/link.rs"
click node_interpreter "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-ir/src/interp.rs"
click node_editor "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-editor/src/app.rs"
click node_lsp "https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-lsp/src/handlers.rs"
click node_zed "https://github.com/ponvasanthpon/transcompilator/blob/main/editors/zed/tc-eng-extension/src/lib.rs"

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_segment,node_syntax,node_lexicon toneBlue
class node_intent,node_discourse,node_clause_graph,node_sem_lower,node_expr,node_quantifier toneAmber
class node_type_ast,node_resolve,node_typecheck,node_ir,node_verify toneMint
class node_emit,node_link,node_interpreter,node_binary toneRose
class node_cli,node_editor,node_lsp,node_zed,node_user toneIndigo
```

## Components

### English Front End

- [Paragraph Segmentation](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-syntax/src/segment.rs): `crates/tc-syntax/src/segment.rs`
- [Clause Syntax](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-syntax/src/clause.rs): `crates/tc-syntax/src/clause.rs`
- [English Lexicon](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-lexicon/src/lib.rs): `crates/tc-lexicon/src/lib.rs`

### Semantic Analysis

- [Intent Gate](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/intent.rs): `crates/tc-semantics/src/intent.rs`
- [Discourse Resolution](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/discourse.rs): `crates/tc-semantics/src/discourse.rs`
- [Clause Graph Analysis](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/clause_graph.rs): `crates/tc-semantics/src/clause_graph.rs`
- [Semantic Lowering](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/lower/mod.rs): `crates/tc-semantics/src/lower/mod.rs`
- [Expression Parsing](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/expr.rs): `crates/tc-semantics/src/expr.rs`
- [Quantifier Lowering](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-semantics/src/quantifier.rs): `crates/tc-semantics/src/quantifier.rs`

### Typed Core

- [Typed AST](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-typeck/src/ast.rs): `crates/tc-typeck/src/ast.rs`
- [Module Resolution](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-typeck/src/resolve.rs): `crates/tc-typeck/src/resolve.rs`
- [Type Checking](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-typeck/src/check.rs): `crates/tc-typeck/src/check.rs`
- [Core-7 IR](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-ir/src/ir.rs): `crates/tc-ir/src/ir.rs`
- [IR Verification](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-ir/src/verify.rs): `crates/tc-ir/src/verify.rs`

### Execution Targets

- [x86 Assembly Emitter](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-codegen-x86/src/emit.rs): `crates/tc-codegen-x86/src/emit.rs`
- [Static ELF Linker](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-codegen-x86/src/link.rs): `crates/tc-codegen-x86/src/link.rs`
- [Reference Interpreter](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-ir/src/interp.rs): `crates/tc-ir/src/interp.rs`
- **ELF64 Executable**

### Developer Tools

- [tc CLI](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-cli/src/main.rs): `crates/tc-cli/src/main.rs`
- [Terminal Editor](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-editor/src/app.rs): `crates/tc-editor/src/app.rs`
- [Language Server](https://github.com/ponvasanthpon/transcompilator/blob/main/crates/tc-lsp/src/handlers.rs): `crates/tc-lsp/src/handlers.rs`
- [Zed Integration](https://github.com/ponvasanthpon/transcompilator/blob/main/editors/zed/tc-eng-extension/src/lib.rs): `editors/zed/tc-eng-extension/src/lib.rs`

### Other components

- **Program Author**

## Connections

- Program Author → tc CLI: invokes (evidence: `README.md`)
- tc CLI → Paragraph Segmentation: submits source (evidence: `README.md`)
- Paragraph Segmentation → Clause Syntax: segments clauses (evidence: `README.md`)
- Clause Syntax → Intent Gate: feeds analysis (evidence: `README.md`)
- English Lexicon → Clause Syntax: supports parsing (evidence: `README.md`)
- English Lexicon → Intent Gate: supports classification (evidence: `README.md`)
- Intent Gate → Discourse Resolution: classifies intent (evidence: `README.md`)
- Discourse Resolution → Clause Graph Analysis: resolves references (evidence: `README.md`)
- Clause Graph Analysis → Semantic Lowering: informs lowering (evidence: `README.md`)
- Semantic Lowering → Expression Parsing: parses expressions (evidence: `crates/tc-semantics/src/lower/mod.rs`)
- Semantic Lowering → Quantifier Lowering: lowers quantifiers (evidence: `README.md`)
- Semantic Lowering → Typed AST: produces typed AST (evidence: `README.md`)
- Typed AST → Module Resolution: resolves modules (evidence: `README.md`)
- Module Resolution → Type Checking: provides resolved program (evidence: `crates/tc-typeck/src/check.rs`)
- Type Checking → Core-7 IR: lowers verified program (evidence: `README.md`)
- Core-7 IR → IR Verification: validates (evidence: `README.md`)
- IR Verification → x86 Assembly Emitter: feeds code generation (evidence: `README.md`)
- x86 Assembly Emitter → Static ELF Linker: emits assembly (evidence: `README.md`)
- Static ELF Linker → ELF64 Executable: links executable (evidence: `README.md`)
- IR Verification → Reference Interpreter: executes IR (evidence: `README.md`)
- tc CLI → Reference Interpreter: runs program (evidence: `README.md`)
- tc CLI → Static ELF Linker: builds target (evidence: `README.md`)
- Program Author → Terminal Editor: edits source (evidence: `README.md`)
- Terminal Editor → Semantic Lowering: uses compiler crates (evidence: `README.md`)
- Program Author → Language Server: requests analysis (evidence: `README.md`)
- Language Server → Semantic Lowering: uses compiler crates (evidence: `README.md`)
- Zed Integration → Language Server: integrates language server (evidence: `README.md`)
