I love RPN calculators. My favorite is Hypatia which I use regularly for calculations. I love being able to order my calculation to avoid brackets and being able to enter a list of numbers and add them up with a single command:
hy 12 23.4 43 94 3 d SUM
Now I am wondering about a full computer language built from the ground up as an RPN language?
A bit of googling led me to RPL or Reverse Polish Lisp which is close. I wonder if this direction has been explored in other languages.
I am imagining a language where assignment is pretty straight forward (with explanatory pseudocode comment):
1 a = # a = 1
boolean expressions are just regular RPN:
a 1 + b > # a + 1 > b
and an if control structure would look like:
; bf ; bt ; a if # if a then bt else bf;
the meaning of the “;” token is to push following tokens (until the next structural token) unevaluated onto the stack as a single entry. The if token evaluates the top stack entry (a) and then evaluates either the second (bt) or the third (bf).
A do while loop would look like this:
; b ; a dowhile # do b while a;
The dowhile token evaluates the second stack entry (b) and then the first (a) and repeats until a is false.
A key of RPN expressions is that there are no brackets required – by analogy in a RPN language there would be no nested statements!
Open question. Can this idea be developed into a usable programming language?



[...] I have created Ambi Calculator and Programming Language as a result of investigation about the possibility of a Reverse Polish Notation Language. [...]