Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



This 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


Out of curiosity, what do you use Terra for? It looks cool but I haven't found an excuse to use it.


I used it to build Regent: http://regent-lang.org/ (TL;DR: Implicit parallelism on supercomputers with automatic compilation for GPUs, etc.)


I've been using ctypes for the exact same purposes and it has been pretty painless. Why have you decided to use FFI?


As 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.


Not 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: