[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Simulating Lua states in Lua with only 250 lines of code
- From: Sean Conner <sean@...>
- Date: Fri, 26 Jun 2015 18:27:37 -0400
It was thus said that the Great Soni L. once stated:
>
> Lua States (from C) work well for sandboxing. I don't see why we
> SHOULDN'T have them available as coroutines. I believe the debug API
> should make Lua side just as powerful as C side (at least when it comes
> to VM interaction).
Then wrap Lua up into a module:
lua = require "lua"
L = lua.Lnewstate()
L:gc('stop')
L:Lopenlibs()
L:gc('start')
...
-spc (Or instead of the entirety of Lua, just enough to sandbox like you
can in C ... )