[HN Gopher] What Is RPN? Why Did/Does HP Use RPN? Learning RPN (...
       ___________________________________________________________________
        
       What Is RPN? Why Did/Does HP Use RPN? Learning RPN (1999)
        
       Author : susam
       Score  : 72 points
       Date   : 2021-03-06 18:31 UTC (4 hours ago)
        
 (HTM) web link (www.hpmuseum.org)
 (TXT) w3m dump (www.hpmuseum.org)
        
       | teej wrote:
       | The article briefly mentions RPL. It's a programming language for
       | Hewlett-Packard RPN calculators. It's an interesting curiosity if
       | you're in to niche programming languages.
       | 
       | https://en.wikipedia.org/wiki/RPL_(programming_language)
        
       | Klwohu wrote:
       | RPN is just so much better. An interesting note, the HP 50g can
       | be programmed in RPL, but you can also use the equation editor
       | and mix and match code and equations.
        
       | dano wrote:
       | My personal collection of HP's from back in the day. All are
       | operational and I have the original manuals from a few.
       | 
       | https://photos.app.goo.gl/McLDSnm5ksaRQhSJA
        
       | rbanffy wrote:
       | It's simpler to implement RPN than algebraic notation with
       | precedence. The latter requires an operation stack where
       | operations are stacked until they encounter a lower precedence
       | operator or the user presses =.
       | 
       | The user types less, the computer does a lot less.
       | 
       | I find it fun to think in RPN.
        
         | jeffbee wrote:
         | Yeah, it feels like the whole "why" is that RPN reflects how
         | the machine works, so it's easier to build it that way.
        
           | ajarmst wrote:
           | Well, it's easier to build because it has a terse syntax that
           | requires fewer symbols, doesn't need precedence and
           | associativity rules, and has no ambiguous instructions. It's
           | easier to _use_ for the same reasons.
        
             | tome wrote:
             | > has no ambiguous instructions
             | 
             | Really? What do you call an operator applied to an empty
             | stack? A sequence of commands that leaves the stack non-
             | empty? I don't see why that's any less ambiguous than
             | mismatched parentheses.
        
               | jonsen wrote:
               | > A sequence of commands that leaves the stack non-empty?
               | 
               | That's actually a feature. It's even fundamental in
               | concatenative programming languages such as FORTH and
               | Factor.
        
               | jonsen wrote:
               | > What do you call an operator applied to an empty stack?
               | 
               | [Pi] for example is an operator which can push the value
               | of Pi onto an empty stack.
        
               | jeffbee wrote:
               | Why would any person or machine care that the stack
               | wasn't empty?
        
               | jonsen wrote:
               | And there is actually no such thing as an empty stack on
               | an RPN calculator. A four register stack, as is common,
               | always holds four numbers.
        
           | what-do-I-know wrote:
           | It may be easier to build, but that difference is quite small
           | and not likely something that would have influenced the
           | design of a scientific calculator. Many people have found RPN
           | to be a superior user interface, and that's likely the "why".
        
         | abhinav22 wrote:
         | Yep!! I implemented an rpn calculator in Swift and it was a
         | breeze - very easy to do.
         | 
         | Here's the code:
         | 
         | https://github.com/ashok-khanna/RPN-31
         | 
         | Here's the link:
         | 
         | https://apps.apple.com/ae/app/rpn-30/id1451413517
        
       | gumby wrote:
       | This is an odd explanation. II mean I t may be factually correct
       | but has nothing to do with why people choose to use RPN
       | calculators.
       | 
       | When calculating with an RPN calculator you do the calculation
       | the same way you would by hand: "ok, figugpre out the numerator,
       | now calculate the denominator, ok, do the division, ok now
       | there's a product, so do the multiplication, now add it to that
       | fraction I just calculated..." except you don't need to write
       | down the partial results.
       | 
       | Not only is it fewer keystrokes and parentheses and such, but as
       | you're doing it as you naturally would anyway you're less likely
       | to get lost.
        
       | pcardoso wrote:
       | When I was starting my degree (around 96) I went to the US for a
       | week and bought a HP48Gx since they were cheaper there. This
       | happened a few weeks after a Swiss jet crashed departing NY and
       | the reasons were not known at the time so the airport staff was
       | very suspicious. When they saw the calculator and tried to do a
       | simple test calculation and failed, I struggled to explain how
       | use it, since it was also so new to me. Luckily I got 2 out of 1
       | 1 + and I was let go... still have and love it.
        
       | disabled wrote:
       | It took awhile to learn RPN in undergrad in electrical
       | engineering. But, once you learn it, it is so much easier to
       | solve problems and it is much more efficient. You never go back,
       | and you are less likely to make errors entering in equations
       | compared to your peers. This is important on timed exams.
       | 
       | I prefer to always use RPN. MacOS has an RPN mode on their
       | calculator, which one can activate by pressing command + R. On my
       | iPhone I have an app called i41CX+, which is an HP-41CX emulator.
       | I highly recommend the app, as the developer is constantly
       | updating it. It probably is the most updated app I have of all of
       | my apps.
       | 
       | Also apparently there are some companies that recreate old HP RPN
       | scientific calculators: https://www.swissmicros.com/products
        
         | ajarmst wrote:
         | My daughter is at the learning algebra stage. I note that the
         | way they teach kids to parse algebraic notation is by building
         | an infix operation tree. If they'd just take the natural next
         | step of discussing postfix (and prefix) traversal, everyone
         | would think rpn natural.
        
         | ghaff wrote:
         | >On my iPhone I have an app called i41CX+
         | 
         | The dev sent me the upgraded one after I reviewed the free(?)
         | one in CNET years ago. I used an HP-41CV with various expansion
         | packs for years. It doesn't have the same feel as the sadly
         | broken physical calculator of course but I still like it. I
         | basically don't anything these days more than simple arithmetic
         | these days though--and if I did I'd use a computer. (I have
         | been tempted by the Swiss Micro models but that would be a pure
         | nostalgia-fueled buy on my part.)
        
         | jjav wrote:
         | RPN is so nice and efficient, can't imagine using anything
         | else. I like that the OSX calculator does RPN.
         | 
         | But mostly I use my old 28S which is next to my keyboard
         | always. Also have a 50g on the desk, but I prefer the 28S.
        
           | tzs wrote:
           | I get annoyed by the ways the OS X calculator deviates from
           | HP RPN.
           | 
           | The main one is that the pi and e keys act as if they are
           | invoking constant functions that return pi and e,
           | respectively. On an HP calculator, the pi key enters pi.
           | 
           | That may sound like the same thing, but it is not. Consider
           | this sequence:                 2 ln  pi x
           | 
           | On my HP 15C the result is to multiply the natural log of 2
           | and pi. Same thing with PCalc on my iPhone. With OS X
           | calculator the result is either pi with an error beep if you
           | started with an empty stack or pi times whatever was on the
           | top of the stack if you started with a non-empty stack.
           | 
           | The "2 ln" part leaves ln(2) on the stack. On the HP and
           | other sensible calculators the pi key pushes pi. On the MacOS
           | calculator, it replaces the top of the stack with pi.
           | 
           | They also had some problems where if you did a function and
           | then started entering digits it would overwrite the function
           | result, but I think they fixed those. I've seen what I
           | thought was that problem recently, but when I finished
           | entering the number and hit enter or invoked a function on
           | the number, the previous function result appeared second on
           | the stack, so it apparently is just a bug in displaying the
           | stack.
        
           | ghaff wrote:
           | After using a 41CV for years, I bought a used 28S off
           | someone. I just never cared for it. Probably just too
           | accustomed to the more traditional RPN calcs.
        
         | ajsnigrutin wrote:
         | yep, rpn is great!
         | 
         | And since you're solving part by part, it's easier to spot
         | mistakes in calculations.
         | 
         | Going back to algebraic is pretty much impossible... luckily,
         | there are many rpn calculator apps for phones.
        
         | senkora wrote:
         | Emacs calc-mode is RPN by default as well.
        
           | tonyarkles wrote:
           | calc-mode is wholly responsible for my HP49G+ not having had
           | its batteries replaced in a few years. :D
        
         | pwg wrote:
         | My 'desktop' calculator on my Linux machines:
         | 
         | http://lashwhip.com/grpn.html
         | 
         | (yes, I know that xcalc has an HP mode, but I only learned of
         | that mode long after I'd begun using GPRN.
         | 
         | The calculator on my Android phone (I 'disabled' the maker
         | installed one):
         | 
         | https://play.google.com/store/apps/details?id=org.efalk.rpnc...
         | 
         | And I've still got my original 80's HP-15C.
        
       | anonymousiam wrote:
       | I bought an HP41C in 1979, and I have been a fan of RPN ever
       | since. I tossed the 41C back when I got my first Palm HPC and
       | installed the "RealCalc" app. I'm glad that some of the modern
       | calculator apps still support this mode.
        
       | kuon wrote:
       | RPN is a lot like vim, the first time you are like DUH! I can't
       | add 2 and 2. But if you take the learning curve, it becomes very
       | efficient and you cannot move back.
        
       | prionassembly wrote:
       | See also: https://medium.com/@hlship/confessions-of-a-threading-
       | macro-...
        
       | spullara wrote:
       | I did so much programming on the HP 28S and the HP 48Gx. Really
       | an awesome mobile programming platform at the time.
        
       | abhinav22 wrote:
       | I have a very successful (and free) rpn calculator for iPhone for
       | those interested:
       | 
       | https://apps.apple.com/ae/app/rpn-30/id1451413517
        
       | m463 wrote:
       | Reading these comments, I'm surprised that people think in RPN.
       | (I mean I shouldn't be, I just didn't think of it)
       | 
       | I wonder if teaching it early on, instead of parenthesis, would
       | have made math lessons different?
       | 
       | Could there have been different notations used for things like
       | factoring out a quadratic equation?
        
         | leejoramo wrote:
         | I learned RPN as a college freshman studying engineering in the
         | late 1980's. Almost all of my fellow students had HP RPN
         | calculators. Once we where doing more advanced math RPN -- with
         | the accompanying stack -- became so much easier to enter. We
         | all quickly learned it and I think most of us came to hate
         | standard calculators.
        
       | blue1 wrote:
       | Is there a good RPN calculator currently? The HP Prime is lacking
       | apparently, and the 50G is no longer available (and a bit old)
        
         | irateswami wrote:
         | A 35s and 50g got me through my engineering degree, I'm sure
         | they'll still work fine.
        
         | joeyo wrote:
         | The DM41X and DM42:
         | 
         | https://www.swissmicros.com/products
        
         | linguae wrote:
         | I don't own one, but I've heard great things about SwissMicros
         | calculators (https://www.swissmicros.com/products) from users
         | of HP calculators. The SwissMicros lineup is very similar to
         | HP's 1980s calculator lineup.
         | 
         | Also, the HP 12c financial calculator and the HP 35S scientific
         | calculator are still being sold by HP.
        
         | Noe2097 wrote:
         | The HP Prime does have an RPN mode. I bought it recently, for
         | that very feature, when my HP48 died. The keyboard of the HP
         | Prime isn't really optimized for it (some trivial operations on
         | the stack require key combinations, while on the HP48 there
         | were physical keys for them), but it's acceptable.
        
       | jerhewet wrote:
       | No mention of Forth?
       | 
       | Back in the early 80's Forth was the first language available on
       | the original Macintosh. I loved Forth, but it completely ruins
       | you for every other non-RPN language. I remember writing an ASCII
       | terminal (dial-up modem) application in Forth to learn the
       | language, and afterwards every other language that I was using at
       | the time just looked... weird.
       | 
       | I had to perform a massive mental shift to get back into all of
       | the other languages I was being paid to work with at the time,
       | and it was so difficult (for me, anway) that I never went back to
       | it.
        
       | u801e wrote:
       | I still have my HP 48g and I prefer using the dc[1] for
       | calculations on my laptop.
       | 
       | [1] https://linux.die.net/man/1/dc
        
       | agumonkey wrote:
       | I like to repeat everywhere that HP48 series had code block
       | syntax with arrow notation.                   << a -> a a + >>
       | (double function)
       | 
       | Those machines were well before their time.. I hope the makers
       | had fun, it's really sad it's gone from the market although one
       | could say that ES6 in your smartphone browser is your modern day
       | HP48 reincarnation.
        
         | mssundaram wrote:
         | My grandfather was a civil engineer and he had a number of
         | different RPN HP calculators. He gave them to me when I was
         | becoming interested in programming - a really exciting gift to
         | explore.
        
           | madengr wrote:
           | Do you still have them? Back in the 90's when HP was
           | discontinuing them, I bought 4x 32sii. I still have them un-
           | opened. I still have my dads LED one from the 70's. They are
           | collectors items now.
        
             | ghaff wrote:
             | And the LED ones had relatively short battery life; they
             | were rechargeable. When I started college, HP calculators
             | were still very expensive so I started with a TI. Within a
             | year or two, you could get an HP LED model (HP-55 in my
             | case) for a reasonable price. Through college I still took
             | a slide rule to exams as a backup in case the battery died
             | for some reason though I never had to use it. During the
             | latter part of the 70s, calculators were dropping in price
             | extremely rapidly.
        
       | bestham wrote:
       | Every time I end up on a non-rpn calculator I struggle to convert
       | the calculation I have in my head to use infix operators.
        
         | hamburglar wrote:
         | Same here. I can't really tell if it's bias because I am very
         | comfortable with RPN, but another of the benefits of RPN is
         | that it seems much easier to build up a complex computation on
         | the fly without having to backtrack and add parentheses, which
         | on most calculators means you have to start over. With an infix
         | calculator, I have to plan the whole thing out precisely before
         | I even begin entering it, whereas RPN feels like a "streaming"
         | translation that is very easy.
        
       | dev_tty01 wrote:
       | I can hardly use a non-RPN calculator. Wonderfully efficient for
       | both simple and complex calculations.
        
       | jonsen wrote:
       | _Algorithms for RPN Calculators_ by John A. Ball (1978) landed in
       | my mailbox two days ago. It's each and every detail you can
       | imagine regarding RPN. Very well and thoruogh written. A great
       | pleasure to study it:
       | 
       | https://www.amazon.com/Algorithms-RPN-calculators-John-Ball/...
        
       | bitwize wrote:
       | There's an open-source Android app called Droid48 that gives you
       | a virtual HP48, if you're into that sort of thing.
       | 
       | I know when I'm out with coworkers and they whip out Droid48 to
       | calculate the tip, I picked a good place to work.
        
         | abawany wrote:
         | For ios, I've used Free42 and i48 (Daniel Parnell).
        
           | joezydeco wrote:
           | I own an actual 42S and I prefer Free42.
        
       | ADSSDA wrote:
       | I went through all of high school and college with an HP48
       | calculator. I can't express how much more natural RPN felt than
       | the more traditional alternative (and fast!).
       | 
       | It also made for very confused expressions whenever anyone
       | borrowed my calculator...
        
       | Animats wrote:
       | I have an original HP-11C on my desk. It's about 30 years old,
       | works perfectly, and I've had to replace the batteries about once
       | a decade.
        
       | sli wrote:
       | Love my HP50G. I rode a motorcycle during college, so
       | consequentially I always had my HP50G on me wherever I went since
       | I never took it out of my backpack.
        
       | aseerdbnarng wrote:
       | I was forced to use an HP12C as part of my university degree.
       | Once you get used to RPN it's quite uncomfortable to switch back.
       | It's a much more intuitive way to do math once you get over the
       | small hurdle. 15 years later and I'm still using the same
       | calculator!
        
         | mtalantikite wrote:
         | For whatever reason my high school had HP48s for my junior year
         | math class, which got replaced the following year for TIs since
         | "that's what you'll be using in college". I much preferred the
         | RPN and ended up convincing my parents my life would be easier
         | with a new HP49g (which wasn't a lie, it was). That thing
         | helped get me through my math major and I'll always remember my
         | old school professor who taught my complex analysis course
         | amazed that it could even solve those equations (which I'm sure
         | the TIs could do as well).
        
           | Aardwolf wrote:
           | The HP48s has a much nicer keyboard than the HP49g though!
           | HP48gx may have been a suitable upgrade instead :)
        
             | pjmlp wrote:
             | I used a CASIO FX-880P during university, but my dream one
             | would be HP-48GX, unfortunately a bit too out of budget for
             | my former self.
        
             | xoa wrote:
             | With the GX (which I got, and it still works) you could run
             | metakernel [0], which itself was one heck of an upgrade
             | over the base system and really an unbelievably impressive
             | effort in its own right. It pushed the hardware so much
             | farther it's still stunning. The HP48 remains one of my
             | favorite calculation devices ever, with a great ratio of
             | utility for both the most simple brainstorming calculations
             | and going right into great depth. I'm still bummed my
             | favorite emulator for iOS devices (m48+) stopped getting
             | updates and faded away, and also that HP let its calculator
             | division languish. What a tool.
             | 
             | ----
             | 
             | 0: https://www.hpcalc.org/hp48/apps/mk/mk.php
        
         | madengr wrote:
         | Yep, had my Radio Shack calculator stolen from a college lab in
         | 1990. Replaced it with a 32sii. After 30 years of RPN, I can
         | never use a normal calculator. They are horrible.
        
         | imglorp wrote:
         | We had plug-and-chug competitions at school: big equations with
         | some inputs, ready, go. The HP RPN folks would always beat the
         | algebraic (casio, TI, etc) ones.
        
         | SavantIdiot wrote:
         | I bought an HP48 in 1990 junior year in college when it came
         | out. A calculator WAS required for engineering school, but this
         | one made everything way easier. I think it was almost $200.
         | Anyway, once you go RPN, you don't go back. It makes way more
         | sense. It finally died 5 years ago: the keys stopped working. I
         | read about how to repair the keypad but finally had to let go.
         | I had all my crib sheets from engineering school stuffed into
         | the pouch. That calculator was epic. I can't imagine trying to
         | do complex math with a slide rule, even though that's how
         | engineers had done it for ages.
        
           | lloeki wrote:
           | Similar story. Got a 48GX in high school. Everyone had TI89,
           | maybe TI-92. I was the only one with HP.
           | 
           | Even with its lowly Saturn CPU and perceptually slower, it
           | was trouncing the TIs at basically every task, especially
           | when you customised it.
           | 
           | I learned RPN and RPL alright, but also got to dive into
           | System RPL: the low level, faster, much more rich RPL, but
           | where every argument was basically unchecked as it was more
           | like HP-provided ASM routines in disguise.
           | 
           | And then learned to bit-bang stuff on the screen in assembly
           | with all the timing tricks to produce 4 grayscale instead of
           | just black/white. Great for coding small games.
           | 
           | Got the the third party CAS algebra extension card that also
           | replaced the original UI for the same thing, only faster and
           | better, and with a much more potent symbolic solver, whose UI
           | was absolutely glorious to write, select, navigate, and
           | perform advanced stuff.
           | 
           | Also got a maxed out storage expansion for the second slot.
           | Such storage was not solid state so it required a
           | continuously operating CR2032 battery to persist over time.
           | 
           | Unfortunately, as robust as it was, some time after
           | engineering school it took a hard fall too much and was
           | irreparably broken.
           | 
           | Later got my hand on a HP49G+, ARM powered but surprisingly
           | the default was to run an emulation of the Saturn CPU, and
           | CAS was bundled. You could still code for the ARM one though.
           | By that time I lost interest so it currently sits in a
           | drawer. Also preferred the 48 boxy design, especially the
           | mushy keys of the new one were way worse.
        
       ___________________________________________________________________
       (page generated 2021-03-06 23:00 UTC)