Πέμπτη 14 Αυγούστου 2008

Cross platform?

Ok, I know I have some days to write into this blog and I am going to ressurect it a little big.
This summer I finally started to get my hands dirty with python (since it's a so nice language). I tried to do some stuff with sockets, threads, gtk and wx since I had in mind the cross platform nature of python.

What I have as a result in my mind is that, I don't find it so "cross-platform" (at least not as much as java is - which I haven't got my hands dirty on, yet - ) . I mean, surely what I write, runs on both linux and windows (haven't tried it on my G5 mac tho, I should try) but with what cost? While it seems to run flawlessly on linux with gtk, threads and all, I had to remove thread support on windows in order to make it work (I didn't need threads anyway in the first place, just for educational purposes ) which has something to do with gtk I guess (wx didn't complain). Oh that and the nearly 50% CPU usage of pythonw.exe (you don't want a background app to take that much, do you?) and/or the executable I made with py2exe.

Also another story is py2exe. I tried to make a distributable package for python-unaware systems. It took me some time because of missing modules and stuff, made an, about 16mb dist package (about 7mb compressed) so I was happy to give it to two friends to test it.

First hit under the belt. While I had corrected the box-letters on my system (runned pango-querymodules.exe on a file under my dist directory) my buddies had the same problem, so I sent the pango and freetype dlls which it seems it worked to one of the systems (the other still had the box-letters )

Second hit under the belt. The app is supposed to be a cute and minimalistic IM client, lighter than the heavyweight Live Messenger (educational purposes only, I may release it under gpl
if its fully working tho). In a way, it succeeds, but only on linux. On windows, it made my friend's computer...fry (mine too). 50% CPU usage for a small and light app is not ok (tho I seem to have made something wrong. Emesene is on python and It runs with almost no CPU usage, on Windows)

To not get misunderstood. I love python, it just provides everything I would need so I would design and go (also scipy is awesome), but I think the current CPython is not really what I would turn to if I wanted cross platform support (web applications is another story where I want to see how it works)

But I see light on the horizon. It shines, it's pretty, and it is Java. It's jython and I think I will fell in love with it.

But anyway, next stop: undestanding how to write efficient windows apps in python, and also having a look at PARLEY