Numbat keeps the units in the type system, and leaves the rest to other tools
A statically typed programming language for scientific computations with first class support for physical dimensions and units
At a glance
- What is it?
- A statically typed language for scientific computations where physical dimensions are types. Strict parsing, a standard library written in the language itself, and a front page that is unusually clear about what it refuses to do.
- Who is it for?
- Numbat fits one job well: small computations where mixing up metres and miles, or seconds and hours, would quietly ruin an answer, and where a type checker is cheaper than rechecking units by hand. It declines everything else on purpose, sending differential equations to WolframAlpha and button-driven input to Qalculate!, and that candour is a better sign than feature breadth.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 34 days ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.
Star history
- sharkdp/numbat2,842 ★ · +98
| Repository | 2026-10-04 | 2026-11-14 |
|---|---|---|
| sharkdp/numbat | 2.7k | 2.8k |
98 Stars in the last 41 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The parser refuses to guess, and errors are the interface
Numbat's parser never tries to be smart on syntactically incorrect input, and the project turns that rule into a promise about results: you either get a descriptive error message, or you can trust the answer. Strictness like this usually costs something, and the repository keeps the cost visible instead of hiding it. Among the example entries listed for the project, one is not a calculation at all but a directory called `name_resolution_error/`, which ships a case built to fail. A second listed entry, `examples/interactive/`, is a directory too, so the example set mixes working programs with expected failures, and the naming is what separates them.
Error output is treated as a feature with its own asset. The messages link a screenshot at `assets/numbat-error.png`, so the claim that the diagnostics are helpful is documented as a picture rather than as text.
The online playground comes from the crate the workspace leaves out
The root `Cargo.toml` names three workspace members, `numbat`, `numbat-exchange-rates` and `numbat-cli`, and it excludes `numbat-wasm`. That exclusion is worth noticing, because the first link in the README navigation is `Try online!`, pointing at numbat.dev, and an interpreter that runs in a browser tab is what a WebAssembly build is for. The crate serving the online playground therefore sits outside the workspace that `cargo test` covers when you run it from the repository root.
The editor integration has the same gap. The tree carries a `vscode-extension/` directory that appears neither as a workspace member nor in the exclude list, so root-level Cargo commands do not build it. `Cross.toml` and `Cargo.lock` sit at the root beside the two license files, and `book/` plus `assets/` hold the documentation sources and the images the front page links.
Two license files at the root, one name in the metadata
Two license files sit at the repository root, LICENSE-APACHE and LICENSE-MIT, while the repository metadata names Apache-2.0. Nothing in the front page says which of the two files covers which part of the project, or whether a contributor chooses. For a layout with a language implementation, a standard library written in the language itself, a CLI, a data crate and an editor extension, that leaves the question open per file instead of settled once at the root.
Two other root files answer different questions and go unmentioned in the front page. `AGENTS.md` carries instructions for automated agents working in the repository, and `CITATION.cff` carries the metadata a citation tool would read. Both say something about how the project expects to be contributed to and credited.
A custom prelude can move the unit system under the type checker
The entire system of physical dimensions and units is specified in Numbat's own standard library, written in the Numbat language itself, which means the guarantees of the type system hold exactly as far as the loaded modules do. Adding a unit takes one line, `unit bathtub = 150 L` in an `init.nbt` file, and a new unit can also be introduced on the spot with `unit pixel`. A user can go further and write their own `prelude` module, which the front page describes as allowing arbitrary modifications to the unit system.
That is the extension point, and it is also where dimension checking becomes conditional on local files. Point `NUMBAT_MODULES_PATH` at `numbat/modules/` to see module edits without recompiling, or symlink `~/.config/numbat/modules` to the same folder. Both routes place files that change what a length or a currency is into a directory the type checker reads from at startup.
The release profile strips symbols, and the release cadence comes in bursts
The release profile in the workspace manifest is written for the artifact that ships: `lto = true`, `strip = true` and `codegen-units = 1`. Those three settings trade build time for a smaller, faster binary, and `strip = true` means a distributed release carries no symbols, so a crash report from it will not symbolicate without a separate build. The manifest also pins `resolver = "2"`, which fixes feature unification across the three members.
Version numbering has moved in bursts rather than steadily. v1.22.0 and v1.23.0 landed one day apart, on 2026-02-07 and 2026-02-08, and then v1.24.0 waited until 2026-08-23. The last push to the repository came on 2026-08-25, two days after that tag, so the most recent change and the most recent release are not the same event.
The installation section is a link, and the commands belong to contributors
The Installation section of the front page contains no command. It points at a documentation page for the native command-line version and stops, which leaves the only copyable blocks in the file belonging to people working on the source rather than people using the tool:
cargo run -- <numbat args>
cargo install -f --path numbat-cli
cargo testThe middle line is the CLI install, and it is a developer install from inside a checkout with a forced reinstall, not a package-manager install from a registry. Those three lines sit under Development, next to a badge for the CI workflow and a note that the project is maintained by David Peter, with GitHub issues, discussions and a Discord server listed as the contact routes.
Two typos and an unused anchor on the front page
The front page carries small slips that a reader treating it as documentation will notice. The Non-features list says Numbat does not compute `intergrals`, misspelled, and the sentence introducing the standard library reads as specified Numbat's standard library, with the preposition missing. The link definitions at the top include `[Features]: #key-features` while the navigation line above it never uses that label, so one anchor is defined and left unreferenced.
The Non-features list is still the most useful paragraph in the file, because it names what the project declines to do and where to go instead. Numbat is a scientific calculator, not a computer algebra system that solves differential equations, and WolframAlpha is offered for that. There is no graphical interface with buttons like `x²`, `1/x` or `DEG/RAD`, and Qalculate! is offered for text and graphical input. For an even wider unit range the page suggests contributing, or GNU units.
Editorial conclusion
Numbat fits one job well: small computations where mixing up metres and miles, or seconds and hours, would quietly ruin an answer, and where a type checker is cheaper than rechecking units by hand. It declines everything else on purpose, sending differential equations to WolframAlpha and button-driven input to Qalculate!, and that candour is a better sign than feature breadth. Before depending on it, check which of the two license files at the root covers your use, since the repository metadata names only Apache-2.0, and check whether the editor integration you want is the `vscode-extension/` in this tree, which root-level Cargo commands do not build. For unit-critical work, also confirm that the modules your `init.nbt` and your own prelude load are the ones you meant, since dimension checking follows those files.
Frequently asked questions
What is Numbat actually good for?
Small scientific computations where dimensions matter. Physical dimensions like `Length` and `Time` act as types, type annotations are optional and inferred otherwise, and quantities such as `Speed`, `Money` and `Frequency` come with the standard library. It is a scientific calculator, not a computer algebra system.
Does Numbat have a graphical interface?
No. The front page states there is no graphical interface with buttons like `x²`, `1/x` or `DEG/RAD`, and points at Qalculate! for both text and graphical input. Interactive use happens in the terminal, which includes command history, Ctrl-R search and tab completion.
How do I add a unit that Numbat does not have?
One line in an `init.nbt` file is usually enough, for example `unit bathtub = 150 L`, or you can introduce one on the spot with `unit pixel`. You can also write your own `prelude` module, which the front page says allows arbitrary modifications to the unit system.
Does Numbat check results at runtime as well as at compile time?
Partly. The static type system enforces correctness at the physical dimension level, and the `assert_eq` procedure adds runtime checks for exact equality such as `assert_eq(12 ft, 1 in)` or approximate equality such as `assert_eq(c, 300_000 km/s, 1% × c)`.
How do I run Numbat from a checkout while working on the prelude?
Use `cargo run -- <numbat args>` to start the CLI and `cargo test` for the suite, and point `NUMBAT_MODULES_PATH` at the `numbat/modules/` folder so module changes do not need a recompile. A symlink from `~/.config/numbat/modules` to that folder works too.
Which license applies to Numbat?
The repository root carries both LICENSE-APACHE and LICENSE-MIT, and the repository metadata names Apache-2.0. No line in the front page says which file covers which part of the project, so read both files before choosing.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/sharkdp-numbat)Star history chart for your README
[](https://hysenlabs.com/projects/sharkdp-numbat)Was this useful?