[cfe-commits] r163057 - /cfe/trunk/bindings/python/clang/cindex.py
Sean Silva
silvas at purdue.edu
Mon Sep 3 18:45:45 PDT 2012
> I haven't looked at this patch, but there's no way the entire cindex.py
> could be automatically generated: there's too much complex logic (such as
> reference tracking to ensure proper GC behavior). The functions and data
> structures themselves, no problem!
The only barrier to generating all of it is for the end result to be a
nice Pythonic API. I don't think that computers will be able to grasp
"pythonic" for a while though ;)
--Sean Silva
On Mon, Sep 3, 2012 at 1:12 PM, Gregory Szorc <gregory.szorc at gmail.com> wrote:
> On 9/3/2012 1:58 AM, Tobias Grosser wrote:
>>
>> On 09/01/2012 04:19 PM, Sean Silva wrote:
>>>
>>> I would be nifty if we could generate all of these directly from
>>> Index.h using cindex.py itself!
>>
>>
>> Hi Sean,
>>
>> are you stating you want to generate the entire cindex.py automatically?
>> Or just the table with the method signatures?
>>
>> I am honestly a little afraid of generating all automatically. This
>> seems to increase the complexity of the python bindings significantly.
>> Also, I am not sure how easy we could do performance tuning on such an
>> automatically generated code or how we could add proper error reporting.
>>
>
> Anders had a similar patch a while back. It generated a standalone .py file
> that defined a data structure for all the C functions. This was used to
> register functions with a library instance. There was a good reason we
> didn't land it then, but I can't recall what. Now that we have the function
> definitions in a nice data structure, I wouldn't be opposed to moving that
> into a separate file and have that file automatically generated.
>
> I haven't looked at this patch, but there's no way the entire cindex.py
> could be automatically generated: there's too much complex logic (such as
> reference tracking to ensure proper GC behavior). The functions and data
> structures themselves, no problem!
More information about the cfe-commits
mailing list