An experimental (restricted-Python)-to-C++ compiler¶
Shed Skin is an experimental compiler, that can translate pure, but implicitly statically typed Python (2.4-2.6) programs into optimized C++. It can generate stand-alone programs or extension modules that can be imported and used in larger Python programs.
Besides the typing restriction, programs cannot freely use the Python standard library (although about 25 common modules, such as
re, are currently supported). Also, not all Python features, such as nested functions and variable numbers of arguments, are supported.
For a set of a 75 non-trivial programs (at over 25,000 lines in total (sloccount)), measurements show a typical speedup of 2-200 times over CPython.
- Shed Skin documentation
- Typing restrictions
- Python subset restrictions
- Library limitations
- Compiling a standalone program
- Generating an extension module
- Distributing binaries
- Calling C/C++ code
- Command-line options
- Performance tips and tricks
- How to help out in development
Frequently occurring discussions¶
- Frequently occurring discussions
- My god, why?
- But I heard we can’t! Type inference doesn’t scale! it’s exponential…
- But still, a JIT compiler is easier to use, and just as fast.
- No sir, I don’t like it. Restricted python is not python!
- If you want to have ultimate performance, use manual C
- But wait, those JIT compilers will be faster than manual assembly language!
- Integration is not straightforward
- My program doesn’t become faster after compilation
- shedskin doesn’t terminate for my program
- What about parallellization?
- What about MSVC?