Profile image

Defining procedures in FT

6,220 11qazxc  11 months ago

It was like 5 months since my last actual craft, and i kinda lost that feeling of bleeding edge, so i'd like to talk about new tech.
To be precise i was making wrappers for FT and came to a problem.

So, here's my concept:
For each procedure there's a queue and a list;
When something calls procedure it pushes args one-by-one, then some id to queue;
When proc is executed, it reads args from queue and shifts queue down. If it needs to return something, it fills list with id and whatever's returned

It allows to invoke procedure more than one time per frame, and if id is unique for each call it allows to wait until procedure will be executed, read returned values and then do something with them.

The problem is that queue and list aren't primitive types (and in fact aren't types at all), so appending takes as many setters as maximum length of list + one for current length, same for shifting.

So, maybe someone can come up with something that doesn't have such problem?

smooth-based memory block can fit in two or three setters, but it can either read or write single value at a time, and therefore it's not possible to move all values in single physics frame.

If you wish to point at one of real-life calling conventions, read this line again: in FT you can't allocate or free any memory; seems like in FT any stored value is float; in FT you can assign values by name only, and you can not use saved value as name.
upd: i misspelled queue as query, sorry