Widgets Moving Along

This week I continued my work on the widgets work.  I checked in code to the widgets branch to handle basic startup/shutdown and open a window.  It’s very simple, but it’s pretty cool to see that window pop up and miroguide.com show up.

At the begining of the week I implemented it in portable and on OS X.  The GTK/X11 implementation was about 2 hours or so.  The windows implementation on the other hand is going to be a real pain and requires basically trashing setup.py and rewriting it from the bottom up.

That brings me to one thing I want to talk about on the call.  If I’m going to be basically starting over with our setup script, I’d like to talk about using mingw as our main C compiler.  I’ve been thinking about how much of a pain it was to add support for the vista function calls and how it would have been a ton easier if we were using mingw. I’m pretty sure mingw has supported the calls for quite a while, and if it hadn’t it’s so much easier to upgrade it’s win32api package than it is to install a new microsoft SDK.  It’s been especially on my mind because I tried to install visual c++ 2008 express and it completely ruined my build environment.  I’d love so much to get rid of microsoft tools and just use free ones.

The main reason that we’re not using it is that the python docs say you should use the visual c++ 2003 to build python extensions.  I’ve done a ton of reading about it and it seems like the reason is complications from using a different C runtime DLL.  Python uses msvcr71.dll, but things compiled from mingw use msvcrt.dll.  Using different C runtimes can cause problems in a couple of ways.  The main one is trying to share data (for example a FILE pointer) from one runtime to another will cause very bad things to happen.  Then there’s more subtle errors, for example atexit() callbacks will only fire from one runtime.  However, all of the errors don’t seem to happen in practice so often. It seems like the main reason that people try not to mix compilers for peace of mind.  But the gtk DLLs are linked to msvcrt.dll, so it seems like we can’t get total peace of mind in any case.

Anyways, I’m not really sure of the ramifications, I’d love to talk on the call about what people think about this.

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment