Python to RPN converter
|
06-23-2018, 10:33 PM
Post: #33
|
|||
|
|||
RE: Python to RPN converter
Some time ago I wrote this Python to FOCAL Compiler.
This Python program calculates the greatest common divisor of two integers a and b: Code: def gcd(a, b): It gets translated to: Code: LBL "GCD" The generated code by your website is similar but a bit longer: Code: LBL "gcd" My program relies on the generated byte-code that has some resemblance to FOCAL since Python uses a stack-machine to interpret it. So it was never more than a quick and dirty hacked together proof of concept. Nothing compared to your listed capabilities. Still I was pleased with the result. It appears that both implementations don't support recursion as in this case: Code: def gcd(a, b): Just out of curiosity: Does your program rely on the Python compiler as well or did you write one on your own? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)