From: oleg@okmij.org
To: enrico.tassi@inria.fr
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Marshalling: automatic discard of unmashalable data via
Date: 22 Oct 2013 09:38:54 -0000 [thread overview]
Message-ID: <20131022093854.29319.qmail@www1.g3.pair.com> (raw)
In-Reply-To: <20131014153023.GA19032@birba.invalid>
> The system state is made of pretty much anything, and is also user
> extensible via plugins. Nothing prevents someone to stick in there
> values that can hardly be marshalled, like callbacks, file descriptors,
> lazy_t, and the like. Of course it is nice to be able to store
> callbacks or lazy values in the system state, so forbidding all that is
> not nice.
There is a similar problem when marshalling a captured delimited
continuation. The continuation captures a part of stack that points to
various closures in system libraries, which contain lots of
unserializable stuff. In addition, reference cells (t ref) can't be
meaningfully serialized as they are copied in the process of the
serialization, which breaks their semantics.
The library delimcc proposes a solution. Unlike your situation, I do
care to properly serialize `bad' value and properly restore. The
unmarshalled delimited continuation must work properly. I cannot
afford not to care what the unmarshalled value will look like.
The solution, which involves pre-processing a value before marshalling
and post-processing after unmarshalling, is described at
http://okmij.org/ftp/ML/ML.html#persistent-delim2cc
as well in Sec 8 of
http://okmij.org/ftp/continuations/caml-shift-journal.pdf
prev parent reply other threads:[~2013-10-22 9:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-14 15:30 [Caml-list] Marshalling: automatic discard of unmashalable data via ephemerons Enrico Tassi
2013-10-16 14:03 ` Jacques-Henri Jourdan
2013-10-16 14:42 ` Enrico Tassi
2013-10-16 15:30 ` François Bobot
2013-10-16 16:24 ` Alain Frisch
2013-10-22 9:38 ` oleg [this message]
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=20131022093854.29319.qmail@www1.g3.pair.com \
--to=oleg@okmij.org \
--cc=caml-list@inria.fr \
--cc=enrico.tassi@inria.fr \
/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