Comment by danbolt
1 day ago
> It has a terrible scripting language
Curious, could you elaborate on what you find terrible about it? I’ve been toying around with GDScript for a little while, and I think it’s actually quite well-suited for developing 3D games.
Or, they get a lot right with gradual typing, reference counting, and low-cost marshalling between native code and the script VM. The language authors know it’s a DSL, so they add specific features such as `$` and `@export` that are idiomatic to the engine’s architecture.
Ironically, both features you mention are ones that seem questionable. `$` feels like a bit of an anti-pattern to me because it encourages hard-coding strings, so if you move, rename, or switch components around, it silently breaks. Unity's encouragement of pointers feels cleaner.
Godot has `@export`, but also `@export_multiline`, `@export_dir`, `@export_global_file`, etc. which produce slightly different behaviors. Unity supports true metadata through C# attributes (https://learn.microsoft.com/en-us/dotnet/csharp/advanced-top...) -- with all the power of C#, so you can freely add multiple attributes with parameters (which themselves are type-checked) and even program your own custom ones. You can add custom C# attributes, then use those attributes to drive the display of the inspector, which is a perfect little DSL solution that -- because of GDScript -- feels very far away from Godot at the moment.
Can you please elaborate what you mean by Unity "pointers"? As far as I am aware, in Unity, either you find the node by name via `GameObject.find` or you assign a reference via the inspector. Both of these features also exist in Godot. Actually, thanks to unique names (the `%` notation), I'd say Godot wins overall. But I haven't used Unity in years, so I don't know if they've come up with a better solution (in which case Godot should, obviously, copy it).
Just a reference in the Inspector. I like unique names too; I was just pushing on `$` specifically.
I think the concept of a game DSL is cool, but it just feels so undercooked to me.
Like, I'm a huge fan of gradual typing, especially TypeScript's, but gdscript's is just so primitive. Not even to speak of something like intersection or union types, even something basic like an interfaces mechanism is missing. has_method is an awful substitute - in general way too much relies on strings, making even simple refactoring a headache and breaks autocompletion. Lots of things also just aren't typable e.g. because generics are missing, pushing one to Variant. These aren't deal breakers, especially for the small-ish projects I've done, but it just feels bad.
A 'fully realized' version of gdscript would probably be great, but as is I'm just really not very fond of it and progress currently isn't exactly happening at a rapid pace (which is of course understandable).
Also - and this is definitely a lot more subjective - but I find its C++ FFI pretty ugly, even for basic stuff like working with structs. In theory using gsdcript as glue and C++ for the more core things would be a great approach (like unreal with its blueprints), but in practice I just want to avoid it as much as possible.