It had been moths since I had tried Shed skin for the last time. It hadn't impressed me the last time due to its limitations to the python code supported.
I was prompted to try it again after the december release due to large list of improvements announced.
So I decided to apply a couple of routines for calculateing primes that I ofen use to test the performance of python against Compiled languages like C, FORTRAN, etc.
I was very suprised with the simplicity of the whole process:
$ ss primes
$ make run
That was all it took for a 30 times faster C++ version!! Compare that to Pyrex, weave, swig et al.
The only modification I had to make to my script was removing the
if __name__=='__main__':
from the end of the script.
Great tool!
4 comments:
hello flavio,
thanks for trying out shedskin again :-) it works pretty well these days for not-too large programs. there is a lot more work to be done, though:
-the generated code can be optimized a lot more (e.g. avoid heap allocation, eliminate wrap around checks..). I'm hoping other people would like to help out here, as the rest of the compiler is enough work as it is :-)
-it's also still not easy to create extension modules or to use 'arbitrary' modules such as pygame. both will probably be possible soon, although using arbitrary modules will always require some manual work (each module has to be 'type modeled' once).
oh I missed your post at my blog, http://shed-skin.blogspot.com. I will reply to that shortly.
thanks!
mark.
PS I just released 0.0.16, but without any big changes.
btw, thanks for reminding me of the '__name__' attribute. I added support for it to shedskin cvs; it should work starting with 0.0.17.
mark.
Thanks Mark,
the if __name__=="__main__":
is a widely used feature of python and will be a very welcome feature of SS
0.0.17 is out, so there you go :)
mark.
Post a Comment