Greg Hewgill (ghewgill) wrote,
Greg Hewgill

psil compiler

My Psil-to-Python compiler (which I can't resist but call "psilc") can compile a lot of nontrivial code now. The performance improvement over the interpreter is about a hundred times faster, which is great for working on Project Euler stuff. I've still got some bugs and things that need work, mostly to do with the funny Python scoping rules (Python 3.x gets a nonlocal keyword to express some things you can't in 2.x), tail recursion, and a minor thing with the annoying Python print statement (print will be an actual function in Python 3.x, so that problem will go away).

I've pushed up all the latest code to the psil repository on Github. It's pretty rough right now, and tries to run the compiler by default. The Compile = True switch near the top currently controls whether it runs the compiler or the interpreter.
Tags: psil

  • answer to geopoliconomic question

    The answer to this week's geopoliconomic question is that, at some time during the past century, the yellow countries have had coins struck at the…

  • geopoliconomic hint

    I almost forgot to post the hint for this week's geopoliconomic question! The hint is that the answer relates to an upcoming change in New Zealand…

  • geopoliconomic question

    The countries in this map are coloured grey or yellow, according to a particular distinguishing property about those countries. What is the property?…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded