Shed Skin: Another Way To Compile Python Code

Posted by Michael Larabel on July 04, 2011

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.

Discuss this article in our forums, IRC channel, or email the author. You can also follow our content via RSS and on social networks like Facebook, Identi.ca, and Twitter (@Phoronix and @MichaelLarabel). Subscribe to Phoronix Premium to view our content without advertisements, view entire articles on a single page, and experience other benefits.
Latest Hardware Reviews
  1. Sumo Lounge Emperor
  2. Gallium3D Continues Improving OpenGL For Older Radeon GPUs
  3. 15-Way Open vs. Closed Source NVIDIA/AMD Linux GPU Comparison
  4. Nouveau vs. NVIDIA Linux Comparison Shows Shortcomings
Latest Software Articles
  1. Intel Linux OpenGL Driver Leading Over Apple OS X
  2. The Cost Of Ubuntu Disk Encryption
  3. Btrfs vs. EXT4 vs. XFS vs. F2FS On Linux 3.10
  4. AMD Radeon R600 GPU LLVM 3.3 Back-End Testing
Latest Linux News
  1. Digia Announces "Boot To Qt" Project
  2. X.Org Libraries Hit By Round Of Security Issues
  3. Wayland's Weston Gets Output Scaling Support
  4. Raspberry Pi Gets New Wayland Weston Renderer
  5. Debian GNU/Hurd 2013 Release Brings New Packages
  6. Intel Ultrabook Performance Is Faster With Mesa 9.2
  7. Hot Relocation HDD To SSD Support For Btrfs
  8. Phoronix Test Suite 4.6.0 "Utsira" Released
  9. New Intel X.Org Driver Supports All Of Haswell
  10. SQLite Now Faster With Memory Mapped I/O
  11. Microsoft Releases Skype For Linux 4.2, Has Bug-Fixes
Latest Forum Talk
  1. Microsoft Releases Skype For Linux 4.2, Has...
  2. Radeon 7770 Can't reclock crash kernel
  3. Wayland's Weston Gets Output Scaling Support
  4. Raspberry Pi Gets New Wayland Weston Renderer
  5. X.Org Libraries Hit By Round Of Security Issues
  6. Fedora 18 Comes To ARMv6, Raspberry Pi
  1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Motherboards
  5. Peripherals
  6. Processors
  7. Software
  8. Operating Systems
  9. All Articles
  1. Linux Benchmarking
  2. OpenBenchmarking.org
  3. Phoronix Test Suite