Ted Leung on the air
Ted Leung on the air: Open Source, Java, Python, and ...
Ted Leung on the air: Open Source, Java, Python, and ...
Tue, 27 Sep 2005
ShedSkin
[23:26] |
[computers/programming/python] |
# |
TB |
F |
G |
3 Comments |
Thanks to Luis Gonzalez for pointing me to Mark Dofour's ShedSkin project. ShedSkin is a Python to C++ compiler based on Mark's master's thesis work, and was one of the Python Software Foundation's Google Summer of Code projects. It looks like ShedSkin can compile a subset of Python, and runs on Windows, Linux, and OS X. Unfortunately, there are no published benchmarks, so it's hard to get an idea of how much of an improvement ShedSkin actually produces. Mark is looking for additional help, so you should definitely drop by his blog if you are interested.
Describing ShedSkin as a Python to C++ compiler is a bit of a misnomer, as it supports so very little of Python's language semantics, and virtually none of its library. The code it generates doesn't interoperate with any existing Python implementation, and I don't believe you can call C++ libraries from it either.
The most generous way to describe it would be that it provides you with a Python-like syntax and type inference for C++. (And in fact, the author describes it as letting you write Python "in a relatively static C++-style, in essence enabling users to specify C++ programs at a higher level.".)
I'm pointing this out, not to be critical of the project, but to remind people not to get their hopes up: it's a research compiler, not a development tool, so any performance improvement it has over standard Python is moot. Until you've actually implemented something resembling Python, the performance improvement is just a theory.
PyPy, on the other hand, has implemented a much bigger chunk of Python's semantics. It would be interesting to see if they could use ShedSkin as an RPython compiler. (RPython is a statically type-inferable subset of Python used by PyPy to implement the core interpreter, and ShedSkin's subset of Python seems rather similar to it.)
Posted by Phillip J. Eby at Wed Sep 28 07:09:25 2005
The most generous way to describe it would be that it provides you with a Python-like syntax and type inference for C++. (And in fact, the author describes it as letting you write Python "in a relatively static C++-style, in essence enabling users to specify C++ programs at a higher level.".)
I'm pointing this out, not to be critical of the project, but to remind people not to get their hopes up: it's a research compiler, not a development tool, so any performance improvement it has over standard Python is moot. Until you've actually implemented something resembling Python, the performance improvement is just a theory.
PyPy, on the other hand, has implemented a much bigger chunk of Python's semantics. It would be interesting to see if they could use ShedSkin as an RPython compiler. (RPython is a statically type-inferable subset of Python used by PyPy to implement the core interpreter, and ShedSkin's subset of Python seems rather similar to it.)
Posted by Phillip J. Eby at Wed Sep 28 07:09:25 2005
The above comments by Phillip Eby are mostly correct.
However, Shed Skin doesn't require a "python-like" syntax as he said. With Shed Skin, you use plain and regular python. The only distintion is that the programmer has to restrict his coding style, avoiding dynamic features such as eval or exec, for example.
Note that Shed Skin has been released recently (current version is 0.0.4), and a lot of work remains to be done.
It will be able to import modules, as long as these modules are written with the mentioned restricted style. So it will take some colaboration from interested developers to support more and more features.
At its curent state, it is very useful for writing algoritmic code or simple programs (that don't require the use of libraries) that need to be executed at very high speed.
Posted by Luis Gonzalez at Wed Sep 28 09:00:01 2005
However, Shed Skin doesn't require a "python-like" syntax as he said. With Shed Skin, you use plain and regular python. The only distintion is that the programmer has to restrict his coding style, avoiding dynamic features such as eval or exec, for example.
Note that Shed Skin has been released recently (current version is 0.0.4), and a lot of work remains to be done.
It will be able to import modules, as long as these modules are written with the mentioned restricted style. So it will take some colaboration from interested developers to support more and more features.
At its curent state, it is very useful for writing algoritmic code or simple programs (that don't require the use of libraries) that need to be executed at very high speed.
Posted by Luis Gonzalez at Wed Sep 28 09:00:01 2005
By the way...
It's worth mentioning that Shed Skin produces stand alone executables, completely independent from any interpreter or vistual machine.
Posted by Luis Gonzalez at Wed Sep 28 09:04:35 2005
It's worth mentioning that Shed Skin produces stand alone executables, completely independent from any interpreter or vistual machine.
Posted by Luis Gonzalez at Wed Sep 28 09:04:35 2005
You can subscribe to an RSS feed of the comments for this blog:
Add a comment here:
You can use some HTML tags in the comment text:
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
<a href>
, <em>
, <i>
, <b>
, <blockquote>
, <br/>
, <p>
, <code>
, <pre>
, <cite>
, <sub>
and <sup>
.You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk