A grammar-based expression calculator with DateTime and Currency support, built with Rust WebAssembly and React.
https://link-assistant.github.io/calculator/
π See USE-CASES.md for more detailed examples with screenshots, including symbolic integration, math functions, dark theme, and more.
- Arithmetic operations:
+,-,*,/with proper operator precedence - Parentheses for grouping:
(2 + 3) * 4 - Negative numbers:
-5 + 3 - Decimal precision using
rust_decimal
Supports multiple date and time formats:
- ISO format:
2026-01-22 - US format:
01/22/2026 - European format:
22/01/2026 - Month names:
Jan 22, 2026,22 Jan 2026 - Time formats:
8:59am,14:30, with timezone support (8:59am UTC) - DateTime arithmetic:
(Jan 27, 8:59am UTC) - (Jan 25, 12:51pm UTC)
- Currency amounts:
84 USD,34 EUR - Currency arithmetic with automatic conversion:
100 USD + 50 EUR - Temporal awareness:
84 USD - 34 EUR at 22 Jan 2026 - Support for 50+ currencies including major world currencies, precious metals, and cryptocurrencies
All expressions are represented in links-notation format:
- Step-by-step calculation explanations
- Issue prefill links for unrecognized input
> 2 + 3
Result: 5
Links notation: ((2) + (3))
> (Jan 27, 8:59am UTC) - (Jan 25, 12:51pm UTC)
Result: 1 day, 20 hours, 8 minutes
Links notation: (((Jan 27, 8:59am UTC) - (Jan 25, 12:51pm UTC)))
> 84 USD - 34 EUR
Result: 47.042 USD
Links notation: (((84 USD)) - ((34 EUR)))
grammar/- Lexer and recursive descent parsertypes/- Value, Decimal, DateTime, Currency, Unit typeslino/- Links notation representationerror/- Error types with thiserrorwasm.rs- WebAssembly bindings
- Vite + TypeScript + React 18
- Web Worker for non-blocking WASM calculations
- Responsive design with real-time results
- Example expressions for quick testing
ci.yml- Tests, linting, formatting, WASM builddeploy.yml- GitHub Pages deployment
- Rust 1.70+ with
wasm32-unknown-unknowntarget - Node.js 18+
- wasm-pack
# Clone the repository
git clone https://github.com/link-assistant/calculator.git
cd calculator
# Build the WASM package
wasm-pack build --target web --out-dir web/public/pkg
# Install web dependencies
cd web
npm install
# Start development server
npm run dev# Run all Rust tests
cargo test
# Run tests with verbose output
cargo test --verbose
# Run Clippy lints
cargo clippy --all-targets --all-features
# Format code
cargo fmt
# Check formatting (CI style)
cargo fmt --check# Build optimized WASM
wasm-pack build --target web --release --out-dir web/public/pkg
# Build web frontend
cd web
npm run build.
βββ .github/workflows/ # CI/CD pipeline configuration
βββ data/ # Currency exchange rate databases
β βββ exchange_rates/ # Historical exchange rates (.lino files)
βββ docs/ # Documentation and screenshots
βββ src/ # Rust source code
β βββ grammar/ # Lexer, parser, and grammar modules
β βββ types/ # Core types (Value, DateTime, Currency, etc.)
β βββ lino/ # Links notation module
β βββ error.rs # Error types
β βββ lib.rs # Library entry point
β βββ main.rs # CLI entry point
β βββ wasm.rs # WASM bindings
βββ tests/ # Integration tests
βββ web/ # React frontend
β βββ src/ # TypeScript source
β βββ public/ # Static assets
βββ Cargo.toml # Rust project configuration
βββ README.md # This file
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes and add tests
- Run quality checks:
cargo fmt && cargo clippy && cargo test - Add a changelog fragment
- Commit your changes (pre-commit hooks will run automatically)
- Push and create a Pull Request
Unlicense - Public Domain
This is free and unencumbered software released into the public domain. See LICENSE for details.
- Built with Rust and WebAssembly
- Inspired by links-notation
- React frontend powered by Vite



