I can compile a shared library for use in C using an example from stack overflow (questions/32916684). My question, is it possible to have variables persist or data persist between cyrstal lang function calls from the main c program. Obviously I could return them and then pass them back in, as a comprise.
I ask as I can do this with graalvm with static variables, as the VM is initiated by
graal_create_isolate() and then graal_tear_down_isolate(). Static variables in the Java native shared library persist as long as graal_tear_down_isolate() is not called.
Maybe it isn’t possible as there is no VM in a crystal lang compiled shared library only a runtime.