Shed Skin: Another Way To Compile Python Code
Last week on Phoronix I wrote about Gccpy, which is an effort as part of Google's Summer of Code to develop a Python front-end to GCC that would allow compiling Python into native system binaries using the GNU Compiler Collection. This was of interest to many readers and the developer behind Gccpy, had commented in more detail in the forums. Following that news article I received an email regarding another Python compiler effort.
Mark Dufour wrote in to say that for the last eight years he's been working on a similar effort to compile Python code. Mark developed Shed Skin, which is an experimental Python-to-C++ compiler.
Shed Skin is capable of translating pure statically-typed Python (versions 2.4 through 2.7) code into optimized C++. Shed Skin can generate stand-alone programs or Python extension modules to be used by other Python programs, it's a bit similar to Facebook's HipHop for translating PHP code into highly optimized C++ code. Not only does the Python code need to be statically typed, but it isn't able to take advantage of the Python standard library nor other features like nested functions. Regardless, in tests conducted by the author, Shed Skin was found to be between two and 200 times faster than CPython. Some of the Shed Skin benchmarks are available via GitHub.
Like Gccpy, Shed Skin was also originally sponsored by Google with their GSoC project in their first year.
For those interested in Shed Skin for translating Python code to C++ that can then be compiled, visit the Google Code page. Shed Skin 0.8 was also released last month.
Latest Articles & Reviews
Latest Linux News
Most Viewed News This Week