Skip to content

Architecture of Source Academy ​

How the parts of Source Academy fit together, and which repository holds each. This page is the overview; the pages for the components are listed at the end.

Written on 28 November 2026 from the code and the READMEs of the repositories. Each page names the files it was checked against, so that a maintainer can tell what to update when the code changes.

The picture ​

A learner's browser runs the frontend. The frontend knows no language and no tool: it reads three directories (static JSON files on GitHub Pages) to find out which languages, evaluators, plugins and modules exist, and loads what it needs when a program runs. A language evaluator runs in a Web Worker and talks to the frontend through the Conductor protocol. Tools that show a program's execution, such as the Stepper, are plugins that the evaluator asks the frontend to load. The backend keeps the accounts, courses, assessments and submissions, and sends submissions to the grader, which runs the same evaluators on the server.

The parts of Source Academy and how they connectThe frontend in the browser loads evaluators and plugins named by three directories, runs an evaluator in a Web Worker over Conductor, and talks to the backend, which sends submissions to the grader.The learner's browserFrontendworkspaces, editor, tabsEvaluatorin a Web Workerjs-slang, py-slang, ...PluginsStepper, E-Stepper,Data Visualizer, CSE machineModulesbundles and tabsthat programs importConductorloads plugins, shows tabsimportStatic JSON on GitHub PagesLanguage directoryPlugin directoryModules directorythe frontend reads the directories at run timeBackendPhoenix, PostgreSQLGraderAWS Lambda,vendored evaluatorsHTTPS APIsubmission

The parts, and where they live ​

PartWhat it isRepository
FrontendThe web application: workspaces, the editor, the side-content tabs, assessments, grading screensfrontend
BackendAccounts, courses, assessments, submissions, the API; Elixir, Phoenix, PostgreSQLbackend
GraderRuns a submission's test cases in an evaluator, on AWS Lambdagrader
DirectoriesJSON lists of the languages and evaluators, of the plugins, and of the moduleslanguage-directory, plugin-directory, modules
ConductorThe protocol between a host and a runner, and the code that implements itconductor
EvaluatorsOne implementation per languagejs-slang, py-slang, scm-slang, java-slang, ocaml-slang
Plugins and modulesTools that show a run, and libraries that a program importsplugins, modules
DeploymentWhere the parts runbackend (deployment/), GitHub Pages

Two paths cross all of these: a run in the workspace, and a submission.

Three ideas that explain most of the design ​

  • The frontend knows no language and no tool. Which languages exist, which evaluator runs each, which tab shows what an evaluator computes: all of it is in the directories, and the frontend reads them at run time. A new language or tool is added to a directory, not to the frontend. (This is the direction the code is moving in; the frontend still contains a few special cases, tracked in frontend#4587.)
  • An evaluator is a program that speaks Conductor. It runs in a Web Worker in the browser and in a worker thread in the grader, with the same code in both.
  • A tool is a plugin. The evaluator asks the host to load a plugin by its id in the plugin directory, and the plugin contributes a tab. Writing a visualizer plugin describes how.

The four pieces that make the frontend language- and tool-agnostic ​

Conductor ​

conductor is the standard interface between a host (an environment from which runners are created: the browser frontend, a command line, the grader) and a runner (the environment where user code runs, with an evaluator in it). Host and runner exchange messages over named, bidirectional channels; the standard ones carry results (__result), errors (__error), standard output (__stdio) and status (__status). A plugin is a program loaded on demand that can listen on and send over channels. An evaluator implements IEvaluator (the base class BasicEvaluator needs only evaluateChunk), and an entry point creates a Conduit and registers the runner plugin. Conductor also defines the module interface: the data types and the functions with which a module (a library such as rune or plotly) reads and builds values of an evaluator without knowing its memory model. More in Conductor.

Plugins ​

A plugin is how a tool joins a run. The Stepper, the E-Stepper, the Data Visualizer and the CSE machine are plugins: each has a package that the evaluator uses (common-* for the protocol, runner-* for the evaluator's side) and a package that the browser loads (web-*, which contributes a side-content tab). They live in plugins, are built into bundles on GitHub Pages, and are found through the plugin directory. An evaluator asks the host to load one with hostLoadPlugin(id). More in Plugins and modules, and Writing a visualizer plugin.

Language directory ​

language-directory lists the languages that Source Academy supports. A language definition has an id, a name, the evaluators that can run it, and optional settings: an editor configuration, a textbook (with the chapters written in this language), and links to documentation. An evaluator definition has an id, a name, the URL of the evaluator's entry file, its capabilities, and optionally the id of a plugin whose tab presents what the evaluator computes (an evaluator with that field is hidden from the evaluator dropdown, and chosen when the user opens the plugin's tab). The directory is published as JSON at https://source-academy.github.io/language-directory/directory.json; on 28 November 2026 it lists 13 languages (Python §1 to §4, Python §4 Typed, full Python, Source §1 to §4, Scheme, Java, OCaml). A new language is added to src/languages.ts. More in Directories.

Plugin directory ​

plugin-directory lists the plugins. A plugin definition has an id, a name, an optional description, an optional tab (its id, label, icon, and whether it hides the host's REPL or keeps the side content from being resized, so that the host can show a placeholder before the plugin loads), and resolutions: for each kind of environment (web, runner, module) the URL of the plugin's entry file. On 28 November 2026 it lists four plugins: stepper, e-stepper, data-visualizer and cse-machine. A new plugin is added to src/plugins.ts. More in Directories.

Pages ​

Built with VitePress.