lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Jeff Koftinoff wrote:

But if you made the mini-lua grammar simple enough you could guarantee that there would be no possibility of infinite loops. A timeout is problematic in many ways! Please don't do things like that.

If you just restrict the grammar so that all loops have a fixed repeat count (non-variable) and no recursive function definitions are allowed then you don't need a sandbox and you don't need problematic halt-sensing and you can be guaranteed that the config file will never halt your process. I believe a system like this would be very very useful.

Would it really be useful?

I would still be possible to do loops which are not infinite,
but which would take 100000000000000000000000 years to complete.

In computer science sense these are of course completely different,
but in practice do you really care?


btw, Because Lua uses by default floating point values,
doesn't that mean that sufficiently large loop boundary
would cause an infinite loop as the loop increment gets
smaller than the "epsilon" of the loop variable.