On Fri, 16 Apr 2021 18:08:58 -0000 "Denis Kotov" <redradist@gmail.com> wrote:
Okay lets try to discuss one by one: 1) Readability - less code, most code is hidden by abstraction without losing performance In CPython code lots of stuff like Py_INCREF, Py_DECREF .. it could be fixed with C++ std::shared_ptr<> (RustPython use analog Arc<>)
std::shared_ptr<> would be a bad replacement for CPython's reference counting for two reasons: 1) the reference count is maintained in a separate memory block (unless you were careful enough to use std::make_shared() for allocation) 2) the reference count is atomic, and this has been proven to slow down CPython by 10-20%. That does not mean that CPython couldn't benefit from C++-based abstractions, but they would have to be implemented (or taken from another project such as pybind11). Regards Antoine.