caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jeremy Yallop <jeremy.yallop@ed.ac.uk>
To: Joel Reymont <joelr1@gmail.com>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] ANN: pretty-printing, type-safe marshalling, dynamic typing for free.
Date: Wed, 20 Jun 2007 11:27:52 +0100	[thread overview]
Message-ID: <46790128.6090104@ed.ac.uk> (raw)
In-Reply-To: <AB56B84F-A45E-433B-B419-2B49F5D92043@gmail.com>

Joel Reymont wrote:
> 
> On Jun 20, 2007, at 1:14 AM, Jeremy Yallop wrote:
> 
>> Serialisation (marshalling):
>>
>>    Shelve.shelveS<point tree> points
>>    =>
>> "\007\003\t\128\128\128\128\128\128\128\248?\t\128\128\128\128\128\128\128\128@\001\000\005\000\001\008\000\001\n\001\003\004\t\003\000\001\012\001\003\006\011\005\005\002\002\000\002\000\002\002\000\000\002\001\001\002\002\002" 
>>
> 
> Aha! Now I can implement a Sexp library for 3.10!
> 
> What is the difference between pickling and shelving, though?

In `deriving' Pickle is a fairly naive value-oriented serialiser.  It 
doesn't do any structure sharing: the same value can be repeated several 
times in the output.  It doesn't preserve cycles, so it's not available 
for mutable values.  You can customize Pickle by writing your own 
definition for a particular type.

Shelve handles cycles correctly and minimises values so the output is 
potentially much smaller.  It also provides a different means of 
specialization: by giving a custom definition of equality for a type you 
can increase opportunities for sharing.  It's currently rather slow for 
large values, but I expect that to change in the next release.  Shelve 
is built on top of Pickle, FWIW.

The choice of names is pretty arbitrary: I wrote Pickle first, then I 
needed another name when I wrote Shelve.

Jeremy.


  parent reply	other threads:[~2007-06-20 10:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-20  0:14 Jeremy Yallop
2007-06-20  8:01 ` [Caml-list] " Nicolas Pouillard
     [not found] ` <AB56B84F-A45E-433B-B419-2B49F5D92043@gmail.com>
2007-06-20 10:27   ` Jeremy Yallop [this message]
2007-06-20 18:28     ` Stefan Monnier
2007-06-20 19:38       ` [Caml-list] " Jeremy Yallop
2007-06-20 21:06         ` Eric Cooper
2007-06-21  7:37           ` Nicolas Pouillard
2007-06-22  0:05             ` Jeremy Yallop
2007-07-15  4:03 ` [Caml-list] " Jon Harrop
2007-07-17  3:05   ` Jon Harrop
2007-07-19  0:20     ` Jeremy Yallop
2007-07-20  6:24       ` Jon Harrop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46790128.6090104@ed.ac.uk \
    --to=jeremy.yallop@ed.ac.uk \
    --cc=caml-list@inria.fr \
    --cc=joelr1@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).