Tarek Ziadé wrote:
On Thu, Nov 12, 2009 at 12:03 AM, David Cournapeau <cournape@gmail.com> wrote:
You cannot obtain this with classes and objects (especially when you start talking about performance: thousand of source files for one extension is not a crazy usercase).
Sorry, I am getting confused here. This is getting all mixed up. What OOP has to do with performance in the first place ?
As far as I can tell David seems to be saying that instantiating a class for every file in the system would be too much overhead. I'm not convinced about that -- make builds a dependency graph with a node for every target before it goes to work, and I think scons does something similar (although I might be wrong, I haven't looked at scons very closely yet).
$CC $CFLAGS $CPPDEFINES $CPPPATH -c $SOURCE $TARGET
You need to be able to control those variable content in a very fine grained manner: prepending and appending may lead to different compiler behavior
It's true that the current distutils compiler classes are lacking in flexibility here -- there's an option for "extra flags", for example, but it sticks them all at the end of the command. Sometimes that's wrong -- I've had trouble trying to use it for MacOSX -F arguments, for example. But that's not to say that a class couldn't be devised that allowed the required flexibility without degenerating into just a string with textual substitutions. -- Greg