Skip to content

feat: autogenerate bindings in build script #6

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

doinkythederp
Copy link
Member

This PR is an attempt to integrate the functionality of @amarcolini's external Python script directly into the build process to effectively remove all maintenance costs of vex-sdk.

These changes keep the bindings up-to-date by automatically re-generating them when the Hydrozoa runtime changes.

Included in the generator, VEX SDK methods are given simplified Java-inspired names which are chosen by attempting to parse their original forms:

Before: vexTasksRun()
After: VexSdk.Tasks.run()

Before: vexSystemHighResTimeGet()
After: VexSdk.System.getHighResTime()

The mapping from C-style name to Hydrozoa-style name starts by removing the vex prefix, turning the next word into an inner class name (e.g. System or Device), and then using the rest of the original name to name the method. If a method ends in the words Get, Set, or another common "action verb," that is moved to the front.

I am experimenting with usage of org.teavm.interop.Address for simpler FFI generation in this PR.

@doinkythederp doinkythederp added the enhancement New feature or request label May 21, 2025
@doinkythederp
Copy link
Member Author

Something I'd like to look at is using https://lib.rs/public-api to generate the API spec rather than relying on the hydrozoa runtime. That way all of the documentation from vex-sdk could be included for "free"!

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

Successfully merging this pull request may close these issues.

1 participant