Serializing functions?

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? :sob:
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

Thanks for your reply! I’m not too much of a stranger to compilers and VMs, and because of that, I would love to avoid them at all costs lol

No

Also no

You can make own interpeter tho.

1 Like

Lua bytecode interpreters could aid, I suppose.

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.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.