3 ms·
Looks very cool. How many new extensions are written in C these days? I was under the impression it's mostly things like Boost Python, pybind or PyO3.
by rich_sasha 2y ago
Looks very cool.
How many new extensions are written in C these days? I was under the impression it's mostly things like Boost Python, pybind or PyO3.
- aragilar 2y agoThere's also Cython. I would guess also that HPy would replace the includes of `Python.h` that pybind11 et al make in order to bind to CPython, and so existing extensions should be easier to port?
- masklinn 2y agoPyO3 is bindings to the C API, so if you're using PyO3 you're still using the C API even if you're not actually writing C.
- rich_sasha 2y agoYeah, sure, I mean, how many people write C to write an end-user Python module. There's stuff that genuinely wraps C libraries or predates higher level language wrappers, like numpy or matplotlib, but how many new modules are actually themselves written in C?
- masklinn 2y agoThe point is that’s not relevant, the issue is the API / ABI of the modules, its requirements, and its limitations, not the langage in which the modules are written.
- m_rcin 2y agofor C++ 11+, pybind11 > Boost.Python for C++ 17+, nanobind > pybind11 (both created by the same developer) ">" meaning generally better, as described at https://nanobind.readthedocs.io/en/latest/why.html https://nanobind.readthedocs.io/en/latest/why.html
- physicsguy 2y agoQuite a lot, for things like simulation code Less so for general programming.
- trkannr 2y agoA lot. You don't have to write in C, just use the C-API functions. pybind etc. introduce a whole new set of problems, with new version issues and decreased debug ability.