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

GDScript utility API #300

Open
Bromeon opened this issue Jun 6, 2023 · 4 comments
Open

GDScript utility API #300

Bromeon opened this issue Jun 6, 2023 · 4 comments
Labels
c: register Register classes, functions and other symbols to GDScript feature Adds functionality to the library

Comments

@Bromeon
Copy link
Member

Bromeon commented Jun 6, 2023

In addition to Rust APIs, users may benefit from simple building blocks in GDScript. On Discord, one idea that came up was mapping Result<T, String> to GDScript, that would allow accessing either the result or an error message.

This is in early brainstorming stage and may be something we don't end up doing, but discussion on the topic is appreciated 🙂

Some topics that need to be clarified in particular:

  • How to distribute it (GDScript has no dependency system)
    • let the user copy .gd files?
    • register some "system" Rust classes that are accessible in GDScript?
  • How and where to document them
  • How to version them
  • Alternatives (ideally the user doesn't have to use those to interoperate with gdext, but it may be a nice quality-of-life addition)
@Bromeon Bromeon added feature Adds functionality to the library c: register Register classes, functions and other symbols to GDScript labels Jun 6, 2023
@lilizoey
Copy link
Member

lilizoey commented Jun 7, 2023

* How to distribute it (GDScript has no dependency system)
  
  * let the user copy `.gd` files?
  * register some "system" Rust classes that are accessible in GDScript?

Having messed around with some potentially useful ergonomics stuff, i think having support for such "system" rust classes could be useful. though probably either as a separate crate or behind a feature flag.

things like converting closures into callables or implementing Future for signals would likely require something like this.

@TitanNano
Copy link
Contributor

Could this be distributed as a plugin on the asset library?

@astrale-sharp
Copy link
Contributor

if it's a "system" rust class (my preference), then the documentation should probably appear in godot itself at least.

@TitanNano if it's gd files, then it could be a plugin imo but if it's a "system" rust class, then it's just registered in the .so file

@Bromeon
Copy link
Member Author

Bromeon commented Jun 16, 2023

Could this be distributed as a plugin on the asset library?

Possibly, however that might be quite hard to keep in sync with the gdext version -- and there's no dependency or package manager for assets/plugins in Godot.

As such, having gdext-provided "system classes" is likely the more promising approach.


if it's a "system" rust class (my preference), then the documentation should probably appear in godot itself at least.

That could be done if #178 is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: register Register classes, functions and other symbols to GDScript feature Adds functionality to the library
Projects
None yet
Development

No branches or pull requests

4 participants