Skip to content

Expand GDScript guidelines with guidelines from the main repository.#53

Open
Ivorforce wants to merge 1 commit intogodotengine:mainfrom
Ivorforce:gdscript-general-guidelines
Open

Expand GDScript guidelines with guidelines from the main repository.#53
Ivorforce wants to merge 1 commit intogodotengine:mainfrom
Ivorforce:gdscript-general-guidelines

Conversation

@Ivorforce
Copy link
Member

@Ivorforce Ivorforce commented Feb 3, 2026

Migrates some information from the README.md on the main godot repository.

I've paraphrased it to fit with guidelines, and added one of my own which often comes up.
I also removed the last point during migration (about language speed). I don't think it makes for a good guideline for a language to be slow 😅

Corresponding engine PR: godotengine/godot#115820

-----------------

GDScript is gradually typed. Type hints are optional and help with static analysis and performance.
However, typed code must easily interoperate with untyped code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A short code example here could be nice.

How would issues with typed code interoperating with untyped code play into GDScript language development itself? I would think what's being described here would be more relevant for those writing addons and game scripts in GDScript itself.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea, I think, is that people can always choose to either type or not type a section of their GDScript code, and it works seamlessly without weird workarounds. This is a design goal for the language, not a guideline for GDScript users.
I guess we could provide a code example, but I'm not sure if that would be useful. Given that it seems to be ambiguous right now, maybe we should work on the phrasing instead?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a statement of fact than a guideline or anything of the like. For actual users, they should always use typed code when possible.

For GDScript developers, it is a requirement that typed code must weaken to untyped code without loss in functionality and not require conversion code from users.

All things said, I don't think it is worth worrying too much about the verbiage. It seems very likely that the whole "gradually typed" thing would need to be scrapped in favor of a proper strongly-typed paradigm to do the kinds of things that people want to see in the language.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experiences working on GDScript language features so far, it's felt like the strict typing of C++ has forced the GDScript features to be type-safe and adaptable to untyped code. As a result, it comes across to me as more of a "statement of fact" like you said.

However, I know my work with GDScript has been quite limited, so there are no doubt places where a GDScript engine developer would need to take into consideration typed vs untyped code. Something like an example scenario or little code snippet that demonstrates this could be helpful for giving contributors an idea of what to look out for.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit harder pressed to find a nice and self contained example for this, but I remain convinced that this is a design goal rather than a state of fact. There are tons of details in gradual typing that you can get wrong, or get right, to shape the experience of users that need glue code between typed and untyped code.

@Ivorforce Ivorforce force-pushed the gdscript-general-guidelines branch from 8d3f6e9 to ddcfa27 Compare February 3, 2026 18:23
@Ivorforce Ivorforce force-pushed the gdscript-general-guidelines branch from ddcfa27 to ec3833f Compare February 3, 2026 21:47
@Ivorforce Ivorforce force-pushed the gdscript-general-guidelines branch from ec3833f to bf5c4b1 Compare February 4, 2026 00:56
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.

3 participants