To be clear about my need: I would like to be able to just stop executing code through the vm,
then store somewhere the state of the vm so that I can reload it later.
This mean that the whole execution context have, indeed, to be kept in the serialized form.
I already know that I can have the scripts store “to be saved” values in my own objects exposed to the scripts, but I would like to simplify this process if possible, so that nothing special have to be done on the script side if it wants to build up script-local data.
Of course this is a major “it would be very useful but it’s ok without it for now” kind of feature.
From the current code (I just looked quickly at it) it seems possible but maybe it’s tricky if the c++ code is modified or if it needs to be cross-platform.
Ideally yes. Actually, in my current game I wouldn’t use such feature if it didn’t work across platforms.
I believe it should be doable as long as we don’t necessarily need a compressed or crypted serialized format, utf-8 text would be enough and the user code can still crypt/compress if he wants.
Yes it’s enough for now, though the feature I suggest would be a major next-step over this.
I don’t have a complete detailed understanding of ChaiScript because I didn’t use it in a big project yet but want to do that soon, so any help with this point is useful at least to me.
I don’t have much time these days unfortunately (I must go forward with that game…) but I will submit something if I end up finding time, I can’t just promise anything right now.
I believe for this particular point, if Boost was a required dependency, I would just replaced any set or map usage by boost’s flat_map/set, they have the same interface. I believe that it’s not hard to reproduce a simple equivalent though, they are just sorted vectors.
Haha don’t, ChaiScript looks very promising to me, so I point to it as much as I can (among other things though)
By the way, the Chimera author (working at Sony) asked on twitter for such a script language and I pointed to ChaiScript. It looked very promising to him, the only issue was lack of feedback from actual commercial projects having used ChaiScript. Do you have any such feedback? We couldn’t find any online.