On Jun 19, 2008, at 11:38 AM, Gael Varoquaux wrote: > On Thu, Jun 19, 2008 at 07:10:17PM +0200, Stefan Behnel wrote: >>> It would be great if the compile could be done at import time. For >>> instance the first run of cython for primes.pyx could create a >>> prime.py >>> containing the logics to do the compilation to _primes.so, and >>> end by >>> cleaning up the namespace and importing everything from _primes.so. > >> While I like the idea (it reminds me of tools like pyinline), I >> don't think >> it's a very important use case. You'd end up compiling the module >> on each >> (first) import as the runtime environment likely lacks write >> permission to the >> Python package directory. So why not do it once during installation? > > I am targeting scientific users who spend most of their time > developing > the algorithm, and not deploying it. And the issues you raised are > easy > to solve using a disk cache in the user's directory, and checksum > to see > if recompilation is necessary. scipy.weave.inline works like this > and has > no real problem. Their is also of way of shipping the binary code > (I am not > too sure how), to target users who do not have a compiler. If the > hash of > the source code corresponds to hash stored when the code was > compiled, no > recompile is forced.
Compile-on-import is certainly something that I would like to support. You are right, the workflow is too complicated for the average user (especially coming from Python). - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
