I am making an operating system game and I am trying to figure out any shortcuts before I force myself to make a VM for my own bytecode lang for internal applications.
…
So is it possible in any way to serialize and deserialize luau functions?
If it comes down to it, loadstring can be part of this process.
You can use sandbox feature and allow loadstring to be used.
You can use RemoteFunctions/Events to call API althrough that a server side only.
I made a post about that Modding in your expirience! (And game script communication)
Althrough if you want 100% control you probably have to write VM/modify someone else’s VM
You would likely only need to keep the bytecode you compile from the LBI and run it through. Unless you want to keep the source code and use loadstring directly, although that will only work on the server (and not on the client), and you would be weakening security further (not like it matters anyway, if by the looks you’re doing this stuff only yourself, and third-party user code will never be involved).
There are a few flavours for VMs; IIRC, there was SLVM; however I’m not sure if Liker’s still maintaining it.