-
Notifications
You must be signed in to change notification settings - Fork 27
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
DRLParser fails while building the master branch #77
Comments
Adding CursorKind.STATIC_ASSERT = CursorKind(602) To /usr/lib/python2.7/site-packages/clang/cindex.py solves the problem, but obviously it's not a great idea. Maybe it would make sense to ship a patched cindex.py with siplasplas until the patch is upstream. |
Maybe the long-term solution to all this problems is to provide our own versioned versions of cindex.py, one for each tested clang version. This may include some hotfixes like yours. In general, a way to avoid relying in external unstable releases if possible.
|
I would be interested in contributing to that. |
Cool, feel free to send PRs to the master branch ;) What I would do:
|
I think it's enough to have just one cindex.py because in my experience the incompatibilities stem from certain things not being exposed (like the CursorKind above), and not things like changing APIs (after all, libclang aims to be a stable, backwards-compatible library). That implies that there is no need to change the scripts that import it if it's in the correct directory. |
OH. That's even better! I haven't done before due to lack of time and, frankly, being a bit lazy... |
One of the things I have been thinking for months was to directly take Standardese backend and adapt the generation part to generate the siplasplas reflection metadata. This way we:
|
So, we could maintain a cindex.py file compatible with all the clang versions we support (Something we must define and fix first) |
Good idea, I'll take a look.
I think the minimal version is the first clang version that supports the C++ standard that siplasplas wants to support. If it's C++14, then if I'm not mistaken it's 3.7(?) |
I have been trying to maintain C++11 compatibility at least in the static reflection API, so the DRLParser generated code and the reflection API should be C++11 compatible. (I think there are some minor issues, last time I tried it worked with a GCC 4.8 with some warning about generic lambdas). |
Since C++ standards are mostly backwards-compatible, it's not a bad idea to opt for a minimal version of clang that supports a newer standard (i.e. to be able to parse the widest set of possible inputs). The generated code should not depend on this at all. ANd libclang supports the -std flag. |
Do you want to rewrite all of DRLParser in C++ or only replace the actual parsing with Standardese? I think the latter would be fairly easy if we made a Cython wrapper around Standardese. The jinja template would probably have to be changed a bit. This could also be used as an intermediate step towards a full rewrite. |
I want to replace the whole DRLParser tool to get rid of python dependencies. Also, writing DRLPaser in C++ makes it easier to write a C++ API to invoke it programatically (Which I would like to have for runtime c++ compilation) |
I'm looking at a replacement for Jinja and found this: https://github.com/hughperkins/Jinja2CppLight At a first glance, it misses macros that is feature that siplasplas templates seem to heavily depend on. Are there other features missing? This is another approach: https://github.com/hughperkins/luacpptemplater which might be easier to implement macros with. Maybe @hughperkins has some input? |
I use the luacpptemplater for runtime generation of opencl kernels from templates from c++, which works very well for me. The syntax is slightly different from jinja2, a bit uglier I would say, but it's a full scripting / macro language, whereas the jinjacpplight either is very lightweight (current form) and misses stuff, or else would become it's own entire scripting language, which seems redundant somehow?
…On 7 December 2016 23:54:51 CET, "Tamás Szelei" ***@***.***> wrote:
I'm looking at a replacement for Jinja and found this:
https://github.com/hughperkins/Jinja2CppLight
At a first glance, it misses macros that is feature that siplasplas
templates seem to heavily depend on. Are there other features missing?
This is another approach:
https://github.com/hughperkins/luacpptemplater which might be easier to
implement macros with. Maybe @hughperkins has some input?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#77 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
I can see where you are coming from. I agree that the lua option is fairly good for this, what do you think, @Manu343726 ? (There is also a lua package on conan). This is probably the direction with the least resistance, because changing the template syntax is way less work than adding the missing features to jinjacpplight. |
I looked at Jinja2CppLight previously when searching jinja2 replacements, but didn't know about luacpptemplater. I think it is perfect for our use case. The only thing I'm worried about is conan.io support of this dependency, since I want to completely switch to conan for thirdparty management (See #78). But the project looks simple to port to conan ;) |
@hughperkins is it possible to define a lua function in the template as a "macro"? What I mean:
would output
|
Interesting question. I added a test at hughperkins/luacpptemplater@38cc752 to check this point. This test passes. Note that the lua templater code idea and core implementation came from John Nachtimwald https://john.nachtimwald.com/2014/08/06/using-lua-as-a-templating-engine/ . I'm not sure why I didnt point this out in the readme before, but I've added it now hughperkins/luacpptemplater@9611b32 |
That's great, thank you! |
@hughperkins thank you for the support! |
In the meantime I started to freshen up luacpptemplater a bit. I'll take a stab at making a conan package as well. https://github.com/sztomi/luacpptemplater |
After setting the flag to download clang and having installed ncurses5-compat-libs, I'm observing an exception in DRLParser. Relevant parts of the output:
I ran:
The text was updated successfully, but these errors were encountered: