-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add documentation page about gdextension_interface.json
#11551
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
Add documentation page about gdextension_interface.json
#11551
Conversation
3a1c259 to
9541b14
Compare
gdextension_interface.jsongdextension_interface.json
6cc4e3a to
2070544
Compare
Bromeon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great writeup, thanks a lot 👍 I especially like the examples after each section, they clarify a lot!
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
In the future, there might be a section about the I'm not sure if "interface JSON" and "API JSON" are clear enough because the "I" in "API" is also "interface". Would a different term make sense here? In Rust I will likely keep using "header", which isn't very precise, but at least distinct enough for all practical purposes. One defines the actual C interface (or FFI), while the other is more a specification/definition of concrete engine symbols (classes, enums, etc.)... Maybe some inspiration here? |
2070544 to
fee76a1
Compare
|
@Bromeon Thanks! I attempted to integrate all of your suggestions in my latest push :-)
Hm, yeah. The When writing the note I added about |
f62db14 to
35f5c80
Compare
paddy-exe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small language nitpick. Otherwise this reads well. Great page addition!
As always thanks for including examples :)
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
I think it's a good start, but "high vs. low" is still very abstract... All of "ClassDB API", "classes API", "class specification", "class definitions" would be more concrete -- do you not think something along that would be possible? Without renaming the file now, of course. But high/low isn't reflected in the filename, either... The C API could still be "low-level interface", "C interface", "FFI interface" etc. Something that distinguishes the technical interface from the API JSON, which is more a specification or type database. But I don't know, naming is hard 😅 |
Ivorforce
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I've got only nitpicks!
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
35f5c80 to
e46dd1d
Compare
Bromeon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good! I only have a few remarks left, and they're bordering nitpicking territory 🙂
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
| - ``return_value``: An object which has a ``type`` (which may include modifiers), and ``description``. | ||
| It will always be given, and use ``void`` as the ``type`` if the function returns no value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more a question about the format:
It will always be given, and use
voidas thetypeif the function returns no value.
Is there a good reason to deviate from extension_api.json here, which omits the return_value key for void return types? Notably, the key is called "return value", not "return type" 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, well, the implementation was easier :-)
We already have "void" as a valid type (so that we can have "void *" and other modifiers) and simply always requiring this is simpler than having to check if it exists
I can look at what it would take to change the parsers. We'd then have to decide if we want to disallow explicitly specifying a return type of "void" (and force it to be omitted in that case), which would need to be reflected in the parsers and the schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a PR that changes the format to omit the return_value for void functions: godotengine/godot#114684
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
tutorials/scripting/gdextension/gdextension_interface_json_file.rst
Outdated
Show resolved
Hide resolved
179a08c to
e784e3c
Compare
e784e3c to
6d01998
Compare
6d01998 to
221e0ed
Compare
|
Thanks! |


This adds documentation on the
gdextension_interface.jsonfile that was added in PR godotengine/godot#107845It attempts to address the remaining issues brought up on godotengine/godot#113732
cc @Bromeon
Fixes godotengine/godot#113732