-
Notifications
You must be signed in to change notification settings - Fork 42
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
Upgrade wrapper generator #226
Conversation
|
Thanks! Let's maybe wait to merge this until we can record something definite in the Manifest (i.e. a commit on the master branch of Clang.jl). |
@maleadt In Julia 1.3+, this manual clean-up step is actually not mandatory because those anonymous enum "names" should never be used anywhere. The new generator uses Julia's For Julia 1.0-1.2, maybe it's a good idea to add an optional pass to rewrite those The new generator is designed to generate native Julia code without any magic, so for those Julia users who do not have decent knowledge about C, the generator can give a simple answer. For example, if a user doesn't know how to translate the following C typedef to a Julia type:
The generator just tells:
As of C's anonymous tag-types, there is also no corresponding Julia construct. It's inevitable to do de-anonymizing on the Julia side. I think making In theory, it's easy for the generator to generate C-like wrapper code by using CBinding.jl, but there is already a CBindingGen.jl for that. CBinding.jl is very good at emulating C-syntaxes by featuring Julia's cool macro system, it's highly recommended to those users who like magics and don't wanna know the things under the hood. I guess the only drawback is that without a solid knowledge of both Julia and C, if something goes wrong, users are unlikely to make a fix by themselves. Not to mention Cxx.jl, one of the most magic packages in the Julia world, lets users write pure C/C++ and do Julia-C/C++ cross optimizations at the LLVM level. It's the easiest one to use but the hardest one to maintain. I'm glad we have all these 3 packages in the Julia ecosystem for Julia/C interop to cover different use cases in the real world. |
Looks like I need an approval for running tests on the CI. The script has been simplified even a little bit more with JuliaInterop/Clang.jl#289. However, there is one thing that concerns me. The symbol (to do the test locally, you need to comment
I didn't test other platforms, but I guess their definition for |
Nice progress! I approved CI. A correct |
@maleadt I manually defined BTW, I've no plan to tag a new version of Clang.jl before the generator scripts in all Clang.jl's downstream projects have been upgraded. So don't forget to checkout Clang.jl#master to run the script. |
Great, thanks! Looking forward to using this with CUDA.jl. I've already migrated oneAPI.jl, https://github.com/JuliaGPU/oneAPI.jl/tree/master/res, too. |
I'm testing JuliaInterop/Clang.jl#278. Before making a new release for Clang.jl, I'd like to make sure that the code generated by the new generator is not broken.
I got the following test errors with this PR, any clue would be highly appreciated.UPDATE: looks we're all good now.