3 ms·
2) Need "speed" - write that part in C.) That's not so easy. Interfacing Python and C code is also incredibly hard, and no one true way exists.
by sherjilozair 13y ago
2) Need "speed" - write that part in C.)
That's not so easy. Interfacing Python and C code is also incredibly hard, and no one true way exists.
- gizmo686 13y ago>That's not so easy. Interfacing Python and C code is also incredibly hard, and no one true way exists. Can you elaborate on this. I've worked on python C extensions (just minor updates and fixes, I've never been the one to write significant chunks of it), and it seems like interfacing python with C is pretty straight forward.
- lmm 13y agoIf you use the CPython C API it's easy - but you also bind yourself closely to CPython. If you know performance is going to be important it's probably better to bite the bullet and use PyPy - which means you have to use the somewhat cruder cffi to interface with C code.
- briancurtin 13y agoI've done it numerous times over the last several years and while it's probably not trivial, it's definitely not hard. If you're looking for a "one true way", it's Python's C API.
- pekk 13y agoIt might be incredibly hard if you do not know C.