Skip to content

Getting Started with Kalc

Kalc is a native, free-form computational notepad application for macOS. Inspired by minimalist text editors and tools like Numi and Soulver, Kalc replaces rigid calculator keypads, complex spreadsheet grids, and heavy Electron utilities with a calm, dark notepad surface and live line-by-line evaluated results displayed in a synchronized right-hand gutter.


The Notepad Paradigm

Traditional calculators forget your intermediate steps, while spreadsheets force every thought into row-and-column cells. Kalc takes a third path: computational writing.

You type math, natural language phrases, unit conversions, and variables just as you would jot them down in a markdown file. Kalc parses each line incrementally, evaluates expressions with arbitrary-precision decimal mathematics, and renders formatted answers in an aligned results gutter.

text
# Project Kickoff Estimate
frontend_rate = $110 / hr
backend_rate  = $135 / hr

frontend = 45 hrs * frontend_rate               // $4,950.00
backend  = 60 hrs * backend_rate                // $8,100.00
servers  = 3 * $85 / month * 12 months          // $3,060.00
subtotal                                        // $16,110.00

tax = 8.5% on subtotal                          // $17,479.35
discount = 5% off prev                          // $16,605.38
total in EUR                                    // €15,276.95

5-Minute Quick Tour

1. Variables and Flow

Declare variables with a simple name and an equals sign. Variables evaluate top-to-bottom and are immediately available on subsequent lines:

text
price = $79.99
quantity = 14
subtotal = price * quantity                     // $1,119.86

2. Contextual References (prev)

Use prev to reference the value of the most recently evaluated line above the current cursor position, automatically skipping blank lines, comments, and headings:

text
120 EUR in USD                                  // $130.20
prev + 15% tip                                  // $149.73
prev / 3 people                                 // $49.91

You can even start a line with an operator like +, -, *, or / — Kalc automatically prefixes prev for you:

text
$500                                            // $500.00
+ 20% VAT                                       // $600.00
- 10% discount                                  // $540.00

3. Natural Language & Unit Conversions

Kalc treats conversational English words (plus, times, divided by, in, to) and mathematical operators (+, *, /, ->) interchangeably:

text
25 miles in km                                  // 40.23 km
3 hours 45 mins in minutes                      // 225 min
250 MB at 10 Mbps in seconds                    // 200 s
50 USD as a % of 200 USD                        // 25%

4. Block Aggregates (sum, avg, subtotal)

When summing up a list of figures, write sum or avg. Kalc scans upward until it encounters a blank line or heading:

text
Flight: $450                                    // $450.00
Hotel:  $620                                    // $620.00
Food:   $180                                    // $180.00
sum                                             // $1,250.00

Core Engine Guarantees

  • Zero Floating-Point Drift: Kalc uses exact decimal arithmetic (KalcDecimal) with 38+ significand digits and IEEE 754-2008 Half-Even Banker's Rounding. Calculations never suffer from 0.1 + 0.2 = 0.30000000000000004 binary float inaccuracies.
  • Sub-Frame Recalculation: Incremental re-evaluation executes within an 8.0 ms p95 frame budget on 1,000-line documents (averaging ~0.84 ms on Apple Silicon).
  • Non-Fatal Pipeline: Syntax errors or incompatible unit conversions on one line emit an inline diagnostic badge without interrupting subsequent calculations.
  • 100% Offline & Private: Zero third-party network calls, zero telemetry tracking, and complete offline capability for all math, unit conversions, and cached currency rates.

Next Steps

Native macOS Computational Notepad • Pure Swift with Strict Concurrency