From: Alex Mizrahi
Subject: persistence in lisp
Date: 
Message-ID: <30ugknF34chu9U1@uni-berlin.de>
Hello, All!

i want state of my data to be persistent - system should be able to restore
itself after reboot, but without hassle like keeping data in relational db
(one of reasons i do it in lisp is because i don't want to use relational
db - i just want to use some classes/structs and work with them).
it's not hard to do save and load functions for my data, but since lisp
supports reflection, it would be nice if it will do serialization code
itself.
i've looked through CL-PREVALENCE lib. there is serialization code, but
transaction stuff isn't what i want - i'll have to rewrite lot of code to do
that transactions..

are there better solutions?

i think in following direction - each setter function should work like a
transaction in CL-PREVALENCE - it should write changed value into log
(surely it can be optimized - all changes could be written when system goes
into some consistent state), and sometimes it does full snapshots. after
reboot it could load latest snapshot and apply logged setters.
as for me it looks ok except it doesn't work with direct slot access.
is there anything like this already implemented?

With best regards, Alex Mizrahi.

From: Gisle Sælensminde
Subject: Re: persistence in lisp
Date: 
Message-ID: <slrncqkool.69v.gisle@kaktus.ii.uib.no>
On 2004-11-28, Alex Mizrahi <········@hotmail.com> wrote:
> Hello, All!
>
> i want state of my data to be persistent - system should be able to restore
> itself after reboot, but without hassle like keeping data in relational db
> (one of reasons i do it in lisp is because i don't want to use relational
> db - i just want to use some classes/structs and work with them).
> it's not hard to do save and load functions for my data, but since lisp
> supports reflection, it would be nice if it will do serialization code
> itself.
> i've looked through CL-PREVALENCE lib. there is serialization code, but
> transaction stuff isn't what i want - i'll have to rewrite lot of code to do
> that transactions..
>
> are there better solutions?

For this very purpose I have used to dump an image of the current running lisp
that I then restarts upon reboot, but that may not be what you want.

-- 
Gisle S�lensminde, Phd student, Scientific programmer
Computational biology unit, University of Bergen, Norway
Email: ·····@cbu.uib.no | Complicated is easy, simple is hard.
From: Camm Maguire
Subject: Re: persistence in lisp
Date: 
Message-ID: <54r7m8u25e.fsf@intech19.enhanced.com>
Greetings!

Many systems likely have the equivalent, but in GCL, the exact running
memory image is dumped to disk when evaluating (si::save-system
"new_image").  The resulting file is an ordinary executable which,
when run, will reproduce the state of memory precisely where you left
off.  Thanks to emacs' unexec.

Take care,

Gisle S�lensminde <·····@kaktus.ii.uib.no> writes:

> On 2004-11-28, Alex Mizrahi <········@hotmail.com> wrote:
> > Hello, All!
> >
> > i want state of my data to be persistent - system should be able to restore
> > itself after reboot, but without hassle like keeping data in relational db
> > (one of reasons i do it in lisp is because i don't want to use relational
> > db - i just want to use some classes/structs and work with them).
> > it's not hard to do save and load functions for my data, but since lisp
> > supports reflection, it would be nice if it will do serialization code
> > itself.
> > i've looked through CL-PREVALENCE lib. there is serialization code, but
> > transaction stuff isn't what i want - i'll have to rewrite lot of code to do
> > that transactions..
> >
> > are there better solutions?
> 
> For this very purpose I have used to dump an image of the current running lisp
> that I then restarts upon reboot, but that may not be what you want.
> 
> -- 
> Gisle S�lensminde, Phd student, Scientific programmer
> Computational biology unit, University of Bergen, Norway
> Email: ·····@cbu.uib.no | Complicated is easy, simple is hard.

-- 
Camm Maguire			     			····@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah
From: Gabor Melis
Subject: Re: persistence in lisp
Date: 
Message-ID: <fb0fb805.0411290758.149261b6@posting.google.com>
"Alex Mizrahi" <········@hotmail.com> wrote in message news:<···············@uni-berlin.de>...
> Hello, All!
> 
> i want state of my data to be persistent - system should be able to restore
> itself after reboot, but without hassle like keeping data in relational db
> (one of reasons i do it in lisp is because i don't want to use relational
> db - i just want to use some classes/structs and work with them).
> it's not hard to do save and load functions for my data, but since lisp
> supports reflection, it would be nice if it will do serialization code
> itself.
> i've looked through CL-PREVALENCE lib. there is serialization code, but
> transaction stuff isn't what i want - i'll have to rewrite lot of code to do
> that transactions..
> 
> are there better solutions?
> 
> i think in following direction - each setter function should work like a
> transaction in CL-PREVALENCE - it should write changed value into log
> (surely it can be optimized - all changes could be written when system goes
> into some consistent state), and sometimes it does full snapshots. after
> reboot it could load latest snapshot and apply logged setters.
> as for me it looks ok except it doesn't work with direct slot access.
> is there anything like this already implemented?
> 
> With best regards, Alex Mizrahi.

I also looked at cl-prevalence and found it inadequate for my purposes
because of the everything should fit into memory assumption.

The best I've found so far is elephant
http://common-lisp.net/project/elephant/ it is not very intrusive,
does not tend to contaminate much of the code and supports transparent
persistency of clos objects, does not keep the whole db in memory. It
has nice transaction support but leeks storage since db gc is not yet
implemented.

Cheers, G�bor
From: Robert Strandh
Subject: Re: persistence in lisp
Date: 
Message-ID: <6w3bythwva.fsf@serveur5.labri.fr>
"Alex Mizrahi" <········@hotmail.com> writes:

> Hello, All!
> 
> i want state of my data to be persistent - system should be able to restore
> itself after reboot, but without hassle like keeping data in relational db
> (one of reasons i do it in lisp is because i don't want to use relational
> db - i just want to use some classes/structs and work with them).
> it's not hard to do save and load functions for my data, but since lisp
> supports reflection, it would be nice if it will do serialization code
> itself.
> i've looked through CL-PREVALENCE lib. there is serialization code, but
> transaction stuff isn't what i want - i'll have to rewrite lot of code to do
> that transactions..
> 
> are there better solutions?

Probably not yet, but we are working on one.  I have a student (not
mine, actually) working on implementing an EROS-like single-level
store as a unix process.  When that work is done, it will be possible
to turn your machine off and still get your data (and code) back from
a previous consistent state.  

-- 
Robert Strandh