[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: stop & continue lua code
- From: Peter Cawley <lua@...>
- Date: Wed, 30 Jun 2010 23:13:24 +0100
On Wed, Jun 30, 2010 at 11:07 PM, Ben R. <email@example.com> wrote:
> Hello all,
> Given any Lua program, I would like to build something that provides the
> next features:
> - "execute X steps" - runs the program for exactly X bytecode instructions,
> stops the execution and writes some output file.
> - "continue Y steps" - given some output file of the above feature,
> continues execution from step X till step Y (and outputs a new file if the
> program didn't end).
> Obviously, I'm ready to play with the VM code if needed..
> Currently I'm still thinking whether Lua is indeed suitable for that (it
> seems so), and I would be happy to hear any opinions or suggestions.
My initial thoughts would be:
1) debug.sethook to execute for X steps
2) Pluto (http://lua-users.org/wiki/PlutoLibrary) for writing Lua
state to file and then loading it back