-
Notifications
You must be signed in to change notification settings - Fork 524
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
Draft bootstrap decl #1918
base: main
Are you sure you want to change the base?
Draft bootstrap decl #1918
Conversation
4070b93
to
92e3498
Compare
I guess first let me ask you what do you hope to get out of this change. Is this mainly to be able to use the Clang's Recursive AST visitor, and as such try to minimize the risk of crashes we have in complex where our walking of Clang AST might be erronous / incomplete? Is there some other advantages you are thinking about? |
It's 3 things really:
|
I'll try to think about this tomorrow and see if we can come up with a plan how best to do this. |
@tritao Was there a specific reason not to include OMP and OBJC expr/stmt nodes? |
Were never needed for my or previous users use cases I guess. The goal of the AST layer has always been mainly for the bindings generator, and there are other tools for ObjC stuff. |
Cool, was just wondering, since it would be quite easy to just support them if they are auto generated anyway |
On one hand, I want to say sure, why not. On another, from a maintainer point of view, just seems potential future problems. I would say unless you have immediate need for it maybe it's not worth it for this first iteration at least. |
Agreed. FYI, while this is on hold, I'm working on getting the AST visitior implementation done for stmt/expr since those are already auto generated so easy to convert |
92e3498
to
f81f8e6
Compare
So just a little feedback on this so you know what I'm thinking. Overall from a technical perspective, generating more code versus manually writing it is nice of course. I'm just a bit worried from a future maintenance perspective, it does add some new complexity and dependencies to the overall system, as the new decls depend on a lot more of the internal details of Clang and the whole bootstrapping process is also a complex process which needs some continued babying to continue generating good code. Previously we only surfaced the bare minimum of information we have needed, which makes it more efficient from a memory perspective I think, as well as minimizing the work when upgrading Clang. So I'm kinda torn from one I really love this work and want it, from another, I'm not sure the practical benefits outweigh the added complexity. Also to be perfectly honest, now you are very motivated and working on this (which I am greatly grateful for) , but you might not be around in a couple of years, which is normal. And I worry I might end up being in a situation of needing to spend a ton of time to fix the system as Clang upgrades are necessary. All in all I don't want this to discourage you, I'm not saying let's not do it. it may be I just need to understand the advantages of the new approach better. Right now there's the new Are the advantages worth the changes here? I think overall the main issues with the current approach is the complex crashes due to bugs when doing the manual AST walking, which I hope we could make more robust by using Clang's visitor stuff. |
Okay so I managed to generate a
Declaration.h
file from clang source, but I'm a bit stuck.Since they don't really match, it's not easy to map the new data to the old one. I'm not sure how to go from here.. I kinda need this new data to properly support everything and implement the recursive AST visitor we talked about before.
I feel like the only way to get this done is to slowly convert each of the original decls to the new version, but I also don't want to waste time. Any suggestions/ideas to reduce the amount of time required for this task?
Note: This code is my first pass! Definitely not ready for review XD