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

Feature Request: Provide uniffi-bindgen generate for language subcommand #2327

Closed
cavivie opened this issue Nov 21, 2024 · 3 comments
Closed

Comments

@cavivie
Copy link

cavivie commented Nov 21, 2024

Currently, the following commands are used to generate language-specific bindings:

uniffi-bindgen generate --language {LANGUAGE} ...

uniffi-bindgen-kotlin ...
uniffi-bindgen-swift ...
uniffi-bindgen-{LANGUAGE} ...

As mentioned here, different languages ​​may have different variant arguments, so different languages ​​are split out and run as main commands separately, which is a big step forward.

We can go a step further. In addition to providing a separate language as the main command entry, I also hope that the language here can exist in the form of a subcommand, so that all functions can be completed with one binary, and variant arguments related to the language itself can be used:

uniffi-bindgen generate kotlin ...
uniffi-bindgen generate swift ...
uniffi-bindgen generate {LANGUAGE} ...

Is such a feature request acceptable, or is it the goal of the project to accept such a change?

@mhammond
Copy link
Member

I think we are more likely to head in a different direction, and have each binding be 100% responsible for generating bindings for a given language. This would make things more consistent with external bindings, such as golang or c#. Each language gets it own binding binary.

To put it another way, I think we should stop treating the builtin language as "special".

@cavivie
Copy link
Author

cavivie commented Nov 22, 2024

If I understand correctly, in the future there may only be uniffi-bindgen-{LANGUAGE}, but no uniffi-bindgen generate --language {LANGUAGE}, nor uniffi-bindgen generate {LANGUAGE} mentioned by this feature.

In that case, further, the current uniffi-bindgen generate subcommand will also be removed in the future.

All right?

@mhammond
Copy link
Member

Yeah, that's correct. Although I guess you could imagine a world where bindings were like git - eg, uniffi-bindgen generate {LANGUAGE} was generic and just tried to execute uniffi-bindgen-language or similar.

IOW, I think we mainly just want for none of the languages to be "special" - so "swift" and "go" and "js" etc all work as well as each other.

@cavivie cavivie closed this as completed Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants