14 ms·
I do some embedded hardware work, and have tests for the C code in python vi FFI. It's also amazing to be able to graph out scenarios with inputs and outputs in
by danielvf 9y ago
I do some embedded hardware work, and have tests for the C code in python vi FFI. It's also amazing to be able to graph out scenarios with inputs and outputs in Jupiter notebook.
But I hate, hate, hate, cffi's parsing of include files. Makes my life miserable every time I make a change there.
I'm really hoping DragonFFI takes off.
- bliker 9y agoI've been using ctypes for the exact same purposes and it has been pretty painless. Why have you decided to use FFI?
- danielvf 9y agoAs far as I can see, ctypes requires you to manually specify everything, rather than load it from the .h include file. This is even more work.
- chatmasta 9y agoNot to mention another source for error when testing the c code in python. Your test might fail because you forgot to update a header definition in the python, not because you introduced an error in the C code.
- eslaught 9y agoThis is one of my favorite features of Terra [1]. It also uses Clang to parse the header files, so most things "Just Work" (including, even, JITing inline functions on the fly so they can be used). [1]: http://terralang.org/api.html#using-c-inside-terra http://terralang.org/api.html#using-c-inside-terra