| author | Alan Dipert
<alan@tailrecursion.com> 2026-02-21 16:26:39 UTC |
| committer | Alan Dipert
<alan@tailrecursion.com> 2026-02-21 16:26:39 UTC |
| parent | 79e38bbcd96e102ddb954b7a0436d1fddbbfd9f8 |
| md/_GridCalc.md | +11 | -11 |
diff --git a/md/_GridCalc.md b/md/_GridCalc.md index 10865cb..da364ca 100644 --- a/md/_GridCalc.md +++ b/md/_GridCalc.md @@ -10,7 +10,7 @@ An [RPN](https://en.wikipedia.org/wiki/Reverse_Polish_notation) Spreadsheet for Created Friday 20 February 2026 - [Demo video](https://youtu.be/M0HwzrGGuyc) -- [App Store](https://apps.apple.com/no/app/gridcalc/id6759011187) +- [App Store](https://apps.apple.com/us/app/gridcalc/id6759011187) I built GridCalc because I wanted a spreadsheet that felt native to a phone and native to my brain. @@ -61,28 +61,26 @@ In GridCalc, the program is always visible because the grid *is* the formula. It ## UI evolution -My first UI model appended two cells for every operation: one cell for the op label and a second cell for the numeric result. It was clear, but wasteful. +My first UI model appended two cells for every operation: one cell for the op label and a second cell for the numeric result. It was clear, but wasted valuable screen space. -My friend Micha Niskin pushed me to combine them, so that every operation shared a cell with its result. That gave the grid a lot more breathing room. Later, another friend, Jesse Lundberg, suggested putting the op in a small badge that lives in the gutter between cells. That change preserved legibility while dramatically improving density. - -Between these two visual enhancements I had the compact but legible layout I had been groping toward. +My friend Micha Niskin pushed me to combine them, so that every operation shared a cell with its result. That gave the grid a lot more breathing room. Later, another friend, Jesse Lundberg, suggested putting the op in a small badge that lives in the gutter between cells. That change preserved legibility while improving density. ## Where RPN fits <figure style="float: right; margin: 0 0 1rem 1rem; width: 312px;"> - <img src="./_GridCalc/clp_calc.png" alt="CLP’s Nice Calculator" width="100%" /> - <figcaption style="font-size: 0.9em; font-style: italic;">CLP’s Nice Calculator, which inspired the editable expression idea.</figcaption> + <img src="./_GridCalc/clp_calc.png" alt="CLP's Nice Calculator" width="100%" /> + <figcaption style="font-size: 0.9em; font-style: italic;">CLP's Nice Calculator, which inspired the editable expression idea.</figcaption> </figure> If you have not used [RPN](https://en.wikipedia.org/wiki/Reverse_Polish_notation), the mental model is simple. You push values and then apply operators. For example, instead of typing `(3 + 4) * 5` you type `3 4 + 5 *`. That model is fast and easy, once it clicks. A linear instruction stream maps cleanly onto a grid. A similar scheme is the basis for [stack machines](https://en.wikipedia.org/wiki/Stack_machine), which is probably where I first encountered the idea (many of the first Lisp compilers targeted virtual or "bytecoded" stack machines. The JVM is the world's most successful stack machine). -But it wasn't until I encountered Christian Lawson-Perfect’s excellent [Nice Calculator](https://somethingorotherwhatever.com/items/clp-s-nice-calculator/) web app that I started to use an RPN calculator day to day. It renders expressions as editable bubbles in a tree, which is a beautiful UI idea. I wanted that same editability, but with a layout that uses screen space better on a phone, and with a way to refer symbolically to previous inputs and results. +But it wasn't until I encountered Christian Lawson-Perfect's excellent [Nice Calculator](https://somethingorotherwhatever.com/items/clp-s-nice-calculator/) web app that I started to use an RPN calculator day to day. It renders expressions as editable bubbles in a tree, which is a beautiful UI idea. I wanted that same editability, but with a layout that uses screen space better on a phone, and with a way to refer symbolically to previous inputs and results. ## Under the hood -- Exact arithmetic using [Constructive Reals](https://chadnauseam.com/coding/random/calculator-app) in Swift. I learned about Constructive Reals years ago and could not not use them. The engine evaluates lazily and computes only as much precision as needed. +- Exact arithmetic using [Constructive Reals](https://chadnauseam.com/coding/random/calculator-app) in Swift. I learned about Constructive Reals years ago and couldn't resist using them. The engine evaluates lazily and computes only as much precision as needed. - Spec-generated state machines. The interaction modes, file workflows, and save states are modeled as [hierarchically nested states](https://en.wikipedia.org/wiki/UML_state_machine#Hierarchically_nested_states) with generated runtime and tests. This became necessary after a three-year old beta tester (my son) managed to deadlock the UI within seconds. - Aggressive unit testing with [XCTest](https://developer.apple.com/documentation/xctest) and [Maestro](https://maestro.mobile.dev/). @@ -92,13 +90,15 @@ This project stalled for years because the idea only ever lived in conversations ## Closing -GridCalc is small and opinionated. It is not Excel. It does not try to be. It is a phone-native tool for scratch modeling with a visible program. If you ever wanted RPN on your phone but also wanted to reuse your own work, I encourage you to give GridCalc a try. +GridCalc is small and opinionated. It is not Excel. It does not try to be. It is a phone-native tool for scratch modeling with a visible program. + +If that way of thinking resonates, you can watch the [demo video](https://youtu.be/M0HwzrGGuyc), see it on the [App Store](https://apps.apple.com/us/app/gridcalc/id6759011187), or join the discussion on Hacker News. I'm happy to answer questions about the design or implementation in the comments there, or at [alan@crowncompass.tech](mailto:alan@crowncompass.tech). ## References - [Constructive Reals background](https://chadnauseam.com/coding/random/calculator-app) - [creal.js](https://github.com/christianp/creal.js) -- [CLP’s Nice Calculator (inspiration)](https://www.chrisl.org/calculator/) +- [CLP's Nice Calculator (inspiration)](https://www.chrisl.org/calculator/) <figure style="margin: 1.5rem 0 0 0; max-width: 520px;"> <img src="./_GridCalc/byte_gridcalc.png" alt="GridCalc magazine cover mockup" width="100%" />