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

Create documentation page about: creating languge bindings for GDExtension using the C GDExtension API #7488

Open
rempas opened this issue Jun 9, 2023 · 3 comments
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation content:new page Issues and PRs related to creation of new documentation pages for new or undocumented features enhancement topic:gdextension

Comments

@rempas
Copy link

rempas commented Jun 9, 2023

Your Godot version: 4.0.3

Issue description: No documentation about create GDExtension bindings

URL to the documentation page (if already existing):

While there is a documentation page about what GDExtension is and its difference with C++ modules and another page showing an example with the C++ GDExtension bindings, there is no page about creating bindings for a programming language and where to find and how to use the C GDExtension API. It would be very nice if one such page is added.

It doesn't have to be something very advanced and extreme but at least something basic to show developers how to create bindings for other languages.

Personally, this will be very important for me as I'm creating my own language and while it's still very very early and I haven't even publish it yet, I want the docs to be ready when I do so I can immediately start supporting Godot! Of course, languages that are out now are important as well!

@rempas rempas changed the title Create documentation page about how to create languge bindings for GDExtension Create documentation page about: creating languge bindings for GDExtension using the C GDExtension API Jun 9, 2023
@Piralein Piralein added content:new page Issues and PRs related to creation of new documentation pages for new or undocumented features area:manual Issues and PRs related to the Manual/Tutorials section of the documentation labels Jun 11, 2023
@carlos-ramos-73
Copy link

I too agree documentation is lacking. Recently, I have been trying to remake the summator example with only using C and a C compiler. While I understand it is not easy, the hurdles that I face basically boil down to me not knowing the gdextension internal parts of the engine. With so little documentation, I basically look at other language bindings and try to understand how others do it.

Are language binding maintainers in a group chat together or something? Online resources are limited. It truly feels like you just get the two generated files (extension_api.json and gdextension_interface.h) and a pat of on the back that tells you "good luck!"

I wish the gdextension.h would be fully documented. But regarding this repo, I suggest we have a page on doing a basic project in C. Specifically teach the following:

  • Declare and define built-in classes such as StringName and Variant (since they are used a lot in GDExtension).
    • Find their sizes in extension_api.json, Constructors, destructors, etc.
  • How to use variant_get_ptr_utility_function to implement the godot print() function. Shows how to implement globalscope functions.
  • How to create and register a new class. Shows how to implement classdb_register_extension_class3/4/etc.
  • How to bind a normal method to a new class. Shows how to implement classdb_register_extension_class_method
  • I could be missing more idk

It can be the the summator example again, just more broken down to use the bare C API.

This would help new language binders understand how the bare functionality works and wrap around it.

@carlos-ramos-73
Copy link

I just noticed this PR that can be salvageable. #8751

@rempas
Copy link
Author

rempas commented Dec 12, 2024

I just noticed this PR that can be salvageable. #8751

Thank @dsnopek, for #10403

To add, documentation (and good one) is a must for any project.

I have written almost the full documentation for my language before it's even started to being built, just to make you an idea.

Thank you Godot team for your amazing work! ❤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation content:new page Issues and PRs related to creation of new documentation pages for new or undocumented features enhancement topic:gdextension
Projects
None yet
Development

No branches or pull requests

4 participants