Post

gdscript as a language is like... weird its elegance comes from how nicely it integrates with Godot, like the dedicated syntax for signals, exports, custom node types, etc. but elsewhere, there are so many papercuts and seemingly missing features that it feels awkward to write at times

no keyword arguments - feels puzzling that one wouldn't take one of the best features from its primary source of inspiration, Python no structs/record/dataclass equivalent - tiny small-scope well-typed structures are still best made with class definitions and verbose Java-style constructor init

and the big one: the type system on the positive, it's nice that it has good inference (usually) and runtime validation. I'm glad it exists, and I'd rather have what's here than have nothing. but what's here is rather... frustrating

map/filter/reduce - you'll run into problems 95% of the time using these functions because lambdas are not well-typed. map and filter don't narrow the type of array items, so you need to awkwardly and unsafely cast the resulting array a lot of the time

`is` doesn't narrow variable types... kind of? if you write this: if item is Actor and item.on_stage: the `item` variable isn't narrowed after `and`, but with this: if item is Actor: if item.on_stage: you get autocomplete, but the type is still seemingly unchanged? scary and confusing

... so the soundest way to check a casted type is this: var actor := item as Actor if actor and actor.on_stage: actor becomes null at runtime if it's not an instance of Actor i honestly don't hate this behavior, but the verbosity vs. what could be a simple narrowed check is not great

no generics! while Array and Dictionary (only recently, but thank god) can be generic, you cannot have custom generic classes or types, and generic _functions_ are nonexistent they needed to add lerpi and lerpf for ints and floats respectively because lerp is untyped and also works on vectors. ugh

no null safety! and it's honestly a miracle i can even overlook this in practice; it feels like a step 10 years backwards that still baffles me. be simple and pragmatic, sure, but most null-safe type systems, even if not perfectly so, have solutions for making null safety seamless and helpful now

"just use C#/Rust/(my favorite objectively perfect language here)!" lol sure if i want to deal with sub-par engine integration, friction with translating from gdscript, and a tangled toolchain amalgamation with sluggish build times, like the babel/webpack days in JS land

but even if that wasn't the case, it's still frustrating because GDScript is _so close_ to being great. and it's not even tiny nitpicks, or maybe it is? but they're constantly present in frequent, basic usage. and like... it makes me feel like I'm using the language wrong? or something

0 reposts3 likes

It always felt a little weird to look at for me, and part of that might just be that I never really used Python or other languages like it. So I just stuck with C# when using Godot.

When I know all the API calls I need to make with C# it's great, but sometimes the Godot Docs only give you GDScript variable names and I find myself needing to do some insane searching just to find out what to do.