News for hackers. Stuff that matters.
Re:Lua in the Kernel? by DarkWiiPlayer on Friday September 18, 2020 @06:56AM (#24515202)
> This is the reason that game consoles disallow JIT-compilation - and hence games tend to use regular Lua rather than LuaJIT.

You can disable the JIT in LuaJIT and still get better performance because it's a different implementation of the VM.

> but I'd be surprised if it could prevent a script from running indefinitely.

You'd have to patch the standard library a bit to avid things like `string.find` causing trouble, but as far as core Lua features go, yes, you can do that and all you need is to install a debug hook (Preferably from C, because performance, but you can even do this 100% from within Lua)

-----

EDIT: Here's some benchmarks I did for this a while ago https://gist.github.com/DarkWiiPlayer/f639a38df53e39df63497c...

There are no comments on this comment yet.