-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project status #8
Comments
Thank you for interesting in the project. I'm going to uplift the autoprogrammer project till the upcoming CoreHard++ conference where I'm giving the talk about modern code generation tools (not only autoprogrammer). Regarding your suggestions:
In the production projects I used this tool I generated not only C++ files, but C files, JSON samples etc. as well. So, template engine which is stuck to the C++ isn't a good choice for me. Another point is that I can ship templates with the production project, not with the tool. Jinja2 is a widely-used notation, template engine is fast and independent. Lot of the boilerplaite for the reflection isn't a problem till this boilerplate can be generated. :)
Yes, there are no docs except my presentation. One of the reasons is that C++ interperter here is still in progress. Actually, it utilizes the idea of constexpr evaluator from the clang with one but significant addition: it allows mixing of injected and interpretable code. I. e. you can write:
Here
That's not a problem with the current autoprogrammer implementation:
I've been thinking about the external customization/plugins. But I'm considering something like python (in addition to the Jinja2 templates). Binding isn't a big problem. |
autoprogrammer's syntax seems beautiful, but complex for me. Maybe i`m wrong and some docs / updates will solve complexity issue. |
Docs will come up. In some future. :) |
Here is the sample how jinja2 templates can be used for serialization boilerplate code generation: |
I'm sorry to hear this sad news of @flexferrum 's passing. If anyone interested in development of tools similar to https://github.com/flexferrum/autoprogrammer or https://github.com/blockspacer/CXXCTP - please contact me. I'll be happy to contribute. E-mail: derofim hosted on yandex.ru |
This project is very interesting.
Some of autoprogrammer's features in
TODO
status, so i wanted to add them.I want to use some proposed features (like metaclasses) without waiting 3+ years for new C++ standard and can`t find stable (ready) solution.
Inspired by autoprogrammer's approach i created https://github.com/blockspacer/CXXCTP
Maybe some ideas from that project will be useful for autoprogrammer.
I found what jinja to C++ binding produced a lot of boilerplate code.
I replaced jinja with https://github.com/blockspacer/CXTPL
cxtpl uses approach similar to How to write a template engine in less than 30 lines of code from https://bits.theorem.co/how-to-write-a-template-library/
That approach allowed to remove
jinja2_reflector_generator.cpp
completelyI can't find docs about autoprogrammer's C++ interpreter, so i used
Cling
as C++ interpreter. Maybe autoprogrammer's solution is less verbose or feature rich (i just can't understand it without some docs).I wanted to add feature-complete Rust-like traits into C++. That's why i added to typeclasses generator
typeclass combinations
(when some typeclasses may be not set),std::ref support
,typeclass merging
(when all typeclasses must be set), out-of-source methods (so method may be defined in separate lib),typeclass with template parameters
. Now typeclass instance accepts impl as first template argument, and all other template arguments may be used to combine typeclasses.I wanted to chain multiple metaclasses, so i added custom C++ attribute syntax, very similar to calling C++ functions.
In attribute i can list needed metaclasses. Each metaclass is function (like
make_interface
) that returns modified source code or generated file.ctp_scripts
folder. Ifctp_scripts
used by separate project - all rules fromctp_scripts
must be imported into Cling, so it behaves like interpreted plugin system. Because interpreted code runs slower - i addedcustom_plugins.cmake.example
, so 'plugin' may be compiled and used as built-in tool plugin. Maybe it is better to create .dll/.so based plugin system.The text was updated successfully, but these errors were encountered: