sharkdp/numbat là dự án mã nguồn mở trên GitHub với 2.8k sao, viết chủ yếu bằng Rust. A statically typed programming language for scientific computations with first class support for physical dimensions and units
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Numbat is a statically typed programming language for scientific computations
with first class support for physical dimensions and units.
Key Features
Click to learn more.
Physical dimensions as types
Numbat has a static type system where physical dimensions like Length and Time act as types.
Definitions of constants and functions can optionally contain type annotations that will be statically enforced.
If the types are not specified, they will be inferred (Speed, Money and Frequency in the screenshot).
See this article to learn more about Numbat's type system.
First-class physical units
Numbat is focused on computations with units. Units are therefore treated as first-class citizens. They can be
entered in various ways (km/h or kilometer/hour, GiB or
gibibytes, ° or degree, m² or m^2).
New units can be introduced on the spot (unit pixel).
Compatible units can be converted easily using the -> operator (30 km/h -> mph, 1 mrad -> degree, 5 in + 2 ft -> cm, 27 weeks -> days).
And unit expressions are simplified using various heuristics (15 km/h * 30 min = 7.5 km).
Comprehensive standard library
Numbat's standard library comes with a large number of physical dimensions and units (SI, US Customary, Imperial, Nautical, Astronomical, Atomic, Nuclear, …).
See this reference page for a complete overview.
It also contains a lot of mathematical and physical constants
as well as a large range of pre-defined functions.
Strict syntax
Numbat's parser never tries to be "smart" on syntactically incorrect input.
This means you will either get a (descriptive) error message, or you can trust the result of your calculation.
Excellent error messages
Numbat aims to provide descriptive and helpful error messages.
Interactive terminal
Numbat has been designed for an interactive use-case with small "one off" computations. Opening the numbat interpreter
without any arguments starts a REPL with a familiar
readline interface, including all the usual features like a command history, Ctrl-R search or tab completion.
Modular and customizable
The whole system of physical dimensions and units is specified Numbat's standard library, which is
written in the Numbat language itself. It is therefore
easily extensible by providing a init.nbt file. For example,
a single line (unit bathtub = 150 L) is usually enough to add a new unit. Users can even choose to write their
own prelude module, allowing for arbitrary modifications to the unit system.
Assertions
With its static type system, Numbat already enforces correctness of your calculations on a physical dimension level.
But some checks can only be made at runtime. Numbat provides an assert_eq procedure that allows you to check for
exact equality using assert_eq(12 ft, 1 in) or approximate equality using assert_eq(c, 300_000 km/s, 1% × c).
This can be useful to make sure that intermediate results do not change during a restructuring of your calculation.
Non-features
Numbat is a scientific calculator. It's not a computer algebra system that solves differential equations
or computes intergrals. Try WolframAlpha instead.
There is no graphical user interface with buttons like x², 1/x or DEG/RAD.
Qalculate! is a fantastic tool that supports both text as well as graphical
input.
Numbat supports a huge range of physical units. If you need something even more comprehensive,
please consider contributing. Or try GNU units.
Installation
See this page for details on how to install the native command-line version of Numbat.
Development
Run Numbat CLI
cargo run -- <numbat args>
Install the CLI version
cargo install -f --path numbat-cli
Run all tests
cargo test
Working on the prelude
If you are working on Numbat's standard library, it is convenient to point
the NUMBAT_MODULES_PATH environment variable to the numbat/modules/ folder. This way,
you don't have to recompile Numbat to see your changes.
Alternatively, you can create a symlink from ~/.config/numbat/modules to the numbat/modules/
folder in the repository (see this page
for the standard paths on other operating systems).
Contact us
This project is maintained by David Peter. To contact us, either open a GitHub issue
or discussion, or pop into our
Discord server.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/sharkdp/numbat là nguồn chính thức.
sharkdp/numbat có bao nhiêu sao?
sharkdp/numbat có 2.8k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/sharkdp/numbat. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
sharkdp/numbat có phải mã nguồn mở không?
Có — sharkdp/numbat phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/sharkdp/numbat.
sharkdp/numbat còn đang phát triển không?
Commit gần nhất trên sharkdp/numbat là 8 tháng trước (theo timestamp GitHub). Repo có 125 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
sharkdp/numbat dùng license gì?
sharkdp/numbat phát hành theo license Apache-2.0. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
sharkdp/numbat là gì?
sharkdp/numbat (sharkdp/numbat) là dự án Rust trên GitHub. Theo mô tả gốc: A statically typed programming language for scientific computations with first class support for physical dimensions and units
sharkdp/numbat viết bằng ngôn ngữ gì?
sharkdp/numbat chủ yếu viết bằng Rust. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về numbat?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về numbat.