Skip to content
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

Serialize IR #14

Open
haxscramper opened this issue Oct 8, 2021 · 3 comments
Open

Serialize IR #14

haxscramper opened this issue Oct 8, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@haxscramper
Copy link
Owner

haxscramper commented Oct 8, 2021

Make CxxEntry IR serializable into json (or something else). Right now the structure is cyclic on .typeStore and some other fields (most likely only type store), so this needs to be addressed. Maybe just skip type store altogether and allow to re-create it again?

Serializing IR would make it possible for someone else to just take generated .json and construct the own binding generator (for nim or any other language, though hcparse is nim-specific for now). Considering how much information hcparse is holding during the wrapper generation process, it would be criminal to not make it accessible to the end users as well.

@haxscramper
Copy link
Owner Author

Generated wrappers should also contain a mapping between wrapped Cxx types and nim module that needs to be imported. This is needed to allow for inter-project dependencies.

haxscramper added a commit that referenced this issue Oct 13, 2021
Partially implement #14 -
allow `type_import.json` to be created when wrapgen script is executed.

- ADDED ::
  - Properly implement anonymous type generation
  - Write and read dependency type import mappings
@haxscramper
Copy link
Owner Author

haxscramper commented Oct 13, 2021

Something other than .json need to be used, mainly due to its limitations wrt. to type handling.

Jsony creates minified json, while I would prefer to minimize diffs since I might want to commit generated files.

XML is better suited for that sort of data storage, but it is less widespread wrt. to language support.

@haxscramper haxscramper added the enhancement New feature or request label Oct 13, 2021
@haxscramper
Copy link
Owner Author

frosty handles this task flawlessly, but generated sources are not human-readable (serialized to binary). The main objective is to be able to check IR dumps into git, and provide a schema file that can be used for anyone interested to write their own wrapper generator, so binary data formats are not suitable for this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant