On Thu, Jun 19, 2008 at 11:44 AM, Gael Varoquaux
<[EMAIL PROTECTED]> wrote:
> On Thu, Jun 19, 2008 at 11:40:46AM -0700, Robert Bradshaw wrote:
>> 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).
>
> Sweet I am happy to hear this. What got me into this thinking was really
> writing an article, and thinking "this is more complicated than it needs
> to be".

+1 from here, esp on a weave.inline-like approach.

I'm not writing an article about it, but just finished teaching a
seminar at Berkeley about Cython (part of an ongoing series on python
for scientists - https://cirl.berkeley.edu/view/Py4Science/WebHome)
and I kind of sneaked that problem under the rug by providing them
with examples that had the Makefile/setup.py premade, but it is an
issue.

The weave catalog/hash approach is in my opinion the way to go, and I
know Eric Jones (from Enthought, and the original author of that code)
has always wanted to have that machinery abstracted out and used as a
generic tool for integrating auto-generated extension modules.  If any
of you decide to go in that direction, I'd encourage you to look at
it.  Today, weave.iniline() assumes its input is C(++, really), but
the machinery could easily be generalized to allowing multiple
language 'backends' with a similar call API.  I think that would be
very useful.  weave.inline() is *extremely* popular with working
scientists (it's a guaranteed hit whenever I teach it) because of:

  1. its simplicity of workflow
  2. how cleanly it allows access to NumPy arrays via Blitz++.

I know Dag is already hard at work on #2 for Cython, I'm thrilled to
hear that #1 is also on the radar.

By the way, I cleaned up the primes example a little bit, added
docstrings and a proper set of tests (they use nose though for
running).  If you want to use this, feel free to grab it from here:

https://cirl.berkeley.edu/twiki/pub/Py4Science/WebHome/cython.tgz

It's the one from your Demo directory, just with more comments/info
and a simple set of tests (I'm trying to get people into the habit of
using doctests and proper tests around here).

Note: I removed the Numeric example completely because it's broken,
and only left the primes one to focus for my class.  So don't take the
makefile from there, but the .pyx/.py files are more commented
versions of yours that you can use for your next release, if you want.

Cheers,

f
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to