pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.7k stars 2.1k forks source link

Is there any suitable auto generator for large existing project? #252

Closed daleydeng closed 8 years ago

daleydeng commented 8 years ago

Hi, currently I'm using Boost.Python + pyplusplus to deal with large existing C/C++ project by auto generation, Is it possible to migrate pyplusplus to pybind11?

wjakob commented 8 years ago

There is an unmaintained project here that may be a good start:

https://github.com/ISoirar/pypp11

See also the issues, which have some further pointers.

daleydeng commented 8 years ago

Thanks~

daleydeng commented 8 years ago

I found pyplusplus is messy and I'm working on a new one based on clang, whoosh and jinja2

wjakob commented 8 years ago

That sounds like a great idea. You can also take a look at the mkdoc.py that ships with pybind11. That uses libclang to dump all the documentation headers from a C++ codebase so that they can be used as docstrings. Example usage here: https://github.com/wjakob/nanogui/tree/master/python

daleydeng commented 8 years ago

All right thanks, now I'm refering seasnake for clang code converter~~ https://github.com/pybee/seasnake, When I'm done, I'll post it up~

wjakob commented 8 years ago

Cool, I'd definitely be interested if you have something to share at some point. By the way, what is whoosh good for (Jinja makes sense to me, but Whoosh seems to be an indexing library, which is a bit unusual in this context)

daleydeng commented 8 years ago

Since there need some query operations on extracted AST for classes/methods to export. Usually you dont want to export all classes/methods which is overhead for large projects (OpenSceneGraph for example). In pyplusplus/gccxml, there exist module.classes, cls.mem_funs and etc for this job to specifiy some exporting parameters for code generation on the needed items(class, member functions and etc,) I'll finish it soon.

There is few lightweight text indexing, searching library for python, whoosh looks good~

My english is poor, sorry for that (I'm Chinese)~~

daleydeng commented 8 years ago

Currently, the skeleton of parser(clang), Indexer(whoosh) and Convertor(Jinjia2) are done and now im finishing the main specification of pybind11 by refering the documentation.