lua-users home
lua-l archive

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


On Mon, Aug 29, 2011 at 5:58 PM, Petite Abeille
<petite.abeille@gmail.com> wrote:
>
> On Aug 29, 2011, at 4:19 PM, Stefan Reich wrote:
>
>> In other words, we now have what is called "orthogonal persistence".
>
> Tangentially related... how does that relate to something like Pluto?
>
> "Pluto is a persistence library for Lua"
>
> http://lua-users.org/wiki/PlutoLibrary

Good question. Excellent question!

Currently, orthogonal persistence in Lua OS functions without an
actual persistence library. The trick is to just replay the exact
actions that created the original system state and thus arrive at a
copy of that state. The concept of sandboxes guarantees that no side
effects take place while replaying. Also, sandboxed code is always
deterministic. These two assertions are crucial to make the system
work.

Does anyone remember Prevayler ("Prevayler is not a database")? This
is the same thing - just way easier and more robust because the
sandboxes do all the work.

This approach works well, but it has the disadvantage of potentially
taking a lot of time if the session was long and much computation was
going on.

So eventually we'll want to add to this a checkpoint mechanism that
actually persists the system state's contents to disk.

Pluto could be good for this. I tried to use it for this purpose, but
I ran into a little problem.

Pluto refuses to persist C functions - but it doesn't tell me which
function was referenced (and where). So it's very hard to track the
problem down.

Either someone could improve Pluto's error messages (if that's
possible, not sure if the information is even available).

Or I find a way to solve this differently. I have some ideas.

Cheers,
Stefan