diff --git a/C4/container.md b/C4/container.md new file mode 100644 index 00000000000000..1f5ec996a85ae9 --- /dev/null +++ b/C4/container.md @@ -0,0 +1,54 @@ + +## Level 2: Container Diagram + +```mermaid +graph TB + subgraph "CPython Runtime System" + subgraph "Core Interpreter" + PARSER[Parser
PEG Grammar
AST Generation] + COMPILER[Compiler
AST to Bytecode
Optimization] + VM[Virtual Machine
Bytecode Execution
Tier 1 & Tier 2] + end + + subgraph "Runtime Services" + GC[Garbage Collector
Reference Counting
Cycle Detection] + MEM[Memory Manager
Object Allocation
Free Lists] + THREAD[Threading System
GIL Management
Thread States] + end + + subgraph "Object System" + OBJ[Object Model
Type System
Method Resolution] + BUILTIN[Built-in Types
int, str, list, dict
etc.] + end + + subgraph "Module System" + IMPORT[Import System
Module Loading
Path Resolution] + STDLIB[Standard Library
Built-in Modules
Extension Modules] + end + + subgraph "C API" + CAPI[C API
Extension Interface
Embedding Support] + end + end + + subgraph "External Dependencies" + OS2[Operating System] + LIBS[System Libraries] + end + + PARSER -->|"AST"| COMPILER + COMPILER -->|"Bytecode"| VM + VM -->|"Object Operations"| OBJ + VM -->|"Memory Requests"| MEM + VM -->|"GC Triggers"| GC + VM -->|"Thread Management"| THREAD + + OBJ -->|"Type Operations"| BUILTIN + IMPORT -->|"Module Loading"| STDLIB + IMPORT -->|"Extension Loading"| CAPI + + MEM -->|"System Calls"| OS2 + THREAD -->|"Thread APIs"| OS2 + STDLIB -->|"System Libraries"| LIBS + CAPI -->|"Extension Interface"| LIBS +```