On 6/12/10 8:22 PM, Gregory Ewing wrote:
> Terry Reedy wrote:
> 
>> Would it be possible to write a program that converts a module that
>> uses ctypes to interface to a dll to a corresponding C extension
>> program that would compile to a drop in replacement extension module?
> 
> Probably, but I don't see how that could be done automatically
> in a way that ensured the result would be any safer than the
> original ctypes-using version. If you preserve the semantics of
> the Python code, you also preserve any bugs it might have.

I dunno. This is exactly what Cython does. I have exactly one extension
module in Cython that uses it, and so very limited experience-- but it
seems very solid and very safe, from my admittedly limited attempts at
breaking it.

True, Cython != Python. But its close enough that Python programmers can
do it without knowing the pain of C, just following a certain limited
Python subset. Its very doable, very accessible, and *seems* to address
this very issue.

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to