Dedekind: a programming language for scientific computing with native units, autograd, and a LaTeX-from-AST workflow.
Project description
Dedekind
A programming language for scientific computing. Write your simulator once in readable code with units — and get inverse problems, topology optimization, parameter estimation, and Bayesian inference on it for free, without hand-rolled adjoint code.
use atomic
m = 1.0[kg] // compile-time units
k = 4.0[N/m]
fn L(q, v) { return 0.5*m*v[0]*v[0] - 0.5*k*q[0]*q[0] }
traj = ode_solve(lagrange_ode_rhs(L), [1.0, 0.0], linspace(0, 2*pi, 51))
The same AST that runs this simulation generates the LaTeX for your paper
(dedekind file.ddk --latex) and a reproducibility report bundling the
git commit, package versions, RNG seeds and methods section
(dedekind file.ddk --reproducibility-report appendix.md).
Install
pip install dedekind # core: torch + numpy + sympy
pip install "dedekind[jupyter,plot]" # + Jupyter kernel + matplotlib
pip install "dedekind[all]" # + sci, geo, bio, md, ml, plot, jupyter
Extras: jupyter, plot, sci (scipy), geo (xarray), bio (rdkit),
md (openmm), ml (torch_geometric).
Jupyter / JupyterLab / Spyder
pip install "dedekind[jupyter]"
python -m dedekind.install_kernel
Then jupyter lab and pick Dedekind from the kernel list. Variables
persist across cells; print_latex(...) renders inline; errors are
mapped back to .ddk line numbers.
Hello, Dedekind
hello.ddk:
print("Hello from Dedekind!")
vec = [1, 2, 3]
print(vec.sum())
Run it:
dedekind hello.ddk
What makes Dedekind different
- Native physical units, checked at compile time.
1[m] + 1[s]is a compiler error with line number;1[m] + 100[cm]auto-converts to2[m]. Cross-argument unit polymorphism via generics:fn add<U>(a: [U], b: [U]) -> [U]. - Differentiable everything. PDE/ODE solvers, LBM/FEM simulators,
N-body integrators, control blocks, IIR filters — all are first-class
AST nodes that autograd flows through.
minimize(...)andfit(...)optimize through full simulations without writing adjoint code. - Blackboard notation as syntax. Einstein indices (
A^ij * v^j), Ricci contraction, Lagrangians (lagrange_ode_rhs(L)), partial derivatives (partial(u, x, order=2)) are language primitives, not library calls. - Shape and semantic types.
Vector[N],Matrix[M, N],LabeledTensor[lat, lon, time],Sequence[DNA|RNA|Protein]— validated at function boundaries. The classicdata.mean(axis=2)-instead-of-dim="time"bug becomes structurally impossible. - LaTeX is generated from the AST, not typed by hand. Methods sections in papers and the code that runs the simulation share one source of truth. Paper-code drift is structurally eliminated.
- Python interop.
pyimport scipy.special as sp; sp.gamma(5.0)— every PyPI package is one line away.
Full feature catalogue: docs/language.md. Why it matters in detail: docs/language.md#core-features.
Showcase examples
If you installed Dedekind via pip, you can initialize the showcase examples in your current directory by running:
dedekind --init-examples
This will automatically download and extract the ./examples/ directory.
A curated entry-point selection (full list: examples/dedekind/):
physics_astronomy/scientific_ricci_plot.ddk— Einstein notationphysics_astronomy/lagrange_hamilton.ddk— Lagrangian → ODE in one callmachine_learning/pinn_oscillator_demo.ddk— physics-informed neural netengineering/lbm_shape_optimization.ddk— differentiable CFD shape optengineering/lbm3d_sphere_drag.ddk— D3Q19 + autogradengineering/lbm_les_smagorinsky_tuning.ddk— Smagorinsky LES calibrationengineering/heat_sink_topology_optimization.ddk— SIMP topology optphysics_astronomy/crystallography_structure_refinement.ddk— structure refinement via differentiable SF (using atomic)compiler_features/reproducibility_demo.ddk—--reproducibility-reportcompiler_features/latex_demo.ddk—--latex
Compile and run every example at once:
python run_examples.py (-q for summary, --filter <name> for one).
Status, roadmap, history
- Current release: v3.0.3 (May 2026)
- Roadmap: docs/roadmap.md
- Full changelog: docs/changelog.md
- Formal spec: docs/Dedekind_Language_Specification.md
License
Apache 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dedekind-3.0.3.tar.gz.
File metadata
- Download URL: dedekind-3.0.3.tar.gz
- Upload date:
- Size: 571.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62fadc138d7f295924759ed9fb385304d8b4f369aff1708d0a0a34df08f5e754
|
|
| MD5 |
f3466275adc3d2c53a3ee26d49107b0c
|
|
| BLAKE2b-256 |
8764ba155662360ec061d979ebb87bf5432582a098d1a45b44bb78db98fc971b
|
Provenance
The following attestation bundles were made for dedekind-3.0.3.tar.gz:
Publisher:
release.yml on Engineer1080/Dedekind
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dedekind-3.0.3.tar.gz -
Subject digest:
62fadc138d7f295924759ed9fb385304d8b4f369aff1708d0a0a34df08f5e754 - Sigstore transparency entry: 1629257989
- Sigstore integration time:
-
Permalink:
Engineer1080/Dedekind@9aa378792fa3a9f2eea1eddec81529d51350272a -
Branch / Tag:
refs/tags/v3.0.3 - Owner: https://github.com/Engineer1080
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9aa378792fa3a9f2eea1eddec81529d51350272a -
Trigger Event:
push
-
Statement type:
File details
Details for the file dedekind-3.0.3-py3-none-any.whl.
File metadata
- Download URL: dedekind-3.0.3-py3-none-any.whl
- Upload date:
- Size: 357.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24d5d8c8d655d6cf471aa8973479e5ae6ea7c674c5763bdb50ba032ad3813314
|
|
| MD5 |
e847a51dc0456cc7877ab588d7971b2e
|
|
| BLAKE2b-256 |
c8774f63846379c160fa8fb9e4c377e15ef75282a1b6980a0e1416d4e458eabc
|
Provenance
The following attestation bundles were made for dedekind-3.0.3-py3-none-any.whl:
Publisher:
release.yml on Engineer1080/Dedekind
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dedekind-3.0.3-py3-none-any.whl -
Subject digest:
24d5d8c8d655d6cf471aa8973479e5ae6ea7c674c5763bdb50ba032ad3813314 - Sigstore transparency entry: 1629258020
- Sigstore integration time:
-
Permalink:
Engineer1080/Dedekind@9aa378792fa3a9f2eea1eddec81529d51350272a -
Branch / Tag:
refs/tags/v3.0.3 - Owner: https://github.com/Engineer1080
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9aa378792fa3a9f2eea1eddec81529d51350272a -
Trigger Event:
push
-
Statement type: