| Crates.io | shuntcalc |
| lib.rs | shuntcalc |
| version | 2.0.0 |
| created_at | 2025-10-06 15:34:24.992679+00 |
| updated_at | 2025-10-06 15:34:24.992679+00 |
| description | A smart CLI calculator with variables, REPL, and step-by-step RPN evaluation using the Shunting Yard algorithm |
| homepage | |
| repository | https://github.com/ArshErgon/shuntcalc |
| max_upload_size | |
| id | 1870337 |
| size | 50,322 |
A smart terminal calculator with variables, step-by-step RPN evaluation, and Shunting Yard algorithm โ all in pure Rust.

Ever wondered how (8 - 3) * 5 becomes 25 inside a calculator?
shuntcalc shows you every step โ while supporting variables, error recovery, and an interactive REPL.
Built with โค๏ธ in Rust. Zero unsafe code. Zero bloat.
x = 10; y = x * 2; x + yrustyline for REPL)$ cargo install shuntcalc
$ git clone https://github.com/yourusername/shuntcalc
$ cd shuntcalc
$ cargo install --path .
๐ก Make sure you have Rust installed.
$ calc "(8 - 3) * 5"
# Output: 25
$ calc
>>> x = 5
5
>>> (x + 2) * 3
Step 1: Push 5 โ Stack: [5]
Step 2: Push 2 โ Stack: [5, 2]
Step 3: Apply '+' โ Result: 7 โ Stack: [7]
Step 4: Push 3 โ Stack: [7, 3]
Step 5: Apply '*' โ Result: 21 โ Stack: [21]
21
>>> exit
Input: (5 + 1 - 1
Shunting Yard: 5 1 + 1 - (
โ Error: Invalid token '(' at end of expression
Most calculators hide the magic. shuntcalc reveals it.
Itโs not just a tool โ itโs a teaching aid for:
Computer science students learning parsing
Developers exploring Rustโs expressiveness
Anyone curious about how math expressions are evaluated
And itโs built to production standards โ with error recovery, clean architecture, and user-friendly UX.
MIT ยฉ ArshErgon