Back
Cali: Cross‑Platform Text-First Calculator with a Custom Financial DSL
CALI CALI CALI

Cali

Cross‑Platform Text-First Calculator with a Custom Financial DSL

Cali is a text-first calculator for people who think in documents instead of cells.

cali-app/cali

88

Hours

3

Weeks

270

Commits

Solo Developer

Role

Private
About

Cali is a text-first calculator for people who think in documents instead of cells. It lets you write linear, human-readable calculation files—complete with labels, section totals, running balances, units, and currencies—and get spreadsheet-grade results without juggling references or UI formulas. Calculations are saved as plain-text `.cal` documents with metadata and inline results, so they can be versioned, reviewed, and shared like code, or even encoded into a URL for backend-free sharing and restoration. Under the hood, Cali is powered by a standalone TypeScript calculation engine with a custom lexer, parser, and evaluator, instead of embedding ad-hoc logic in the UI. The engine models labels, totals, percentages, units, and currencies as explicit AST node types, enabling predictable evaluation rules and reuse across a Next.js web app, a Tauri desktop app, and a Node.js CLI. A generic unit-conversion system (with categories, aliases, and non-linear temperature transforms) and a multi-tier CurrencyService (in-memory cache, localStorage, live API, static fallbacks) handle real-world complexity while remaining testable and offline-tolerant. On the frontend, a custom CodeMirror language, formula-collapse widgets, and label-aware autocomplete turn the DSL into an IDE-like editor tailored to Cali’s semantics. Cali’s architecture is intentionally modular: shared React components and engine packages ensure the same calculation behavior and UX across platforms, while the `.cal` format and URL-safe compression make calculations diffable, portable, and easy to integrate with other tools.

Key Features

Engineered a standalone calculation engine with custom lexer, parser, and evaluator so complex financial-style expressions run consistently across web, desktop, and CLI without UI coupling.

Designed a domain-specific expression language supporting labels, scoped section totals, and running balances, enabling spreadsheet-like reasoning inside a linear text document without external references.

Implemented a unit conversion framework with categorized registries, aliases, and non-linear temperature transforms, ensuring safe, accurate conversions between arbitrary unit pairs in user calculations.

Built an offline-tolerant CurrencyService layering in-memory cache, localStorage, live API calls, and static rate tables so currency conversions remain reliable even without network connectivity.

Created a human-readable .cal document format with metadata headers, sections, and inline result preservation, making calculations shareable, diffable, and previewable across tools without proprietary formats.

Integrated the engine with a custom CodeMirror language, formula-collapse widgets, and label-aware autocompletion, delivering an IDE-like calculator editor tailored specifically to Cali’s DSL.

Implemented URL-safe compression of full calculator documents into query parameters, enabling backend-free sharing, bookmarking, and restoration of complete calculation sessions.

Modularized shared UI components and engine logic so the same calculation experience runs uniformly across Next.js web, Tauri desktop, and CLI applications.

Built with
TypeScriptRustSwiftReactNext.jsTauriInkCommander.jsCodeMirror
Impact

Cali turns plain text documents into shareable, unit- and currency-aware calculators, helping users model real-world calculations consistently across web, desktop, and command-line environments.