3 ms·
I'm in the exact same camp. I call it "two-language programming". Python+C beats the heck out of any single systems language, especially C++. And thanks to the
by fizixer 11y ago
I'm in the exact same camp. I call it "two-language programming". Python+C beats the heck out of any single systems language, especially C++. And thanks to the amazing bloated complexity of the C++ language, the cognitive overhead of Python and C combined is way less than C++ (unless you stick to a tiny subset of C++ in which case you're just doing C-only, with slightly cleaner syntax).
I'm still deciding on the best approach for the interface between Python and C. I don't like ctypes/cython etc because they require you to modify python code. I'd much rather create CPython extension but there is too much boilerplate. I'm looking into swig.
- SFjulie1 11y agoYou can also #include "python.h" in C and use cpython to handle from C dynamic data structures and manually do the incref, decref. If you are totally crazy you can also manipulate the frame to bring exception with stack trace in C... I don't do black magic. :) Very wrongly vulgarized you can integrate python as a runtime for your C code.