Computer Language Shootout

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Wed Nov 30 16:24:16 CET 2005


malv:

>Hi bearophileH,

bearophile is enough :-)


>Could you post some more information about ShedSkink?

ShedSkin (SS) is a Python -> C++ compiler (or translator) written in
Python, created by Mark Dufour. Its development was initially
"financed" by the summer of code by Google. It contains some smart
algorithms that allow it to infer the type of most variables, and to
compile everything statically (but with a garbage collector). This
produces a very fast executable, usually like a C++ one. SS has some
limits, some of them are temporary, and some of them are here to stay
(it cannot be used on really dynamic stuff). It's not intended to
compile every Python program, but mostly for "algorithmic" code that
has to go fast, often the same code Psyco is used for. It can be seen
as complementary to Psyco, and not really like something to substitute
it, Psyco is a very good software. I am helping Mark as I can, in
different ways, because I think SS is a very interesting software. At
the moment SS is in the Alpha stage still, this means:
- It has a lot of bugs still, but Mark fixes some of them almost every
week. That problem in that fannkuch code is relative to the version
0.0.5, a successive version may compile it correctly.
- Some common things aren't possible yet, like inheritance, but Mark is
probably going to implement this in the following days.
- The code produced is C++, and it calls functions of the SS library.
CPython source code contains some very fast routines (by Raymond
Hettinger and other people), so sometimes CPython is faster (example:
sometimes Python dicts are faster). This is mostly a
"tuning/implementation" problem, it's not a limit of SS or the C++ and
its compiler. It's a matter of knowing lot of complex C++ "tricks" and
implementing/copying faster routines. Another developer can probably
help Mark improve most of those algorithms (I think that sometimes the
CPython source code itself may be adapted and used).
- If another developer helps Mark, a future version of SS can probably
be used to automatically produce compiled modules that can be imported
into normal Python programs (it may call something like SIP/SWIG by
itself), a very simple single-click command can be used (on Windows in
a contex menu). The info about the input types of the functions/methods
may be expressed with some very simple syntax inside the module
docstring, or simply it may be contained in the part of the module that
isn't executed when then module is called.
- There are lot of ways to improve SS still, some people in the Blender
group have already shown interest in SS, but it contains too much bugs
still to be used in serious projects. Helping hands can speed up its
development a lot.

The project on Sourceforge, it contains more information and
documentation:
http://sourceforge.net/projects/shedskin/

SS blog:
http://shed-skin.blogspot.com/

The last version is 0.0.5.1, it contains an important memory bugfix and
other minor bugfixings.

Some timings for version 0.0.5:
http://sourceforge.net/mailarchive/forum.php?thread_id=9040577&forum_id=46397
(small_dict_fp test is probably faster in version 0.0.5.1).

Bear hugs,
bearophile




More information about the Python-list mailing list