It has been a while since my last report. In my last post, I've mentioned GDNative, but since I've done only a bunch of

GDScript progress report: Feature-complete for 4.0

submited by
Style Pass
2021-06-10 15:30:05

It has been a while since my last report. In my last post, I've mentioned GDNative, but since I've done only a bunch of "boring" stuff, I ended up not writing anything about it. Work on GDNative is not completed yet, so maybe I'll have something interesting to report later on. For now, let me show what was done on GDScript.

One of the most requested features of GDScript is now implemented: typed arrays. Now you can set the element type and let it be validated by the engine. That allows you to do safe operations with homogeneous arrays and also allow the language to optimize a few more code paths.

This allows you to easily change a regular array to typed and vice-versa without changing much code. You can also rely on type inference. If the array has elements of the same type, it will be inferred as typed:

Note that types that can't be validated at compile-time (when they are dynamic) will be validated at runtime, which might impact performance slightly if done regularly.

Leave a Comment