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
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded