Post Reply 
advantages of RPN
05-23-2014, 08:37 PM (This post was last modified: 05-23-2014 08:47 PM by Claudio L..)
Post: #30
RE: advantages of RPN
(05-23-2014 06:44 PM)Garth Wilson Wrote:  These problems could all be avoided if I could use stacks (like Forth's return stack and data stack).

Besides your specific case, in general, scoped local variables have been in most programming languages since I was a kid.
99.9% of the compilers use a stack to store your local variables (ok, they use microprocessor registers when they are available, then fall back to the stack when they run out). That's how they avoid 'all these problems', so the 'problems' aren't really there for the user, they are solved by the compiler/interpreter at a lower layer.

So the stack is always there, you like it or not, and it takes about the same amount of RAM and processing power whether you are the one driving it or a compiler/interpreter. It really goes to what the user wants/needs:

Direct access to the stack? or use readable names and let a compiler/interpreter handle the stack for you?

A lot of people prefer engines with carburators because they can understand how it works, they love to open the hood, take it apart and fiddle with it all they want. Some other people prefer modern injection engines, where you have to plug a laptop to fiddle with it and you never actually get dirty, and there's others that don't even know that there's an engine in the car and don't really care as long as the car moves.

For calculations it's exactly the same: There's people that want to see and control every step of their analysis. There's people that want their analysis done for them but like to see automatic step-by-step solutions, and then there's people that just want the final answer and don't care how you get there.

There's a place for everything, for high level languages with variables, for lower level languages with stacks, and even for senseless flame wars of RPN vs algebraic.

Claudio

PS: I wrote a firmware for a PIC16F for my Masters thesis. A pain to code in assembler but lots of fun. In that microcontroller, you'll have a hard time guaranteed, RPN or algebraic. For those interested:
http://www.microchip.com/wwwproducts/Dev...=PIC16F876
And yes, it is BYTES of ram, there's no K, no M, no G before bytes.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
advantages of RPN - Don Shepherd - 05-21-2014, 09:34 PM
RE: advantages of RPN - Tugdual - 05-21-2014, 10:20 PM
RE: advantages of RPN - Garth Wilson - 05-22-2014, 01:25 AM
RE: advantages of RPN - Les Bell - 05-22-2014, 05:38 AM
RE: advantages of RPN - Nigel (UK) - 05-22-2014, 09:44 AM
RE: advantages of RPN - Garth Wilson - 05-23-2014, 02:30 AM
RE: advantages of RPN - Mike Morrow - 05-22-2014, 03:24 AM
RE: advantages of RPN - Jim Horn - 05-21-2014, 11:46 PM
RE: advantages of RPN - Dale Reed - 05-22-2014, 12:09 AM
RE: advantages of RPN - Didier Lachieze - 05-22-2014, 12:25 AM
RE: advantages of RPN - Dale Reed - 05-22-2014, 01:37 AM
RE: advantages of RPN - Thomas Klemm - 05-22-2014, 01:55 AM
RE: advantages of RPN - rprosperi - 05-22-2014, 02:50 AM
RE: advantages of RPN - Jake Schwartz - 05-26-2014, 09:32 PM
RE: advantages of RPN - Don Shepherd - 05-26-2014, 11:30 PM
RE: advantages of RPN - Manolo Sobrino - 05-22-2014, 12:39 AM
RE: advantages of RPN - Don Shepherd - 05-22-2014, 01:15 AM
RE: advantages of RPN - Alvaro - 05-22-2014, 03:08 PM
RE: advantages of RPN - Don Shepherd - 05-22-2014, 04:42 PM
RE: advantages of RPN - Les Bell - 05-22-2014, 10:58 PM
RE: advantages of RPN - Thomas Radtke - 05-23-2014, 04:48 AM
RE: advantages of RPN - Matt Agajanian - 05-23-2014, 05:08 AM
RE: advantages of RPN - Don Shepherd - 05-23-2014, 08:49 AM
RE: advantages of RPN - Matt Agajanian - 05-23-2014, 04:18 PM
RE: advantages of RPN - Matt Agajanian - 05-23-2014, 04:35 PM
RE: advantages of RPN - Alvaro - 05-23-2014, 05:00 PM
RE: advantages of RPN - Thomas Klemm - 05-23-2014, 05:17 PM
RE: advantages of RPN - Alvaro - 05-23-2014, 05:34 PM
RE: advantages of RPN - Thomas Klemm - 05-23-2014, 06:16 PM
RE: advantages of RPN - rprosperi - 05-23-2014, 06:04 PM
RE: advantages of RPN - Garth Wilson - 05-23-2014, 06:44 PM
RE: advantages of RPN - Claudio L. - 05-23-2014 08:37 PM
RE: advantages of RPN - Alvaro - 05-24-2014, 08:47 AM
RE: advantages of RPN - Paul Dale - 05-24-2014, 09:22 AM
RE: advantages of RPN - Garth Wilson - 05-24-2014, 10:09 AM
RE: advantages of RPN - Alvaro - 05-24-2014, 10:36 AM
RE: advantages of RPN - Les Bell - 05-25-2014, 02:00 AM
RE: advantages of RPN - Garth Wilson - 05-25-2014, 03:18 AM
RE: advantages of RPN - Joe Horn - 05-25-2014, 06:34 AM
RE: advantages of RPN - Garth Wilson - 05-26-2014, 08:34 AM



User(s) browsing this thread: 3 Guest(s)