Conversation

Just completed writing my first ever C-based Python extension. MUUUUUCH better experience than writing the same exact extension, but for PHP. Like, I'm in wholly different universe.
1
6
Replying to
CFFI is the easiest and nicest way to interface with C from Python. Strongly recommend that over CPython extensions unless you have special requirements like needing to do work without the CPython GIL held. It's probably a bad choice of language when that's relevant though.
1
Replying to and
CFFI is similar to the ctypes module for simple cases but it has a lot of conveniences and what makes it a lot different is that it understands a large subset of C to make the bindings for you. You just write a bit of Python code. Usually don't need to actually write any C code.
1
2
Replying to
I think after I've hit a few crucial milestones at ${DAYJOB}, I'll revisit CFFI. Since the module's already written at this point, there's not much need to redo the work. Thanks for the suggestion! I'll take a deeper look into CFFI for our next modules.
1