Do people have any quick intuitions on the ergonomic differences between polish and reverse polish notation for simple physical calculators?
Seems to indicate reverse polish notation is better (ergonomically)
My initial intuition was to prefer polish notation because I’m more used to it
But they seem to compare Reverse Polish Notation vs. Algebraic notation, which I assume is normal algebra with operator precedence
I am also leaning towards reverse polish notation, but I was just curious about the polish notation side since that’s how Lisp writes things
This is just for a toy calculator project
oh damn, I mis-read
yeah you’re right
maybe implement a switch for both modes
and see which one is more fun to use :stuck_out_tongue:
thanks ^.^
Have you personally used a reverse polish notation calculator? Such as from HP?
or do you use forth or something
I’ve never used reverse polish notation in a calculator
Until this moment I didn’t know I could buy a reverse polish notation calculator
now I’m tempted to get one xD
It’s lame but I want to build a physical calculator lol
I think it’s cool to build stuff
BTW I think there is a specific case where polish notation might be easier than reverse polish
actually nvm it doesnt make sense
oops xD
mmm well I do assume that language designers have an intuition on this stuff lol
The HP calculators were pretty popular back in the day. They used reverse polish notation.
i think it also relates to the spoken language of the user. In spoken language where verb always precedes the subject(s), polish notation might feel more natural (add one and two) vs (one and two add) In languages where the verb can be placed at the end (like German?), reverse polish notation might feel more comfortable
Either way one of the things that really bug me about physical calculators is the lack of a cursor. I wish there was a d-pad with a cursor for editing things, and a backspace button because I always make accidental presses in a calculator
I know some calculators come with this feature but I wish it were universal
Modern calculators have d-pads: https://www.youtube.com/watch?v=cAAUS6JB-YM
I think the reason RPN is more popular is that it can evaluate your inputs right away. If you use PN, you potentially need to keep an arbitrarily long “context” first.
E.g., for 1 2 + 4 *
, after you enter 1 2 +
, it can simplify that to 3 immediately.
But if you use PN, then for * + 1 2 4
, you need to remember *
first. Simplify + 1 2
to 3. And then evaluate * 3 4
to 12.
ah I see
RPN it is
Well, this is talking from the perspective of implementing it quick and easy
I do think that PN is much nicer from users’ perspective
How come?
Basically because it’s verb then noun, rather than noun then verb. I’m more familiar with the former.
ah
I’m leaning more towards RPN because the user may wish to push values to the stack
without being sure what function to run on it yet
Yeah, that’s a legitimate reason to lean toward RPN.
There is a language called Factor. Seems like a reverse version of Racket. https://en.wikipedia.org/wiki/Factor_(programming_language)
They call this paradigm concatenative language. One interesting property is that they don’t have named variable in their code. https://concatenative.org/wiki/view/Concatenative%20language
Factor is/was interesting. It was more of an exploratory system. The creator Slava Pestov works on Swift now IIRC.
> exploratory system … By this I mean it was like Squeak/Pharo/Self, but more forthy
Ah, you are correct. He is now working on Swift. But Factor is still under development. And they’ve done a lot to make the system performance pretty good, it is still fun to watch Factor tech talk @ Google 2008. https://factorcode.org/slava/\|https://factorcode.org/slava/