I’ve been working on a new networked application in Ruby that heavily uses
Ruby’s internal Marshaling for inter-node communication. I’d like to
better understand the issues involved in that design decision and would
like your input.
Basically my question is:
How stable can one expect the marshaling format itself to be?
The risc with my application is that a future version of the system uses a
new/later Ruby version. If the latter uses a different Marshaling
format old installments of the app might not be able to communicate
with newer versions.
Ok, I hear you scream YAML/Syck and/or XML already but I don’t feel it
should be needed here where readability is not a requirement, marshaling
is very fast and compact (ok, ok “premature optimization”…), and its
easier since Marshal is in core Ruby (ok, ok both yaml and rexml now in
the core install).
One interesting “data point” would be to know if/when/how the marshal
format has changed in the past. Have it been changed so that older
marshaled object couldn’t be read back? What is the likelihood of that
happening again? Matz?
Basically my question is:
How stable can one expect the marshaling format itself to be?
[snip]
One interesting “data point” would be to know if/when/how the marshal
format has changed in the past. Have it been changed so that older
marshaled object couldn’t be read back? What is the likelihood of that
happening again? Matz?
My impression is that it’s not stable across
versions. There have been times I had to re-run
a generator to create a new marshal file.
But I don’t have any specific data to back that
up, sorry.
Hal
···
----- Original Message -----
From: “Robert Feldt” feldt@ce.chalmers.se
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Wednesday, June 18, 2003 12:30 AM
Subject: Stability of Marshaling format
In message “Stability of Marshaling format” on 03/06/18, Robert Feldt feldt@ce.chalmers.se writes:
Basically my question is:
How stable can one expect the marshaling format itself to be?
The format last changed on Sep. 2 2002. I have no specific plan to
change the format in the future. Instead, I have reluctance to change
it, since any minor upgrade may cause dRuby to fail.
Would including readers for older marshal formats somewhere in the
distribution make sense? I can definitely imagine scenarios where my
marshalled data might outlive my ruby version.
Basically my question is:
How stable can one expect the marshaling format itself to be?
The format last changed on Sep. 2 2002. I have no specific plan to
change the format in the future. Instead, I have reluctance to change
it, since any minor upgrade may cause dRuby to fail.
Or better yet (perhaps), an “on-the-fly” converter of older formats to
the newer format.
···
On Wednesday, June 18, 2003, at 01:55 PM, Martin DeMello wrote:
[snip]
Would including readers for older marshal formats somewhere in the
distribution make sense? I can definitely imagine scenarios where my
marshalled data might outlive my ruby version.
On Wednesday, June 18, 2003, at 01:55 PM, Martin DeMello wrote:
Would including readers for older marshal formats somewhere in the
distribution make sense? I can definitely imagine scenarios where my
marshalled data might outlive my ruby version.
Or better yet (perhaps), an “on-the-fly” converter of older formats to
the newer format.
On Wednesday, June 18, 2003, at 01:55 PM, Martin DeMello wrote:
Would including readers for older marshal formats somewhere in the
distribution make sense? I can definitely imagine scenarios where my
marshalled data might outlive my ruby version.
Or better yet (perhaps), an “on-the-fly” converter of older formats to
the newer format.
I’m unconvinced this is better - we don’t want to encourage data to hang
around in the old format, after all.
Is there currently a ‘format version’ field recorded with the
object somewhere? That lets future generations decide for you.
“never put off till tomorrow what you can dump on your grandchildren”
–
What garlic is to salad, insanity is to art.
Rasputin :: Jack of All Trades - Master of Nuns
How about a callable method that will read from the old format, when
encountered, and write back in the new format (a permanent conversion)
so that initially there is a conversion load that decreases as more
marshalled objects are encountered. One could also have an option to
permanently convert all marshalled objects that can be found at a
particular time to the new format. I’m assuming that, because this is
for a networked application, that all marshalled objects may not be
simultaneously available and that there may be so many marshalled
objects that one would want to defer conversion until necessary. I’m
also assuming that the newer format has been adopted because it
provides superior features justifying the resources used to convert
formats. If not, one could just make sure that the older format is
available to the application (although this may not be a trivial thing
to do).
···
On Wednesday, June 18, 2003, at 03:36 PM, Martin DeMello wrote:
[snip]
Or better yet (perhaps), an “on-the-fly” converter of older formats to
the newer format.
I’m unconvinced this is better - we don’t want to encourage data to
hang
around in the old format, after all.
which indicates that the first byte is the major rev number and the 2nd
one is the minor rev number. Looking a bit further indicates that the 3rd
byte seems to be used to indicate class of the object => nil/true/false
need only three bytes to be uniquely spec’ed. Looking even further (ok
last time ;)) reveals that Marshal.load bails out if major rev is not same
as the expected one or if minor is higher than expected one.
Would be interesting to know how many minor rev’s there has been for the
major rev numbers before 04?
On Wednesday, June 18, 2003, at 01:55 PM, Martin DeMello wrote:
Would including readers for older marshal formats somewhere in the
distribution make sense? I can definitely imagine scenarios where my
marshalled data might outlive my ruby version.
Or better yet (perhaps), an “on-the-fly” converter of older formats to
the newer format.
I’m unconvinced this is better - we don’t want to encourage data to hang
around in the old format, after all.
Is there currently a ‘format version’ field recorded with the
object somewhere? That lets future generations decide for you.
On Wednesday, June 18, 2003, at 01:55 PM, Martin DeMello wrote:
Would including readers for older marshal formats somewhere in the
distribution make sense? I can definitely imagine scenarios where my
marshalled data might outlive my ruby version.
Or better yet (perhaps), an “on-the-fly” converter of older formats to
the newer format.
I’m unconvinced this is better - we don’t want to encourage data to hang
around in the old format, after all.
Is there currently a ‘format version’ field recorded with the
object somewhere? That lets future generations decide for you.
which indicates that the first byte is the major rev number and the 2nd
one is the minor rev number. Looking a bit further indicates that the 3rd
byte seems to be used to indicate class of the object => nil/true/false
need only three bytes to be uniquely spec’ed. Looking even further (ok
last time ;)) reveals that Marshal.load bails out if major rev is not same
as the expected one or if minor is higher than expected one.
Would be interesting to know how many minor rev’s there has been for the
major rev numbers before 04?
Regards,
Robert
MOD PARENT UP +5 nformative
… uhm… wrong forum, ignore me…
/Anders
–
dc -e
4ddod3dddn1-89danrn10-dan3+ann6dan2an13dn1+dn2-dn3+5ddan2/9+an13nap