Separating template C++ code from Python code?
I spent some time yesterday reading and modifying pybindgen to get my head around the way it works. Overall the library is very well implemented (I'm coming from SWIG so you can imagine the pain I'm used to) and I would love to start using it (once I iron out how to produce fully compatible interfaces to conform to my current SWIG'd implementation), but one thing that stuck out as vastly lowering the readability of the code was the fact that the C++ code generation was interspersed in the Python code directly.
I've done quite a bit of C++ code generation in the last few years and I have found over time that it really helps the readability and maintenence of the code if the template code can be somehow seperated into its own area. I have solved this in the past by relying on a template engine (I used Mako) to seperate "presentation" from business logic: you could just as easily separate out Python template strings and not rely on any external module.
I'd love to see this happen in this project because I do think you would end up with vastly cleaner code. Any thoughts? Again, if help were needed I would be willing to lend a hand.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- PyBindGen Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Jamie Kirkpatrick for more information if necessary.