lua-users home
lua-l archive

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


So basicly the answer is no..

If i trusted the script writer, i wouldnt use scripts. then i would let the person write a dll. the reason for using lua is to create a sandbox environment. I dont want the script writer to be able to crash, nor hang the host program. The host program should have complete control of script execution.

I was thinking of using the script for the end user to impement unsupported behaviours, so its not a question of trust, because i dont yet have a clue who the script writers are. And the users should be able to create an infinite loop, just as long as it doesnt run away with the entire host thread..

I think your last idea is the best, just implement the needed features in Lua VM..


h





At 09:37 AM 7/8/2003 -0700, you wrote:
We have done extensive research and experiments with yielding from hooks in Lua 5. The bottom line is that this doesn't work reliably. Line hooks almost work with little massage. Count hooks are highly unreliable and produce all sorts of undesirable side effects. In all cases the main source of unreliability is that the return values are not handled properly. In the end we had to switch to using explicit yields in our scripts.

Lua is generally perceived (by me:)) as an application extension language. IMHO, it is a programming language, I can't speak Lua nor am I aware of anyone who can, can you?

I think if you are unloading script writing on someone, you already have some degree of trust in them. On the other hand, it would be trivial to add a little piece of code to Lua VM to detect a long running script and throw an assert, simply call *lua_error* or do something else of sorts.

AB

 -----Original Message-----
From:   Håkon Evensen [mailto:haakon.evensen@teletopia.no]
Sent:   Tuesday, July 08, 2003 2:07 AM
To:     Lua list
Subject:        Re: controlling lua from a c program

Thx..

But how do all people using lua solve this problem?  If i write a
singlethreaded game in c, and wants to use lua as scripting, i have to
trust whoever makes the scripts for the whole games mainthread not to hang
? Is lua a scripting or a programming language?  Shouldnt the
script<->mainprogram intergration almost be the most important property of
a script?

h

At 09:18 PM 7/7/2003 -0400, you wrote:

>Håkon Evensen wrote:
>>I want to execute a script but i dont want to leave the entire control of
>>the host thread in the hands of the script.   is it possible to set a
>>line hook and break further execution from there?
>
>It's messy and I wouldn't do it, but where there is a will there is a
>way.  Here are some references:
>
>http://lua-users.org/lists/lua-l/2003-04/msg00262.html
>
>http://lua-users.org/lists/lua-l/2003-04/msg00249.html
>