At rev.ng we're developing ludwig, a clang-based automatic generator of wrappers for C++ APIs.
First we generate C API and then generate wrappers for dynamic languages such as Python/Ruby/JS.
It's basically SWiG done right. Trying to write a C++ parser is a design doomed to fail.
In C++ ownership is much more explicit than C on average.
The idea is to have a Python wrapping object for each C++ pointer.
This wrapper can be owning or non-owning: if it's owning calls `delete` once the wrapper is destroyed.
If a C++ function returns a std::unique_ptr we map it to an owning wrapper.
If a C++ function returns an object by value we `std::move` it on a new object on the heap and map it to an owning pointer.
If a C++ function returns naked pointers, we map it to a non-owning wrapper.
The system is extensible, for instance you can say that a owner (see C++ Core Guidelines) is actually owning.
The wrapper can also be const or non-const, exposing the appropriate methods accordingly.
Also you have a lot of patterns you can exploit to provide high level constructs in scripting languages (e.g., `.begin` + `.end` ranges can become Python generators rather easily).
Here you can find the design document:
https://pad.rev.ng/s/__WrFSmm_#
Right now, we're struggling with default template arguments.
Many STL classes have default template arguments which make the name of types look ugly.
Also, we currently instantiate all the methods of template classes. But not all methods are supposed to be instantiate with all the possible template values. If you do instantiate those, you can run into compile errors. This means we have to resort to a sort trial and error approach to see what it actually makes sense to instantiate.
ludwig will be open source, but still needs some love before going public.