On Thu, Nov 4, 2010 at 3:25 PM, Brett Calcott <[email protected]> wrote:

> I may be guilty of thinking of cython as a "code-generator" :(

Well, aren't all compilers :). There's a distinction between code
generators and wrapper generators (which you seem to understand). Of
course automatically generating .pxd files for use from Cython is a
slightly different thing that would be very handy to have.

> On 5 November 2010 08:28, Stefan Behnel <[email protected]> wrote:
>> Christopher Barker, 04.11.2010 17:55:
>>> One day, we may have a mature Cython code generator for wrapping C/C++
>>> (and it may be worth looking at what has been done along those lines).
>>
>> The code generation has never been the main problem. That would be parsing
>> arbitrary header files (preferably without adding huge dependencies like
>> gccxml or clang) and figuring out what's relevant enough to merit ending up
>> in the generated code. Once that's done, generating a Cython .pxd file
>> and/or "mostly usable" code skeleton from it is rather straight forward.
>>
>
> Getting the pxd files automated would be nice. But I *like*
> constructing the pyx files by hand, as I don't want to simply copy the
> c/c++ interface (like swig does). It means you can rethink how the
> structure of a library best works in a python-like way.

Yes, I think this is extremely valuable too.

> The problem
> I'm having (which I'm getting solutions too - thanks!) is that a large
> proportion of python code ends up being dumb property mapping stuff.

Yeah. I don't think we've hit on a nice Pythonic way to do this yet,
but I agree it could be better. If there's a lot, I might be tempted
to write a one-off script generating this portion of the file--as
mentioned, much easier than getting the general case right.

> In any case, thanks for listening, and the suggestions. I hope to be
> hanging around for a while.

Good.

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

Reply via email to