I was wondering about the difficulties involved in adding the python c api, since it would be extremely useful.
On Sun, May 23, 2010 at 10:57 PM, Seth Burleigh seth@tewebs.com wrote:
I was wondering about the difficulties involved in adding the python c api, since it would be extremely useful.
Hey Seth,
I used to be skeptical about supporting the C API in CLPython, but now IronPython (the .Net implementation) has started to support C extensions with a component called IronClad, with apparently most of NumPy already working: http://www.resolversystems.com/products/ironclad/
Interesting implementation details: http://ironclad.googlecode.com/svn-history/r108/trunk/doc/details.txt
That they got it working is a nice surprise. But I don't know if their approach would work for CLPython...
- Willem
On Mon, 2010-05-24 at 10:45 +0200, Willem Broekema wrote:
On Sun, May 23, 2010 at 10:57 PM, Seth Burleigh seth@tewebs.com wrote:
I was wondering about the difficulties involved in adding the python c api, since it would be extremely useful.
Hey Seth,
I used to be skeptical about supporting the C API in CLPython
Hmm, i must be missing something obvious. Looking at http://docs.python.org/library/ctypes.html
it seems that it would just be a matter of converting from the ctypes api to the cffi api. Though scanning it i don't see how some things could be done, like examining the stack for windows to see if you passed the wrong amount of arguments. Most othres, however, like endianess of structures, using custom datatypes, are all possible.
On Mon, May 24, 2010 at 4:41 PM, Seth Burleigh seth@tewebs.com wrote:
it seems that it would just be a matter of converting from the ctypes api to the cffi api. Though scanning it i don't see how some things could be done, like examining the stack for windows to see if you passed the wrong amount of arguments. Most othres, however, like endianess of structures, using custom datatypes, are all possible.
Yes, ctypes looks implementable with CFFI. If you give it a try, let me know how it goes :)
There are many C extensions for Python that are using this API instead: http://docs.python.org/c-api/ -- and supporting all of that is a challenge.
- Willem
clpython-devel@common-lisp.net