Research language · edition alpha-2027 (draft)
Compile a learning system, from its mathematics to its GPU instructions.
Alpha is a dependently typed language and compiler. You write a model, how it learns and where it runs as one program; the compiler checks all of it and emits every byte of a self-contained executable for the device you choose.
module Hello
def double : (pi unrestricted n : Nat . Nat) =
(lambda unrestricted n : Nat . (nat-add n n))
def main : Nat =
(double 21)alpha run → exit status 42The vision, in a short film
The vision1 min 36 s · sound onWhat Alpha is
One programThe model, its learner, the training run and the device pairing are one typed program. The compiler sees all of it before it specializes anything.Any deviceA device is a typed profile, not a runtime. Model code never mentions hardware, so moving to new hardware means adding a target, not rewriting the model.No fixed catalogueThere is no closed list of operators or kernels. Mathematics, memory layouts, schedules and GPU instructions are ordinary values you can recombine.Built for agentsEverything has a literal name, checks take seconds and errors have stable codes, so an agent can take a system apart and rebuild it safely.How it works
From a description to a running executable.
Every layer is Alpha code the compiler can see: the mathematics, the learning rule, the memory plan, the launch schedule and the machine instructions. Nothing is hidden in a vendor library.
- 01
Describe
Write the model, the learner and the run as ordinary Alpha definitions, with no device in sight. A separate pairing names the hardware.
- 02
Check
Dependent types, quantities and effects are checked across the whole program. Shapes, layouts and resource limits are facts, not comments.
- 03
Realize
The compiler plans memory, schedules launches and lowers each computation to the target's machine code, refusing anything that fails its hazard checks.
- 04
Run
The result is one self-contained executable that trains, checkpoints and predicts, talking to the device driver directly with no framework underneath.
Any device
The model never names the hardware.
A system's definition cannot reach a device, an address or a launch. Hardware enters through a small pairing file that states what the program needs from a card; the compiler checks that against the card's typed profile and refuses, by name, anything that does not fit. The same model source already builds for two NVIDIA GPU generations, and a new vendor is a new target package beside them.
-- No target, device, address, launch or runtime value is reachable from this
-- semantic root. Concrete hardware enters only through Bob.Build.*.
def bobSystem : (family BobSystemConfiguration) =
(record
BobSystemConfiguration
(bobSystemDefinitionValue = bobSystemDefinition)
(bobSystemModel = bobModel)
(bobSystemLearning = bobLearningSemantics)
(bobSystemTrainingRun = bobTrainingRunSemantics)
(bobSystemPrediction = bobPredictionSemantics)
(bobSystemCheckpointSchema = bobCheckpointSchema))-- the compatibility contract: what the artifact demands of the card
-- against what the RTX 3090 profile supplies (Platform.Linux.Nvidia.
-- Compatibility); the first demand not met, by name (empty = admitted)
def bobRTX3090CompatibilityRefusal : Bytes =
(nvidiaCompatibilityRefusal (bobCompatDemands runPodSM86QMDArchitecture) runPodRTX3090Supplies)Beyond today's architectures
Not a transformer framework.
Alpha is not built around a tensor operation, a model family or one vendor. Transformers, attention and matrix products are libraries written in Alpha, not assumptions in the compiler, so the same machinery can express very different learning systems and change an algorithm and its hardware realization together.
How learning systems are built →- Feed-forward and recurrent networks
- Scans and state-space models
- Convolutional and spectral systems
- Sparse, graph and event-driven systems
- Fixed-point and differential-equation systems
- Energy-based and implicit models
- Forward-, reverse- and mixed-mode differentiation
- Local, perturbation and population learning
The language
Strict where it matters.
Invalid programs are rejected before anything runs, on the CPU, on the GPU, or on a rented card by the hour.
Read the language guide →- Dependent types
- Types can mention values, so a tile that does not fit shared memory, or a buffer of the wrong length, is a type error.
- Quantities
- Every binder is erased, affine, linear or unrestricted. Proofs and type-level data vanish from the executable by construction.
- Explicit effects
- Effects and partiality are part of a computation's type. Nothing performs I/O or diverges without saying so.
- No fallbacks
- If a target cannot do something, compilation stops with a stable diagnostic. Work never silently moves somewhere else.
Built for agents
Start with a coding agent.
Most of Alpha is written by AI agents, and the repository's AGENTS.md tells them how to work in it. Paste this into Claude Code, Codex or OpenCode to get going.
Clone https://github.com/thomasdavis/alpha and read AGENTS.md first. Build the compiler: (cd bootstrap/haskell && cabal build -O2 exe:alpha). Write a small Alpha module whose main computes a number, check it with alpha check, run it with alpha run, and explain what each quantity in it means. Then read systems/bob and explain how its model stays independent of the GPU.
Where next
Pick a starting point.
Build the compiler and run a first program.
LearnLanguage guideSyntax, types, quantities, effects and families, with examples.
ExploreLearning systemsThe models written in Alpha and where each one runs.
ExploreHardwareEvery target device and its typed profile.
UnderstandLearning systems in AlphaHow a learning idea becomes a checked, comparable experiment.
UnderstandPhilosophyWhy Alpha reopens the design space instead of freezing today's stack.
ExploreSource browserEvery Alpha file, with definitions linked across modules.
EvaluateHard questionsThe strongest objections to the project, answered in the open.