I am considering using GDNative to help with performance issues with part of my code. However, I am handling some pretty complex data structures, and I'm wondering how feasible it will be for me to use a low level language like C or possibly Rust to work with those structures.
It would be difficult for me to go into detail on what exactly I'm doing, but a minimal example would be the following. Let's assume I have a script called
data.gd with the following code:
var foo = 6
var bar = "baz"
And then I have another script called
structure.gdwith the following code:
var data_preload = preload("res://data.gd")
var data_list = 
for i in range(0, 20):
var tmp = data_preload.new()
tmp.foo = i
(I am aware that
class_name is now a syntax. However, if possible, I'd like to accomplish this with the current
Now I want to make a GDNative module that might, for example, have a function that takes an instance of
structure.gd as an argument, loops through
data_list and sums up all of the
foos, and then return the sum. What type should I give to the argument, what type should I give to the return type, and how should I access the properties of
Any help is appreciated.