{"id":109,"date":"2005-10-24T23:48:30","date_gmt":"2005-10-24T13:48:30","guid":{"rendered":"http:\/\/www.somethinkodd.com\/oddthinking\/?p=109"},"modified":"2005-10-24T23:49:29","modified_gmt":"2005-10-24T13:49:29","slug":"whatever-happened-to-rpn","status":"publish","type":"post","link":"https:\/\/www.somethinkodd.com\/oddthinking\/2005\/10\/24\/whatever-happened-to-rpn\/","title":{"rendered":"Whatever happened to RPN?"},"content":{"rendered":"<p><!-- UnMarkedDown_2_01132526441--><\/p>\n<h3>Introduction to RPN<\/h3>\n<p>Many computer scientists, and some old-timer engineers, will be familiar with postfix notation &#8211; perhaps better known as <a href=\"http:\/\/en.wikipedia.org\/wiki\/Rpn\" title=\"Wikipedia definition of Rpn\" class=\"wikipedia\">RPN<\/a>  (Reverse Polish Notation).<\/p>\n<p>It is an obscure way of writing down arithmetic. We traditionally use infix notation, e.g. <code>(1 + 2) * 3<\/code>. The same arithmetic in postfix notation  would be written as <code>1 2 + 3 *<\/code>.<\/p>\n<p>From an elegance perspective, postfix notation rocks! No ambiguity means no brackets! <\/p>\n<p>From an software implementation perspective, postfix is simple! All the operands store in one stack. Easy!<\/p>\n<p>So we saw RPN being implemented in:<\/p>\n<ul>\n<li>early calculators (especially those from Hewlett-Packard), <\/li>\n<li><a href=\"http:\/\/en.wikipedia.org\/wiki\/Dc_%28Unix%29\" title=\"Wikipedia definition of Dc_%28Unix%29\" class=\"wikipedia\">dc<\/a> (a very early Unix desktop calculator program), and <\/li>\n<li>early programming languages, including Postscript (1976) and Forth (1977 and earlier). <\/li>\n<\/ul>\n<p>I am going to claim Lisp (1958) here too. It actually uses prefix notation (or Polish Notation), but that&#8217;s close enough to help my point.<\/p>\n<h3>Whatever happened to RPN?<\/h3>\n<p>RPN is not nearly as popular now as it was back in the 70s. Why? Because it wasn&#8217;t <em>human<\/em>. <\/p>\n<p>Due to whatever historical quirk, we are taught at primary school to do maths the infix way. As computers and calculators became just slightly more powerful, it became clear that the computer should adapt to the quirks of humans, rather than trying to get all the humans to adapt to the quirks of computers.<\/p>\n<p>Modern programming languages, modern calculators and modern software allow you to enter your arithmetic in infix notation with all of its clumsy brackets, and the world is a better place because of it.<\/p>\n<p><em>(Why am I going on about RPN? Bear with me. I&#8217;m building up a framework for an argument. I&#8217;ll come back to this later on.)<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whatever happened to Reverse Polish Notation (RPN)?  Progress! That&#8217;s what!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"","footnotes":""},"categories":[23,34],"tags":[],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-based-on-a-true-story","category-software-development"],"_links":{"self":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":0,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}