News for hackers. Stuff that matters.
Re:Interfacing Python and C: Advanced “ctypes” Features by xioxox on Tuesday November 07, 2017 @10:21AM (#15644054)
I've always thought ctypes a bit of a hack as you get crashes and so on if you're not constantly careful about updating function definitions. It would be much nicer if the compiler could catch the errors, e.g.

    #include "mylib.h"
    PYTHON_WRAP(myfunc, void, float, float...)
Even with cython (please correct me if I'm wrong), the definition needs to be duplicated in the cython script to use it.
Re:Interfacing Python and C: Advanced “ctypes” Features by mattip on Tuesday November 07, 2017 @10:31AM (#15644157)
You are describing cffi http://cffi.readthedocs.io/en/latest
Re:Interfacing Python and C: Advanced “ctypes” Features by ryanpepper on Tuesday November 07, 2017 @11:06AM (#15644507)
Boost Python looks somewhat similar to that type of interface too. http://www.boost.org/doc/libs/1_62_0/libs/python/doc/html/tu...
Re:Interfacing Python and C: Advanced “ctypes” Features by xioxox on Tuesday November 07, 2017 @10:42AM (#15644281)
Sort of, though I was thinking of more of a system external to python at the C/C++ level. Maybe it's possible to use cffi like this.