RepositoryRustDEGermany
SH

sharkdp/numbat

A statically typed programming language for scientific computations with first class support for physical dimensions and units

2.9kstars
127forks
89issues
4views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: statically-typed

#1 Repository of the week

1
TINIX TRENDING·Topic: calculator

#1 Repository of the week

1
TINIX TRENDING·Topic: units

#1 Repository of the week

📐 Numbat: units baked into the type system

Stop mixing meters and seconds by accident.

Numbat is a statically typed programming language built for scientific computations with first-class support for physical dimensions and units. Designed mainly for the interactive terminal, it aims to catch unit and dimension mistakes at compile time instead of by hand.

✨ Highlights

  • Physical dimensions as types: Length, Time and others act as types. Annotations can be added, or dimensions like Speed are inferred automatically.
  • First-class units: Units can be entered in many forms (km/h, kilometer/hour, GiB, °, m²). Compatible units convert with the -> operator, and expressions like 15 km/h * 30 min are simplified to 7.5 km.
  • Comprehensive standard library: Covers SI, US Customary, Imperial, Nautical, Astronomical, Atomic, Nuclear and more, with physical constants and pre-defined functions.
  • Strict syntax: The parser never guesses on invalid input. Either it gives a descriptive error, or the result can be trusted.
  • Clear error messages: Focuses on helpful errors to point out type or unit mismatches.
  • Interactive REPL: Runs in the terminal with readline features like command history, Ctrl-R search and tab completion for quick, one-off calculations.
  • Modular and extensible: The entire unit and dimension system is written in Numbat itself. New units can be added via init.nbt or by swapping the prelude entirely.
  • Assertions: Use assert_eq for exact or approximate checks, e.g. assert_eq(c, 300_000 km/s, 1% × c), to verify calculations during restructuring.

💡 Why it matters

By making physical dimensions part of the type system, Numbat shifts unit safety from manual tracking to static checks. Since the prelude is itself Numbat code, extending the unit system stays minimal and consistent with the rest of the language. It's best for scientific work, engineering checks, and any calculation where mixing incompatible units would be costly.


#Calculator #Units #Physics #ProgrammingLanguage #StaticallyTyped #TiniX

Similar Projects

Discover other similar projects and AI models.

RepositoryRust
gleam-lang/gleam

⭐️ A friendly language for building type-safe, scalable systems!

22.2k
Dec 1, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

488.2k
Dec 3, 2026
RepositoryTypeScript
n8n-io/n8n

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

213.0k
Dec 3, 2026
RepositoryPython
microsoft/markitdown

Python tool for converting files and office documents to Markdown.

199.6k
Dec 3, 2026
RepositoryTypeScript
microsoft/vscode

Visual Studio Code

195.9k
Nov 30, 2026
RepositoryShell
ohmyzsh/ohmyzsh

🙃 A delightful, community-driven framework for managing your zsh configuration. Built by 2,600+ contributors, with hundreds of plugins (git, rails, laravel, node, python, docker, kubectl, aws, and more), themes to spice up your terminal, and automatic updates to keep your command line feeling like home.

191.0k
Nov 29, 2026
Repository
getify/You-Dont-Know-JS

A book series (2 published editions) on the JS language.

184.8k
Oct 31, 2026
RepositoryRust
Rigellute/spotify-tui

Spotify for the terminal written in Rust 🚀

19.4k
Apr 4, 2024
RepositoryRust
BoundaryML/baml

The programming language for agents

9.6k
Dec 1, 2026