Mathematics, written as mathematics.
Hilbert is a language for people who do mathematics, not programming.
You write a formula the way it appears on paper — def radians(d) ≔ d · π / 180 — and the
compiler turns it into C# for real numbers and into an ONNX graph for vectors, matrices
and tensors. A standard library of nearly 1,400 definitions, the Prelude, covers
statistics, linear algebra, machine learning, stochastic processes and reinforcement learning — all of it
written in Hilbert, on top of one operation: Einstein summation.
open Prelude.Statistics
open Prelude.LinearAlgebra
fn average(x) ↦ mean(x)
fn spreadOf(x) ↦ std(x)
fn product(a, b) ↦ einsum("ij,jk->ik", a, b)
fn solved(a, b) ↦ solve(a, b)
var m = Summaries.Average(new[] { 1d, 2d, 3d, 4d }); // 2.5
var p = Summaries.Product(a, b); // runs as ONNX
Why Hilbert
Numerical code usually hides the mathematics inside loops, indices and library calls. Hilbert keeps the mathematics as the source.
-
The formula is the program
A
defis a definition, afnis what your program calls. There are no loops to write: repetition is a definition that names itself, and the compiler makes it a bounded loop. -
One formula, every shape
fn sum(x, y) ↦ x + ycompiles to overloads for reals, complex numbers, vectors, matrices and tensors. Shaped values run as an ONNX graph — on the calling thread when small, on ONNX Runtime when large. -
Nothing is hidden
The compiler knows no identities and no derivatives.
sin² + cos² = 1and the chain rule are laws in the Prelude that you can read — and every algorithm, from Cholesky to Q-learning, is a page of Hilbert.
Where to go next
- Getting startedAdd
.hbfiles to a C# project and call your first formula.Start - The languageDefinitions, doorways, matches, recursion, tensor literals and the symbols.Start
- What is a tensor?Scalars, vectors, matrices and beyond — rank, shape, indices and broadcasting.Understand
- Einstein's summationHow a notation invented for general relativity became the one operation of this language.Understand
- einsum in practiceDot products, matrix products, traces, batches and Gram matrices in one line each.Understand
- BDI agentsBelief, desire and intention as modal logic — agents in
.ha, plans in.hk, proved before they run.Agents - Reactive, deliberative and the LLMStop when in danger, think, and use a language model that proposes while experts decide.Agents
- The Prelude46 modules, every definition stated as mathematics, with examples that were compiled and run.Reference