Welcome to today's deep dive. We are really thrilled
to have you with us because today we are talking
about a very specific, highly relatable, kind
of everyday frustration. Oh yeah, a very universal
one. Right. So picture this. You are sitting
at your desk. trying to type a massively long,
complicated mathematical equation into your standard
calculator. Maybe you're doing your taxes or
something. Exactly, doing your taxes or trying
to figure out a messy split bill with friends.
You are opening parentheses, you're closing parentheses.
You are hoping you remembered the order of operations
from, you know, middle school algebra. Please
excuse my dear Aunt Sally. Yes, but... You get
paranoid. So you hit the clear button just to
be safe, completely losing 10 minutes of tedious
work. You start over, you finally hit the equal
sign, and what do you get? Syntax error. Syntax
error. You are lost in a sea of brackets. But
what if there was an entirely different way to
do math, a way where there are zero parentheses,
and where you literally never have to worry about
the order of operations ever again? I mean, it
sounds almost like magic when you phrase it that
way, but it's actually a highly logical, deeply
practical system. And it isn't just a quirk of
calculator history either. No, it's not. It's
a fascinating study in how humans interact with
machines and how sometimes the way we are traditionally
taught to think isn't actually the most efficient
way to get things done. Today, we're exploring
the topic of reverse Polish notation, which is
widely known as RPN. We've pulled together a
really comprehensive Wikipedia article detailing
the history, the mechanics, and the practical
implications of RPN. It's a great source. It
really is. Our mission for this Deep Dives is
to understand how a purely theoretical logic
concept from 1924 became a hidden powerhouse
of early computing and eventually a cult favorite
among engineers and Wall Street bankers. Wall
Street loved this stuff. They really did. We
are going to look at what this whole system teaches
us about pure efficiency. And to help me synthesize
this incredibly dense, globe -spanning history,
I've got our resident expert here. I am very
glad to be here. The story of reverse Polish
notation is it's one of those great technological
narratives. It spans from European logicians
to wartime computer pioneers right down to the
device sitting in your pocket today. Ultimately,
it's a story about the relentless pursuit of
absolute optimization. OK, let's unpack this.
What actually is reverse Polish notation? If
you have a standard calculator in front of you
right now, you use what is called infix notation.
Right. That just means the operator. the plus
or minus sign goes in between the numbers, three
plus four. But in reverse Polish notation, the
operators follow the operands. So instead of
three plus four, you'd enter three, then four,
and then the plus sign. Right. And to understand
the name itself, we kind of have to look at the
Polish part first. Yeah. Where does that come
from? It refers to the nationality of the brilliant
logician Jan Ukasiewicz. Back in 1924, he invented
standard Polish notation. In his system, which
is also known as prefix notation, the operators
precede the operands. So the plus sign comes
first. Exactly. You'd put the plus sign first,
then the 3, then the 4. RPN, or postfix notation,
is quite literally the reverse of Ukasiewicz's
invention. Entering 3 or 4 plus feels incredibly
abstract until you understand how the machine
is actually processing it. To do that, we really
need to talk about the stack. The stack is everything.
It is. Think of the stack like one of those spring
-loaded plate dispensers you see at a buffet
restaurant. It's last in, first out construct.
You push a plate onto the top, and when you need
one, you pop the top plate off. That's a great
mental model. Thanks. Let's walk through a slightly
longer example from our sources to make it clear.
Say you want to calculate 3 minus 4 plus 5. In
RPN, you would punch in 3, enter 4 minus 5 plus.
Exactly. Exactly. And to visualize the physical
mechanics of what you just described, the pushing
and topping, we can look at it step by step.
First, the number three is pushed onto the stack.
The number four is pushed on top of it. At this
moment, the four is on top and the three is sitting
below it. OK, wait, let's hold there for a second.
So I've pushed the three and I've pushed the
four. They're sitting on my mental string loaded
plate dispenser. The four is the top plate. What
happens the exact millisecond I hit the minus
button? What's fascinating here is that the calculator
automatically removes or pops those top two items
from the stack. It performs the calculation of
3 minus 4, and then it puts the result, which
is negative 1, right back onto the top of the
stack. Oh, I see. Yeah, then you enter the 5,
pushing it onto the stack above your negative
1. You hit the plus sign, it pops them both off,
adds them, and leaves you with your final answer
of 4. I hear you saying it is elegant, but...
If I'm being totally honest, writing 3, 4 plus
feels incredibly counterintuitive. Does it actually
save that much time, or is it just a flex for
engineers who want to look smart? No, it saves
a massive amount of time, and to see why, we
have to look at a more complex equation. Think
about the headache of a bulky equation like this.
Open parenthesis, 3 plus 4. Close parenthesis,
multiplied by, open parenthesis, 5 plus 6, close
parenthesis. That's exhausting just to say out
loud. Right. Think of how many keystrokes that
takes. In RPN, that whole messy bracket -filled
equation gracefully flattens out into a linear
left -to -right sequence. 3, enter 4, plus 5,
enter 6, plus multiply. Wow. No brackets, no
holding numbers in your head. Here's where it
gets really interesting. If this was invented
as a theoretical logic concept in the 1920s,
how did it actually make the jump into computers?
Who was the first person to try coding a parenthesis
-free system into a machine? The very first computer
to use post -fix notation wasn't some sleek consumer
gadget. It was Konrad Zuse's Z3 computer in Germany
way back in 1941, followed by a Z4 in 1945. 1941,
so right in the middle of the war. Yes, and Zuse's
Z3 allowed operators in dialogue mode to enter
two operands followed by the desired operation.
But there is a tragic historical detail here,
that pioneering Z3 machine was completely destroyed
in a bombing raid on December 21st, 1943. Wow,
so his breakthrough was just lost. to history
in the rubble? Essentially, yes. It remained
unknown outside of Germany for a long time, though
a replica was eventually built with Zuse's help
much later, in 1961. But that isolation during
the wartime and post -war period set the stage
for one of the most common phenomenons in the
history of science. Parallel reinvention. Exactly,
parallel reinvention. Right, where a bunch of
different people... independently invent the
exact same thing without ever talking to each
other. Precisely. And the reason they were all
inventing RPN at the same time comes down to
what we could call the war for memory. If you
are listening to this on a smartphone right now,
you have billions of bytes of memory in your
pocket. Basically unlimited. Right. But in the
1950s, computer memory was physical, massive
and incredibly expensive. It relied on vacuum
tubes and delay lines. Storing a parenthesis
in a computer's memory cost. precious hardware
space. Literally wasting physical space on a
bracket. Yes. So scientists were desperate to
optimize. The reverse Polish scheme was proposed
again in 1954 by Arthur Birx, Don Warren, and
Jesse Wright. Then it was independently reinvented
again in the early 1960s by Friedrich Bauer and
Edsger Dijkstra to reduce computer memory access
times. I want to highlight Dijkstra for a moment
because the sources give a really great visual
detail about his work. When he was figuring out
how to mechanically convert standard math into
this post -fix notation. He invented something
called the shunting yard algorithm. That's a
classic algorithm. Yeah. And he named it that
because he envisioned the numbers as train cars
rolling down a track and the mathematical operators
pluses and minuses being temporarily held on
a side rail, just like the sorting of trains
in a railroad shunting yard. That train analogy
is vital because it highlights a massive conceptual
shift. Dijkstra wasn't trying to build a machine
that could read math like a grammatical sentence.
He was trying to turn math into a set of actionable
instructions. An active recipe rather than a
static statement. Exactly. And he wasn't alone
in this realization. In the mid -1950s in Australia,
a philosopher and computer scientist named Charles
Hamlin created a high -level programming language
called George, which utilized these concepts.
His work was largely driven by the sheer memory
overhead required to process mathematical brackets.
So we have Germany, the UK, Australia. What about
the United States? Over in the U .S., around
1958, a designer named Robert Barton was independently
developing RPN for the massive Burroughs B5000
computer. And how did he stumble onto it? Was
he reading Hamblin's work from Australia? Not
at all. He happened to read a 1954 textbook on
symbolic logic by Irving Kopi. Barton found a
brief reference to Polish notation in the text,
went down a massive rabbit hole reading Jan Jukasiewicz's
original works, and applied it to computer architecture
before he even knew about the innovations happening
in Australia. That's incredible. It really highlights
how this concept was a fundamental puzzle piece
waiting to be found by the hardware designers
of the era. But it didn't stay locked away in
those massive room -sized mainframes forever.
Eventually, it had to make the jump to the calculators
sitting on people's desks. The transition really
kicked off in June 1963 with the Fryden EC130
desktop calculator. This device was designed
by Bob Reagan. And it featured a four level stack
that was actually displayed on a tiny cathode
ray tube screen. A CRT screen on a calculator.
Yeah. And they showed the stack upside down.
So the last in first out register was visibly
sitting at the bottom of the screen. Following
that, you had the Monroe Epic around 1966 supporting
a similar input scheme. But the company that
truly turned RPN into a religion. Was Hewlett
Packard. Was absolutely Hewlett Packard. Hewlett
Packard totally dominated this space. Their engineers
designed the 9100A desktop. top calculator in
1968, utilizing a three -level stack. They had
working registers named X for the keyboard, Y
to accumulate data, and a visible storage register
Z for temporary holds. A very solid design. It
was. This calculator was a massive hit and popularized
RPN among the scientific and engineering communities.
But in 1972, they fundamentally changed the game.
That was the year they released the HP -35. It
was the world's first handheld scientific calculator.
If you are listening to this and trying to visualize
that era, imagine you were an engineer in 1972
holding this HP -35. This wasn't just a calculator.
This was a supercomputer that could suddenly
fit inside your pocket. And it introduced what
is now known as the classical four -level RPN
stack. Instead of three levels, you had the XYZ
and T -registers T standing for top. This specific
architecture had very distinct, highly optimized
rules. How so? Well, for instance, the enter
key, which was mandatory since you didn't have
an equals sign, uniquely duplicated values into
the Y register under certain conditions. And
when you popped a number off the stack, that
top T register would duplicate itself on drops.
They called it top stack level repetition. So
it was just copying that top value down as you
worked. Right. The entire purpose was to ease
complex calculations and save the user precious
keystrokes. HP lean. into this identity hard.
In the 1980s, they even handed out promotional
hats that just said no equals. I love that. It
is such an incredibly nerdy piece of marketing,
but it was brilliant. It was a boast about the
quality of their engineering and a literal reference
to the fact that their RPM calculators didn't
have an equals key. They used RPN on every handheld
calculator they sold, scientific, financial,
programmable, until about 1977. But it didn't
stop there. Right. The sources note that the
evolution didn't stop with that four -level stack.
In 1986, HP introduced RPL. The shift to RPL
was incredibly significant. It moved away from
that fixed, rigid four -level stack and introduced
a dynamic stack. This new stack was only limited
by the amount of available memory on the physical
device. Wait, the sources also call RPL an object
-oriented successor to RPN. I'm used to my calculator
just handling flat numbers. What does it actually
mean for a calculator to treat something as an
object on a stack? That is a great clarification
to make. In the older traditional RPN calculators,
the stack could only hold numbers, a three, a
four, a decimal. But a dynamic object -oriented
stack can hold entirely different kinds of data.
You could push a text string onto the stack.
You could push a complex mathematical matrix
or an entire list of variables. So it's not just
basic arithmetic anymore. Not at all. You could
even push a graphic image onto the stack, and
the calculator's programming would know how to
handle that specific object. That drastically
changes the behavior of the machine, doesn't
it? Because if you have an unlimited stack holding
all these different objects, there is no top
register to automatically duplicate when you
drop a value anymore. Correct. Plus, instead
of just silently dropping values off the stack
when it overflowed like the older models did,
the RPL system would actually display an error
message if you ran out of physical memory. But
we should be careful to point out that while
HP gets the lion's share of the historical credit,
RPN was definitely not just an HP phenomenon.
Right. The sources list a surprising number of
fascinating implementations globally. In Britain,
Clive Sinclair released the Sinclair Scientific
in 1974 using RPN. Commodore produced their Minuteman
models. The Soviets used it too. Yes. In the
Soviet Union, programmable calculators like the
MK -52 and MK -61 utilized RPN for both automatic
mode and programming. It is amazing how enduring
those designs are. Modern Russian calculators
designed in Novosibirsk since 2007 are actually
still backwards compatible with those Soviet
models. That's wild. And there is a huge community
today building modern hardware, like the Swiss
Micro's replicas of classic HP devices. You also
see RPN living on in software languages. The
PostScript page description language uses it,
as does the stack -oriented programming language
for it. So what does this all mean? We have traced
this from wartime mainframes to modern software,
but the lingering question for anyone listening
is, why? If I already spent years in school learning
how to write 3 plus 4, why should I retrain my
adult brain to write 3, 4 plus? The answer comes
down to two highly measurable metrics, speed
and accuracy. Testing comparing RPN with standard
algebraic notation consistently found that RPN
led to much faster calculations. Now, initially,
people assumed this was because the system placed
a lower cognitive load on the brain, but later
research clarified the nuance. It wasn't that
the brain was working less, right? It was purely
physical. Exactly. The increased speed simply
came down to the fact that the user had to press
far fewer keys. Without the need to open and
close parentheses, you are physically doing less
work. to input a complex formula. Furthermore,
the testing showed that users of reverse Polish
calculators actually make fewer mistakes than
users of standard calculators. I really like
the comparison from the text that likened using
an RPN calculator to the workflow of using a
traditional analog slide rule. Yes, that's the
perfect analogy. With a slide rule, you are constantly
feeding intermediate results right back into
the next step of the problem without needing
to write anything down on a piece of scratch
paper or hit an equals key to finalize a thought.
RPN operates the exact same way. You aren't stopping
and starting. You're just flowing through the
math. If we connect this to the bigger picture,
though, we do have to acknowledge the catch.
The sources provide a very balanced view here.
Anecdotal evidence strongly suggests that RPN
is, in fact, more difficult for users who have
already had standard algebraic notation hardwired
into their brains. It demands a totally different
way of parsing a problem. That makes total sense.
If you spend your whole life reading sentences
formatted as subject -verb -object, suddenly
switching to subject -object -verb is going to
trip you up, even if it technically uses fewer
letters. Exactly. So it represents a classic...
human -computer interaction trade -off. You are
trading a steep initial learning curve for a
lifetime of long -term efficiency. Let's recap
this incredible journey. We started with a Polish
logician, Jan Jukasiewicz, in the 1920s, who
just wanted a cleaner way to write logic equations.
purely theoretical concept, was grabbed by Conrad
Zuse for the earliest computers to save precious
memory, and then mathematically refined by computer
scientists all over the globe, from Australia
to the United States. A truly global effort.
It revolutionized the calculator industry, largely
thanks to HP putting an incredibly powerful four
-level stack right into the pockets of engineers
and scientists. And ultimately, it proved that
the way we are taught math in grade school isn't
the only way for humans and machines to communicate.
I think that is the most enduring lesson of reverse
Polish notation. We touched on this earlier with
Dijkstra's train yard analogy. But RPN forces
us to look at an equation not as a static sentence
to be passively read, but as an active sequence
of events to be executed. And that is a mindset
shift that goes far beyond mathematics. How so?
Well, I would encourage you listening to this
to consider your own workflows. How many systems
in your daily life are currently bogged down
by metaphorical parentheses? What standard conventions
are you clinging to just because it is how you
were initially taught? You might find that some
areas of your work or thinking could become infinitely
faster if you just stripped away those conventional
brackets, embraced a sleeper learning curve,
and learned to approach the problem in reverse.
That is a brilliant thought to end on. Thank
you so much for joining us on this custom deep
dive into reverse Polish notation. We hope you
walk away with a little more appreciation for
that trusty calculator and perhaps a totally
new perspective on what efficiency really looks
like. Until next time, keep questioning the obvious.