Architecture

Corral is a thin layer of Rust between herdr and the engines that do the heavy lifting. This page shows the pieces, what runs where, and how code, tables and plots travel between them.

The layers

Corral's layers At the top, herdr holds four panes: the agent, the script, the console and the variables. In the middle, the corral binary talks to herdr through its socket. At the bottom, the engines corral drives: Ark, IPython, DuckDB and Mirador. herdr: your terminal workspace AgentClaude, Codex… ScriptFresh + plugin ConsoleR · Python Variablesyour objects herdr's socket (JSON) corral: one Rust binary, no dependencieslayouts, sending code, eval, variables, tables, Mirador, installer ArkR kernel, ZeroMQ IPythonuv environment DuckDBqueries Parquet Miradorin your browser what you see Corral engines Corral drives

Inside the binary

ModulesWhat they do
ark, zmtp, sha256The R console in front of Ark: ZeroMQ, Jupyter messages and their signatures, a line editor with history and completion.
lspConnects the editor to Ark's language server, inside your live R session.
console, workspace, layoutThe layouts, which pane gets the space, and finding, starting or bringing in a console.
send, evalCode from the editor (Ctrl+R, F5) and from agents into the console.
vars, tableThe variables pane and the table viewer, which asks DuckDB only for what is on screen.
plots, miradorView(), plots, and Mirador's server and page.
atajos, themeThe shortcut palette, and one palette of colors taken from herdr's theme.
install, setup, zipThe installer, Ark's download, and unzip and inflate for the releases.
herdr, term, json, toml, envherdr's socket, the terminal, the config and state files, and the helpers the rest share.

How things travel

How code, tables and plots travel Code: Ctrl+R or corral eval, then corral send, then the console, then the variables pane reads vars.json. Tables: View(df), then a Parquet file, then the table viewer, then DuckDB returns only what is visible. Plots: plot(), then httpgd, then Mirador's server, then the browser in about 80 ms. Code Ctrl+R / evaleditor or agent send / evalcarries the code ConsoleArk or IPython Variablesreads vars.json Tables View(df)R or Python Parqueta temporary file Table vieweror Mirador, with m DuckDBonly what's visible Plots plot()ggplot2, matplotlib httpgdor its Python twin Miradorserved by corral Your browserin about 80 ms

Code

Ctrl+R in the editor runs corral send; an agent runs corral eval. Both bring the console into view, starting it if needed, and type into it through herdr, so the code runs in your live session and you watch it happen. corral eval writes the code to a file and types a short call that runs it, then hands the agent what was printed and any new plots as PNG. After every command the session writes vars.json, and the variables pane redraws from it.

Tables

View(df) writes the table to a temporary Parquet file (with arrow or nanoparquet in R; polars, pyarrow or pandas in Python; CSV when none is installed) and opens the table viewer in a popup next to the console. The viewer never loads the table: each page, count, sort, search, filter and summary is one DuckDB query on the file, so ten million rows open in about 34 ms and the viewer itself stays around 3 MB.

The terminal is the default. When you want the browser, press m in the viewer or in the variables pane, or call View(df, mirador = TRUE): Mirador opens the same file, with the same queries and the same keys.

Why a file in between? The viewers run in their own processes, outside R and Python, so your console stays free while you look and closing a viewer can't touch your session. Parquet is the format DuckDB reads fastest: columnar and compressed, so a query reads only the columns and row groups it needs.

Plots

Corral's R file makes httpgd the graphics device, and Python gets a small server with the same API. Mirador's server reads the plots from it, and the page shows each new one about 80 ms after the command that drew it.

What runs where

ProcessWritten inLives
herdrRustWhile your workspaces exist, with or without a window
corral commandsRustMilliseconds per command
Variables pane, table viewer, Mirador's serverRustWhile open
Ark and your R sessionRust and R (r/corral.R runs inside R)Your R console
IPythonPython (py/corral_py.py)Your Python console
Fresh and Corral's pluginRust and TypeScriptThe script pane
DuckDBC++One short run per query
Your agentAnyIts own pane

State on disk

Corral keeps no database and no daemon of its own. What it remembers is in plain files: