I don't remember exactly how I fell into this rabbit hole but, ten years after its discontinuation, I have discovered a legendary product. Mathematicians hoard [the perfect chalk](https://en.wikipedia.org/wiki/Hagoromo_Fulltouch_Chalk#Popularity_and_legacy), magicians collect [the perfect playing cards](https://en.wikipedia.org/wiki/Jerry%27s_Nugget_playing_cards), and a certain generation of engineers fondly remember the perfect calculator:
![[hp-marketing.jpg]]
Here are some descriptions of this calculator:
- "It is widely considered the best calculator for engineers, scientists, and surveyors." - [wikipedia](https://en.wikipedia.org/wiki/HP_49/50_series)
- "The pinnacle of calculator OSs for me. RPN, stack based programming, lisp. It really was wonderful." - [hacker news](https://news.ycombinator.com/item?id=12364089)
- "This is the last "great" engineering calculator" - [youtube comment](https://www.youtube.com/watch?v=eBK60gQjeIA&lc=UgyFxX4hf9AxdUZ7nax4AaABAg)
- "Actually, this is not really a calculator: it is a hand-held math computer with a calculator-style human-machine interface. The capabilities of this math computer are mind boggling." - [amazon review](https://www.amazon.com/gp/customer-reviews/RRA8842K04BJZ)
- "The best calculator ever made" - [hacker news](https://news.ycombinator.com/item?id=18912931)
- "There is no other calculator that comes a 'distance second place'." - [amazon review](https://www.amazon.com/gp/customer-reviews/RLEU3W2TGS6MD/ref=cm_cr_getr_d_rvw_ttl?ie=UTF8&ASIN=B000GTPRPS)
I find it impossible to read these quotes and not want to learn more, what makes this calculator from the 90s[^1] so great? Does it have anything to teach us today?
The 50g came with a massive library of numerical tools for doing anything an engineer might plausibly need to do, but so did the contemporaneous TI-89 and nobody calls that "the best calculator ever made" so it doesn't seem to be the important factor. ([though](https://www.reddit.com/r/EngineeringStudents/comments/1xah8m/comment/cf9ml6g/))
As best I can tell, this is the vim/emacs/xmonad of calculators:
- Just like [vim is hard to quit](https://youtu.be/TLbfqZBL8t8) until you know the magic incantation, the vast majority of people would have a hard time using this calculator to add two numbers. To add 2 and 2 you must type `2<Enter>2+`. I've never used this calculator for serious number crunching (or at all) so I can't confirm, but the propaganda claims this style of input is particularly well-suited for interactive math.
- If the syntax looks familiar, yes, you're looking at a forth. The way you operate this calculator is just a hair's breadth removed from _programming_. It's called RPL, "reverse polish lisp". (the name made sense at the time, but by modern standards it has nothing to do with lisp, best to think of it as a higher-level forth)
- This means, once you learned to use this calculator you had also learned to program it:
- `SQ PI *` takes a radius from the stack and returns the area of a corresponding circle
- `<< SQ PI * >>` takes two more keystrokes and throws a nice first-class function onto the stack
- You can save this function for later exactly as you would save any other variable. Over time you build a namespaced library of useful snippets specific to your work.
- The system is itself written in RPL and exposes a large number of extension points, making the calculator extremely customizable. You can change what any of the keys do, customize the menus, and browse a large catalog of user-created software. This is not a calculator, this is a toolkit for building the perfect calculator for your task at hand. I am overstating it but this might have been what using it felt like at the time.
The above all sounds great but I should stress this calculator is comically hard to learn to use; I wonder how much of the reverence derives from close variants of stockholm syndrome / the IKEA effect. Many of the features are completely undiscoverable from inside the calculator and can only be found by reading through ~2000 pages of manuals:
- The [quick start guide](https://literature.hpcalc.org/items/254) (61 pages)
- The [user's manual](https://literature.hpcalc.org/items/263) (184 pages)
- The [user's guide](https://literature.hpcalc.org/items/256) (887 pages)
- The "[advanced user's reference manual](https://literature.hpcalc.org/items/253)" (693 pages)
A fun example: the [top negative amazon review](https://www.amazon.com/gp/customer-reviews/R214K5DHEE0S8) of this calculator complains doing a unit conversion from hours to seconds takes ~15 key presses. I can't quite blame them for failing to notice page 636 of the advanced user's manual, the only place in these 2000 pages which mentions a useful keyboard shortcut for doing this unit conversion in 6 easy key presses:
> [!tip] easy peasy
> ![[50g-unit-conversion.png]]
I'm probably seeing what I want to see here, but we live in an era of limited [end-user programmability](https://www.inkandswitch.com/end-user-programming/) and I find it interesting the most revered calculator is one which was so programmable. This interface has a number of cool properties:
- The barrier to programming is extremely low. There's no compiler toolchain to mis-configure, no need to even open a text editor; you just start typing.
- Bash is also extremely programmable, and it's entirely possible to automate common workflows by writing a script and throwing it into `~/bin`, but empirically... I don't seem to do this very often. There's a fair amount of incidental complexity here (like parsing tables of text back into numbers) which means this only happens for very useful scripts.
- Compared to the UNIX shell which more-or-less composes, all the tools in the 50g were written by the same team of people and designed to compose well. Of course, it helps that this isn't trying to address all your computing needs, it's just trying to help you do math.
- You spend your time inside a shell with full view of a shared scratch space, the stack. The programs you call communicate via this stack, giving you full control over how data is shuttled around. Compare this to the current computing paradigm which exposes a collection of apps which each manage their own silo of data and communicate via alt-tab copy-paste: Strava has all your runs and excel can pivot tables but no, of course you can't throw all your runs into a pivot table.
[^1]: The 50g was sold from 2006->2015 but its soul first appeared in the HP 48, launched in 1990. Some features were added to each new revision but the design of the 50g and the vast majority of its functionality had been set in stone by the end of the 90s. To give an example: somewhere along the way HP stopped making [the chips](https://en.wikipedia.org/wiki/HP_Saturn) powering these things and rather than rewrite anything decided to have the 50g run the entire operating system _inside an emulation_ of the discontinued processors.