# arxlang/arxlang-jupyter-kernel architecture

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

- Interactive diagram: https://gitdiagram.com/arxlang/arxlang-jupyter-kernel
- Repository: https://github.com/arxlang/arxlang-jupyter-kernel

## Overview

ArxLang Jupyter Kernel accepts notebook cells, combines each with the successful-session prelude, compiles and runs the combined source through the Arx CLI, then reports output or errors to Jupyter. Its session manager can restore and persist successful source. The README documents the compile/run behavior; the sampled kernel source confirms its calls into session and execution components. The compile/run implementation itself was not excerpted, so its internal details are limited to documented behavior.

Main entry points: [`src/arxlang_jupyter_kernel/kernel.py`](https://github.com/arxlang/arxlang-jupyter-kernel/blob/main/src/arxlang_jupyter_kernel/kernel.py) (Arx Kernel), [`src/arxlang_jupyter_kernel/compile_run.py`](https://github.com/arxlang/arxlang-jupyter-kernel/blob/main/src/arxlang_jupyter_kernel/compile_run.py) (Compile and Run), [`src/arxlang_jupyter_kernel/session.py`](https://github.com/arxlang/arxlang-jupyter-kernel/blob/main/src/arxlang_jupyter_kernel/session.py) (Session Source)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kernel["Kernel Runtime"]
  node_kernel["Arx Kernel<br/>[kernel.py]"]
end

subgraph group_execution["Arx Execution"]
  node_compile_run["Compile and Run<br/>[compile_run.py]"]
  node_arx_cli["Arx CLI"]
  node_native_binary["Native Binary"]
end

subgraph group_session["Session State"]
  node_session["Session Source<br/>[session.py]"]
  node_session_file[("Session Snapshot")]
end

node_notebook_user(("Notebook User"))
node_jupyter["Jupyter"]

node_notebook_user -->|"submits cells"| node_jupyter
node_jupyter -->|"executes cells"| node_kernel
node_kernel -->|"builds source"| node_session
node_kernel -->|"compiles and runs"| node_compile_run
node_compile_run -->|"invokes compiler"| node_arx_cli
node_arx_cli -->|"builds binary"| node_native_binary
node_compile_run -->|"executes binary"| node_native_binary
node_kernel -->|"publishes output"| node_jupyter
node_session -->|"persists source"| node_session_file

click node_kernel "https://github.com/arxlang/arxlang-jupyter-kernel/blob/main/src/arxlang_jupyter_kernel/kernel.py"
click node_compile_run "https://github.com/arxlang/arxlang-jupyter-kernel/blob/main/src/arxlang_jupyter_kernel/compile_run.py"
click node_session "https://github.com/arxlang/arxlang-jupyter-kernel/blob/main/src/arxlang_jupyter_kernel/session.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_kernel,node_notebook_user toneBlue
class node_compile_run,node_arx_cli,node_native_binary toneAmber
class node_session,node_session_file toneMint
class node_jupyter toneIndigo
```

## Components

### Kernel Runtime

- [Arx Kernel](https://github.com/arxlang/arxlang-jupyter-kernel/blob/main/src/arxlang_jupyter_kernel/kernel.py): `src/arxlang_jupyter_kernel/kernel.py`

### Arx Execution

- [Compile and Run](https://github.com/arxlang/arxlang-jupyter-kernel/blob/main/src/arxlang_jupyter_kernel/compile_run.py): `src/arxlang_jupyter_kernel/compile_run.py`
- **Arx CLI**
- **Native Binary**

### Session State

- [Session Source](https://github.com/arxlang/arxlang-jupyter-kernel/blob/main/src/arxlang_jupyter_kernel/session.py): `src/arxlang_jupyter_kernel/session.py`
- **Session Snapshot**

### Other components

- **Notebook User**
- **Jupyter**

## Connections

- Notebook User → Jupyter: submits cells (evidence: `README.md`)
- Jupyter → Arx Kernel: executes cells (evidence: `README.md`)
- Arx Kernel → Session Source: builds source (evidence: `src/arxlang_jupyter_kernel/kernel.py`)
- Arx Kernel → Compile and Run: compiles and runs (evidence: `src/arxlang_jupyter_kernel/kernel.py`)
- Compile and Run → Arx CLI: invokes compiler (evidence: `README.md`)
- Arx CLI → Native Binary: builds binary (evidence: `README.md`)
- Compile and Run → Native Binary: executes binary (evidence: `README.md`)
- Arx Kernel → Jupyter: publishes output (evidence: `src/arxlang_jupyter_kernel/kernel.py`)
- Session Source → Session Snapshot: persists source (evidence: `src/arxlang_jupyter_kernel/session.py`)
