Wednesday, March 31, 2010

Shed Skin 0.4

I have just released Shed Skin 0.4, an experimental (restricted-)Python-to-C++ compiler. Thanks again especially to Jeremie Roquet for helping out.

The biggest 'improvement' of this release is perhaps that Windows is no longer supported. Windows users are encouraged to take over maintainership of the MinGW version, or to upgrade to a 'real' operating system, such as Ubuntu, and live in software freedom.

Other improvements include support for generator expressions, real boolean support (instead of integers that print as 0 and 1), support for the 'key' argument of 'min' and 'max', another useful type inference scalability improvement, and support for heapq.{merge, nsmallest, nlargest}. Please see the release notes for the full list of changes.

Four new example programs were also added, for a total of 47 programs:

-pylife, a game of life implementation based on the wonderful hashlife algorithm (David Bau)
-a nice a-star implementation, with a pygame frontend (John Eriksson)
-a simple game of life implementation that gave the type analysis some trouble (Francesco Frassinelli)
-a second genetic algorithm (Stavros Korokithakis)

Please go ahead and try it out, and let me know about any problems. I'm also always very happy to receive new example/test programs to play with, especially if type inference fails (or doesn't terminate) for them!

23 comments:

Admin said...

Hummm... You want us to switch away from Windows, for the sake of freedom, but you support OSX?

Of course I understand your point, and switching from Windows to Ubuntu, as you suggest, would be a positive step. However, most people that switch from Windows will go to OSX, and this is a huge step away from freedom and openness.

Mike Lowe said...

< cough > BSD underpinnings < / cough >

Admin said...

Regarding BSD, I don't feel that taking from open-source is really that admirable on its own.

I don't admire Google simply for the fact that they use Linux to their advantage, but for all the stuff they have contributed back and their other measures to encourage openness and competition in the industry.

Apple gives back little beyond what they have to.

srepmub said...

the goal is not to promote freedom. it's to save me time and annoyance from testing under windows every release. OSX at least is UNIX based, so it's much easier to support. (not that I've actually tested 0.4 under OSX.. but I'm not hearing about any problems either).

[removed comment about OSX vs windows]

rotoglup said...

Just out of curiosity, is your drop of Windows only for you to limit your testing efforts ? What are the main limiting problems you encountered by supporting a Windows version ?

srepmub said...

there are no real limiting factors I guess.. I just don't feel like putting time into it anymore. only about 1/3 of the downloads is for windows, which is just not enough for me to put time into it anymore, given my dislike of the platform.

in any case, I think anyone would agree that my time is much better spent improving shedskin itself than on packaging it..

but I may have some good news: someone has already offered to take over maintainership. I should probably have 'dropped' windows support a long time ago.. :-)

NeedHelpForShedSkin said...

Hi srepmub, shedskin sounds interesting. I am confused on how to use it though.

I cant find what im looking for in the tutorial since it probably assumes the reader already knows it.

I downloaded the tgz and extraced the contents. Inside it i find the folders 'scripts','shedskin' and the files 'LICENSE','README.html','setup.py','test.py'. This is where im lost. I dont know what to do. Thanks for your time.

srepmub said...

thanks for asking. I think you want to have a look at the 'installation' section of the tutorial, subsection 'GNU/linux'.

NeedHelpForShedSkin said...

Since i used windows i went ahead and downloaded shedskin .3 instead.

I know raw_input() is supported, but is there a way of getting input() to work? raw_input() works for strings and input() works for integers.

Thank you srepmub.

srepmub said...

nope, sorry, 'input' is too dynamic for shedskin (the result can be of any type). you will have to use raw_input, for example in combination with int().

NeedHelpForShedSkin said...

It worked. Thanks. I was curious, what is the real difference between input() and raw_input() ?

srepmub said...

the type of the result of 'input' is unknown at compile-time, so we cannot efficiently compile it. the result of 'raw_input' on the other hand is always a string.

NeedHelpForShedSkin said...

That makes sense. Hey if you dont mind, may i have your email srepmub?

srepmub said...

sure, it's in the README of the examples package. but please consider mailing to the discussion group first (see the link on the right of the homepage).

Joseph Coffey said...

Do you think its possible someday for shedskin code to call out to python code? If say we explictly type the return/argumnets?

I ask because we have a pretty large python code base, and I think that it would be easier to progressively use more shedskin if this were possible.

srepmub said...

perhaps, but I have to say I'm not very interested in adding any kind of manual type hints.. I actually started shedskin to avoid these.. :-)

wouldn't it be possible to gradually move more into extension modules, using 'shedskin -e'..? or perhaps a project like cython would just better suit your needs..?

Konstantin Tokarev said...

Didn't you try to compile HPLIP?

srepmub said...

no?

VGA said...

1/3 of the downloads isn't enough for you ?

Windows is the leading platform, objectively ...

srepmub said...

please read the other comments for clarification.

Chris said...

I am a Linux guy, but I have to write software that will run on Windows because of customers and the such at work. I try to get people to switch to Linux as best I can, but I cannot change entire infrastructures. I need to invest my time in OS efforts that will allow me to write software that I can easily port to Windows and Mac platforms.

srepmub said...

feel free to package shed skin 0.5 for windows. it should only take a few hours, if you know what you are doing..

Cegonsoft said...

I need Complete training in python..Are you providing the Complete training for python?
Cegonsoft