Friday, December 08, 2006

Shed Skin 0.0.15

After being distracted by my work for a few months, I'm finally back to Shed Skin development. It's interesting how the same boring programming work is more fun when you don't get paid for it! Anyway, I hope to work on Shed Skin full-time for at least the next three months, which should lead to several interesting improvements. I'm not sure exactly which those will be yet, as I never really plan ahead much.

For starters, I updated Shed Skin to work with the newly released Python version 2.5. As part of this, I added support for the new 'any' and 'all' keywords and for conditional expressions. The new Shed Skin release (0.0.15) also comes with support for several, previously unsupported library functions. IIRC, these are:

os.path.{split, splitext, islink, isdir, isfile, exists}
os.{stat, lstat, rename, chdir}
stat.*
fnmatch.{fnmatch, fnmatchcase}
random.{seed, sample}

Because quite some library modules are now (partially) supported, I moved all of them to a separate 'lib' directory. Because the ugly '_' in filenames is not needed anymore, this makes it much easier to add to the set of libraries supported by Shed Skin (hint, hint!) If you are interested in doing so, please have a look at the updated README file.

The os.path.* and stat.* support was added by running Shed Skin over (slightly modified) pure Python implementations, taken from the PyPy project. I am getting more and more optimistic about this approach, improving the amount of supported library functions, helping me to locate bugs and motivating me to fix them all at the same time. The next module I may look into is the 're' module, which should help me locate a few more bugs, and help me to add support for other modules that make use of it. Please let me know if you're interested in helping out increasing the number of supported libraries, as there's probably lots of low-hanging fruit.

Most of the newly supported functionality was added in anticipation of compiling an interesting program I found. After messing around with Amarok, Gtkpod, Gnu-pod and what not, I finally found a program to reprogram the database on Apple's latest iPod shuffle (the 15.5 gram 1 GB one :D) that actually worked. Needless to say, it was written in Python.. :-) One interesting application is to put it on the shuffle itself, so you can run it from any computer. The downside is the dependency on CPython. Looking through the code, at about 600 lines, it looked like a potential victim for Shed Skin. The author agreed, and hopefully Shed Skin generated code will be on many iPod's in the near future :-) Here's the link to the program:

http://shuffle-db.sourceforge.net/

4 comments:

ajaksu said...

Great news... if all goes well, I'll have try my luck with some low hanging fruits by mid-January :)

On a kinda unrelated note, would producing libraries (e.g. for using with ctypes) be easy given the current scheme?

srepmub said...

hi ajaksu,

let me know if you'd like to give this a try, and I'd be happy to help out/fix problems.

what kind of library would you like to create, exactly? let's please discuss this further over mail ^^


mark.

Unknown said...

Hi Mark,

congrats for shedskin! It has com a long way since I first played with it.

I have a simple question(wish):
Can shedskin generate an extension module, i.e. something I can Import from a python script? That would definetly help me adopting it for my own projects...

Thanks for Shedskin!

srepmub said...

hello flavio,

this is not yet possible. I'm waiting for someone else to step in and look at such integration issues, as I'm still too busy with the compiler core (and integration is not my thing). actually, I'm talking to someone right now that might be interested in using boost::python for this. so stay tuned ^^

thanks,
mark.