perbone / luascript

Lua language support for Godot Engine
Apache License 2.0
633 stars 45 forks source link

Questions and Feature Request #8

Closed ghost closed 4 years ago

ghost commented 4 years ago

I plan on using this module to produce a sandboxed computer programming environment, much like ComputerCraft.

I have managed to compile the module on my Mac OSX Mojave. Currently I am in the process of trying to load a preloaded lua script from my GDScript Commands script (for testing to make sure it works).

My question is, can I sandbox the Lua code (as I plan on having this run server side) and is there a feature to where I can execute Lua directly from GDScript much like how GDScript Expressions work? Also, can I sandbox Lua in this module with something like whitelisting functions?

If not, I would like to put in a feature request to be able to do these two things! 😊

Thanks! I appreciate your work!

ghost commented 4 years ago

I decided to look at the source code to figure out how to load a LuaScript from GDScript and I found that the code isn't even remotely ready for use with how I intend to use it.

I will be watching to repo for its progress as this looks promising and I like the way it is set up as a modules instead of a GDNative library.

https://github.com/perbone/luascript/blob/cfe7423f2500239409b151c5c1d8d2f79b3e7c3b/lua_script.cpp#L146-L150

perbone commented 4 years ago

Hi @alex-evelyn

So as you already figured out the project is in its infancy and to be useful for the use case you presented it has a long way ahead.

About some of your questions, I think there will be some kind of sand box in place, although I'm not sure yet how it will play out. Some of the constraints will be enforced automatically by the use of Godot's internal API and some will be Lua's own sand box.

Thanks for your interest