- Shed Skin
Infobox Software
name = Shed Skin
class = stub
caption =
developer =
latest_release_version =
latest_release_date =
operating_system =Cross-platform
genre = Python compiler
license = GNU General Public License (GPL)
website = http://code.google.com/p/shedskin/Shed Skin is an experimental
compiler that translates pure but implicitly statically typed Python programs into optimizedC++ . Programs often must be modified to satisfy the typing restriction, but remain valid Python after modification. Shed Skin is currently limited to small programs, that do not make heavy use of the Python standard library. The largest program translated to date is 1,600 lines.Variables can only ever have a single type. So e.g.a=1; a='1'
is not allowed. A single type, however, can be abstract or generic (as in C++), so that e.g.a=A(); a=B()
is allowed where A and B have a common base class.In a set of test cases developed by ShedSkin's author, code generated by Shed Skin ran 2-40 times faster than did the same code optimized using
Psyco 'spsyco.full()
method. However, ShedSkin can also be significantly slower thanCPython for some programs compilable by ShedSkin (e.g. ones relying on the well-optimized behavior of CPython "set" and "str" types). [cite web|author=Flávio Codeço Coelho| url=http://pyinsci.blogspot.com/2007/08/set-implementation-performance.html| title=Set implementation performance | date=Monday, 6 August 2007] .Code generated by Shed Skin is completely independent of a Python run-time, which allows use of that code on hardware-constrained embedded systems. Shed Skin can be used for code
obfuscation : it is much more difficult to reverse-engineer machine language generated by a C++ compiler) than Pythonbytecode .To deduce type information in order to generate C++ type declarations, such as
int
, Shed Skin uses type inference techniques. It combines Ole Agesen's Cartesian Product Algorithm with John Plevyak's Iterative Class Splitting technique. These techniques may limit scaling of program size significantly further than in existing test cases.Shed Skin consists of 6,500 lines of code, excluding the C++ implementation of the Python builtins. It supports only a subset of the features of Python. Shed Skin is similar to projects such as Pyrex, Boo, and
RPython .Limitations
* Programs cannot freely use the Python standard library, but several common imports are supported (see lib/*.py).
* The type analysis currently does not scale well beyond a few hundreds of lines of code.
* As of version 0.0.22, it is possible to generate simple extension modules, but custom classes are not supported and arguments/return values are copied recursively.ee also
*
PyPy
*Psyco
*RPython References
External links
* [http://sourceforge.net/projects/shedskin/ http://sourceforge.net/projects/shedskin/]
* [http://code.google.com/p/shedskin/ http://code.google.com/p/shedskin/]
Wikimedia Foundation. 2010.