3 ms·
In your example, of interfacing with Python, yes I would usually go for C because to interact with CPython needs a C ABI in the end. C++ requires another tool t
by saboot 6y ago
In your example, of interfacing with Python, yes I would usually go for C because to interact with CPython needs a C ABI in the end. C++ requires another tool to get there (pybind, swig, etc).
- pjmlp 6y agoextern "C" { // my C++ code } Big deal.
- jcelerier 6y agobut pybind11 makes interop so much more trivial between C++ and python. passing std::vector, std::string, custom types, etc... it all just works and with much less errors possible than the C Python API. Why would you subject yourself to it ?