Dear Yves, dear Raphael
Thank you both for your informative reply (I just looked up what
marshalling is..).
Perhaps I should be more specific what my problem is. I regularly
store (large) composite Oz value (actually, objects) in files. I
usually translate them to textual Oz code which on feeding results in
the original data. However, I understand that I cannot translate
certain data such as (dynamically created) procedures or classes back
into their Oz source. If their would be any reflective programming
trick in Oz by which I could do this than then would solve my problem.
I can, however, pickle procedures and then within my Oz code file
which represents the data then load this pickle. Now, I want to make
sure I don't loose this data with new Oz versions. So, pickle2text /
text2pickle would help me here -- thanks for pointing that out.
The problems I reported were caused in other situations, but the
scenario sketched above is actually my main concern. So, I only want
to make sure that data I am now creating in Mozart 1.4.0, I will be
able to read in future versions of Mozart. Reading pickles created
with new versions in an old version is not required.
On Mon, Mar 2, 2009 at 9:24 AM, Yves Jaradin
<[email protected]> wrote:
An option for converting old pickles is probably to pass them by the
text pickle format (using the old pickle2text and the new text2pickle)
which is supposedly more robust to version changes.
Thanks for pointing me to pickle2text / text2pickle. I would like to
try these out -- could you please also point my to their
documentation. All I found so far on pickling is
- the tutorial chap "Pickles for Persistent Data Structures"
http://www.mozart-oz.org/documentation/apptut/node5.html#chapter.pickle
- The reference "Persistent Values: Pickle"
http://www.mozart-oz.org/documentation/system/node57.html#chapter.pickle
pickle2text / text2pickle are also not exported by the functor Pickle...
On Mar 2, 2009, at 9:34 AM, Raphael Collet wrote:
If I am not mistaken, all the stateless entities that can be copied
across sites are pickled just like in Mozart 1.3.2. So I think
that the pickler in Mozart 1.4.0 is able to unpickle pickles made
with Mozart 1.3.2.
It appears this is not the case. Here is the error message which I
get when trying to load a pickle functor compiled with Mozart 1.3.*
into Mozart 1.4.0.
%***************** Error: distributed programming ***************
%**
%** Version mismatch during loading of pickle
%**
%** File: '/path/to/my/file'
%** Expected: '4#0'
%** Got: '3#3'
%** Pickle version 3#3 corresponds to Oz version: '1.3.0'
%** In statement: {<P/2 URL.load> '#'('/' [85 115 101 114 115]
'/' [116] '/' [111 122] '/' [109 117 115 105 99] '/' [83 116 114 97
115 104 101 101 108 97] ,,,) _}
%**
%** Call Stack:
%** procedure 'Meth_load' in file "/Users/bmejias/Mozart/mozart-1-4-x/
mozart/share/lib/init/Resolve.oz", line 61, column 3, PC = 5022388
%** procedure 'Do_Method' in file "/Users/bmejias/Mozart/mozart-1-4-x/
mozart/share/lib/init/Resolve.oz", line 87, column 3, PC = 5023784
%**--------------------------------------------------------------
Thank you very much!
Best
Torsten
--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-586219
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de
On Mar 2, 2009, at 9:34 AM, Raphael Collet wrote:
On Mon, Mar 2, 2009 at 9:24 AM, Yves Jaradin
<[email protected]> wrote:
Torsten Anders a écrit :
Hi,
On Aug 19, 2008, at 10:24 AM, Torsten Anders wrote:
On Aug 19, 2008, at 9:39 AM, Yves Jaradin wrote:
Torsten Anders a écrit :
Are the pickles of Mozart 1.3.* and 1.4.* incompatible?
Yes they are incompatible.
I have been repeatedly been bitten by this issue meanwhile. Is
there any design reason for this incompatibility?
Partially.
The marshaller is common to the pickling subsystem and the
distribution subsystem. Because of the large changes in the
distribution subsystem in 1.4.0, the marshaller version had to be
bumped wich, as a side effect, made the pickles incompatible. I
think most, if not all, 1.3.2 pickles could be used in 1.4.0 if it
wasn't for the format version (two bytes in the first few of the
pickle). But the other way there will be some problems (e.g. if you
pickled sites).
To be more precise, both the marshaler and the pickler share a
common code base. They essentially differ on how they handle
language entities that may have a distributed behavior: variables,
stateful entities, stateless entities that are not copied across
sites.
If I am not mistaken, all the stateless entities that can be copied
across sites are pickled just like in Mozart 1.3.2. So I think
that the pickler in Mozart 1.4.0 is able to unpickle pickles made
with Mozart 1.3.2. The other way around is not possible, though.
Someone should check the code to validate this statement, and maybe
relax the version compatibility test to allow it. (I vaguely
remember to have tried it, but could not find any trace.)
However, the marshaler is not backward-compatible, and should not
be. This is because the distribution layer is completely
different. The marshaling has been redesigned from scratch to cope
with the new distribution features (different protocols, new
distributed garbage collectors, different coordination architecture).
Cheers,
raph
<ATT00001.txt>
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users