AutoZNG implementation using builtin rust tooling#58
AutoZNG implementation using builtin rust tooling#58nate-fe2o3 wants to merge 12 commits intoHKalbasi:mainfrom
Conversation
…stPathAndGenerics in the From impl
continuing to add more functionality. * size/alignment autogenerated from --print-size-type parsing * Rust std library pregenerated rustdoc json files have been added, so we can grab any types imported implicitly from std and generate explicit bindings on the C++ side
|
I tried my best not to touch any existing code other than adding the |
|
The current implementation is stuck on the rust std/core dependency resolution, where it hits unimplemented functionality in zngur-generator/rust.rs. I've been running this against the tutorial example, and the particular issue happens when parsing methods for Vec and ends up calling |
|
Thanks for the PR! I think the auto generation of zng files is the most important remaining thing for zngur. There are some challenges for auto generating the zngur file, I also mentioned some of them in #5:
Due to these challenges, I think fully auto generating the zng file is impossible, and we need to change the zng file or introducing another auto-zng file to enable the user to select the type, methods and instantiations they need. That file ideally should support a glob-like syntax (e.g. I want all methods for this type, or I want Vector of all types in this crate). It should also try to deduce when something is needed instead of requiring explicit annotations, e.g. when |
I added raw pointers support so we can now continue testing the current implementation. |
|
Thank you! I've been thinking through the problems you mentioned with the naive auto-generated approach and am doing more research. Will keep you posted on how it turns out. |
This implementation targets the direct, automatic creation of the ZngurSpec object from info derived from several rust tools:
print-type-sizesnightly featureThe bulk of the work is in the new zngur-def/rdoc.rs file that contains an (incomplete) translation layer from the rustdoc Crate type to the ZngurSpec type. Several types aren't yet supported, but work is ongoing. Standard library dependencies are noted on the first pass of the translation, and then added to the ZngurSpec on separate passes of the RustDocParser.