# julialang/julia architecture

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

- Interactive diagram: https://gitdiagram.com/julialang/julia
- Repository: https://github.com/julialang/julia

## Overview

Julia is a high-level, high-performance dynamic language for technical computing. The principal user workflow is entering expressions at the terminal prompt and having the runtime evaluate them; internally, Julia also provides compilation, memory management, I/O, and coverage capabilities. The graph combines README-described behavior with source-index references. Many runtime stages are represented from the tree and module names, but their call relationships are omitted or marked unverified where the excerpts do not establish them.

Main entry points: [`src/interpreter.c`](https://github.com/julialang/julia/blob/master/src/interpreter.c) (Interpreter), [`cli/loader_exe.c`](https://github.com/julialang/julia/blob/master/cli/loader_exe.c) (CLI and loader), [`src/gc-mmtk/mmtk_julia/src/julia_scanning.rs`](https://github.com/julialang/julia/blob/master/src/gc-mmtk/mmtk_julia/src/julia_scanning.rs) (Julia GC scanning), [`src/pipeline.cpp`](https://github.com/julialang/julia/blob/master/src/pipeline.cpp) (LLVM pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry"]
  node_cli["CLI and loader<br/>[loader_exe.c]"]
end

subgraph group_language["Language runtime"]
  node_flisp["FemtoLisp<br/>[flisp.c]"]
  node_syntax["Syntax and AST<br/>[ast.c]"]
  node_interpreter["Interpreter<br/>[interpreter.c]"]
  node_types["Types and values<br/>[jltypes.c]"]
  node_methods["Methods and dispatch<br/>[method.c]"]
end

subgraph group_compiler["Compilation"]
  node_inference["Inference engine<br/>[engine.c]"]
  node_pipeline["LLVM pipeline<br/>[pipeline.cpp]"]
  node_codegen["Code generation<br/>[codegen.cpp]"]
  node_jit["JIT layers<br/>[jitlayers.cpp]"]
  node_aot["AOT compilation<br/>[aotcompile.cpp]"]
end

subgraph group_memory["Memory management"]
  node_gc["MMTk collector bridge<br/>[gc-mmtk.c]"]
  node_gcscan["Julia GC scanning<br/>[julia_scanning.rs]"]
  node_gcapi["MMTk Julia API<br/>[api.rs]"]
  node_gcslots["GC slots<br/>[slots.rs]"]
end

subgraph group_services["Runtime services"]
  node_io["Buffered I/O<br/>[ios.c]"]
  node_coverage["Code coverage<br/>[coverage.c]"]
  node_tasks["Tasks and scheduling<br/>[scheduler.c]"]
  node_runtimeapi["Runtime API<br/>[jlapi.c]"]
end

node_user(("Terminal user"))

node_user -->|"enters expressions"| node_cli
node_cli -.->|"evaluates input"| node_interpreter
node_interpreter -.->|"uses syntax"| node_syntax
node_interpreter -.->|"uses interpreter"| node_flisp
node_interpreter -.->|"dispatches methods"| node_methods
node_methods -.->|"uses type data"| node_types
node_interpreter -.->|"requests inference"| node_inference
node_inference -.->|"compiles code"| node_pipeline
node_pipeline -->|"uses JIT layers"| node_jit
node_pipeline -.->|"uses code generation"| node_codegen
node_jit -.->|"uses code generation"| node_codegen
node_cli -.->|"offers compilation"| node_aot
node_gc -->|"uses API"| node_gcapi
node_gcscan -->|"uses API"| node_gcapi
node_gcscan -->|"uses slots"| node_gcslots
node_gcscan -.->|"coordinates collection"| node_gc
node_interpreter -.->|"uses I/O"| node_io
node_jit -->|"registers counters"| node_coverage
node_interpreter -.->|"uses tasks"| node_tasks
node_cli -.->|"loads runtime"| node_runtimeapi

click node_cli "https://github.com/julialang/julia/blob/master/cli/loader_exe.c"
click node_flisp "https://github.com/julialang/julia/blob/master/src/flisp/flisp.c"
click node_syntax "https://github.com/julialang/julia/blob/master/src/ast.c"
click node_interpreter "https://github.com/julialang/julia/blob/master/src/interpreter.c"
click node_types "https://github.com/julialang/julia/blob/master/src/jltypes.c"
click node_methods "https://github.com/julialang/julia/blob/master/src/method.c"
click node_inference "https://github.com/julialang/julia/blob/master/src/engine.c"
click node_pipeline "https://github.com/julialang/julia/blob/master/src/pipeline.cpp"
click node_codegen "https://github.com/julialang/julia/blob/master/src/codegen.cpp"
click node_jit "https://github.com/julialang/julia/blob/master/src/jitlayers.cpp"
click node_aot "https://github.com/julialang/julia/blob/master/src/aotcompile.cpp"
click node_gc "https://github.com/julialang/julia/blob/master/src/gc-mmtk/gc-mmtk.c"
click node_gcscan "https://github.com/julialang/julia/blob/master/src/gc-mmtk/mmtk_julia/src/julia_scanning.rs"
click node_gcapi "https://github.com/julialang/julia/blob/master/src/gc-mmtk/mmtk_julia/src/api.rs"
click node_gcslots "https://github.com/julialang/julia/blob/master/src/gc-mmtk/mmtk_julia/src/slots.rs"
click node_io "https://github.com/julialang/julia/blob/master/src/support/ios.c"
click node_coverage "https://github.com/julialang/julia/blob/master/src/coverage.c"
click node_tasks "https://github.com/julialang/julia/blob/master/src/scheduler.c"
click node_runtimeapi "https://github.com/julialang/julia/blob/master/src/jlapi.c"

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_cli,node_user toneBlue
class node_flisp,node_syntax,node_interpreter,node_types,node_methods toneAmber
class node_inference,node_pipeline,node_codegen,node_jit,node_aot toneMint
class node_gc,node_gcscan,node_gcapi,node_gcslots toneRose
class node_io,node_coverage,node_tasks,node_runtimeapi toneIndigo
```

## Components

### User entry

- [CLI and loader](https://github.com/julialang/julia/blob/master/cli/loader_exe.c): `cli/loader_exe.c`

### Language runtime

- [FemtoLisp](https://github.com/julialang/julia/blob/master/src/flisp/flisp.c): `src/flisp/flisp.c`
- [Syntax and AST](https://github.com/julialang/julia/blob/master/src/ast.c): `src/ast.c`
- [Interpreter](https://github.com/julialang/julia/blob/master/src/interpreter.c): `src/interpreter.c`
- [Types and values](https://github.com/julialang/julia/blob/master/src/jltypes.c): `src/jltypes.c`
- [Methods and dispatch](https://github.com/julialang/julia/blob/master/src/method.c): `src/method.c`

### Compilation

- [Inference engine](https://github.com/julialang/julia/blob/master/src/engine.c): `src/engine.c`
- [LLVM pipeline](https://github.com/julialang/julia/blob/master/src/pipeline.cpp): `src/pipeline.cpp`
- [Code generation](https://github.com/julialang/julia/blob/master/src/codegen.cpp): `src/codegen.cpp`
- [JIT layers](https://github.com/julialang/julia/blob/master/src/jitlayers.cpp): `src/jitlayers.cpp`
- [AOT compilation](https://github.com/julialang/julia/blob/master/src/aotcompile.cpp): `src/aotcompile.cpp`

### Memory management

- [MMTk collector bridge](https://github.com/julialang/julia/blob/master/src/gc-mmtk/gc-mmtk.c): `src/gc-mmtk/gc-mmtk.c`
- [Julia GC scanning](https://github.com/julialang/julia/blob/master/src/gc-mmtk/mmtk_julia/src/julia_scanning.rs): `src/gc-mmtk/mmtk_julia/src/julia_scanning.rs`
- [MMTk Julia API](https://github.com/julialang/julia/blob/master/src/gc-mmtk/mmtk_julia/src/api.rs): `src/gc-mmtk/mmtk_julia/src/api.rs`
- [GC slots](https://github.com/julialang/julia/blob/master/src/gc-mmtk/mmtk_julia/src/slots.rs): `src/gc-mmtk/mmtk_julia/src/slots.rs`

### Runtime services

- [Buffered I/O](https://github.com/julialang/julia/blob/master/src/support/ios.c): `src/support/ios.c`
- [Code coverage](https://github.com/julialang/julia/blob/master/src/coverage.c): `src/coverage.c`
- [Tasks and scheduling](https://github.com/julialang/julia/blob/master/src/scheduler.c): `src/scheduler.c`
- [Runtime API](https://github.com/julialang/julia/blob/master/src/jlapi.c): `src/jlapi.c`

### Other components

- **Terminal user**

## Connections

- Terminal user → CLI and loader: enters expressions (evidence: `README.md`)
- CLI and loader → Interpreter: evaluates input
- Interpreter → Syntax and AST: uses syntax
- Interpreter → FemtoLisp: uses interpreter
- Interpreter → Methods and dispatch: dispatches methods
- Methods and dispatch → Types and values: uses type data
- Interpreter → Inference engine: requests inference
- Inference engine → LLVM pipeline: compiles code
- LLVM pipeline → JIT layers: uses JIT layers (evidence: `src/pipeline.cpp`)
- LLVM pipeline → Code generation: uses code generation
- JIT layers → Code generation: uses code generation
- CLI and loader → AOT compilation: offers compilation
- MMTk collector bridge → MMTk Julia API: uses API (evidence: `src/gc-mmtk/gc-mmtk.c`)
- Julia GC scanning → MMTk Julia API: uses API (evidence: `src/gc-mmtk/mmtk_julia/src/julia_scanning.rs`)
- Julia GC scanning → GC slots: uses slots (evidence: `src/gc-mmtk/mmtk_julia/src/julia_scanning.rs`)
- Julia GC scanning → MMTk collector bridge: coordinates collection
- Interpreter → Buffered I/O: uses I/O
- JIT layers → Code coverage: registers counters (evidence: `src/coverage.c`)
- Interpreter → Tasks and scheduling: uses tasks
- CLI and loader → Runtime API: loads runtime
