caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Michel Mauny <Michel.Mauny@ensta.fr>
To: caml-list@inria.fr
Cc: "Grégoire Henry" <gregoire.henry@pps.jussieu.fr>
Subject: Typing unmarshalling without marshalling types
Date: Fri, 23 Jun 2006 11:13:42 +0200	[thread overview]
Message-ID: <449BB0C6.5040204@ensta.fr> (raw)

Dear all,

We are pleased to announce a patch for Objective Caml that provides
type safe unmarshalling functions. In short, the main features are:

  - a type for type representations ('a tyrepr, a singleton type)

  - unmarshalling functions like the following:

       SafeUnmarshal.from_string:  'a tyrepr -> string -> int -> 'a

such that

       SafeUnmarshal.from_string ty str off

returns the value whose marshal is the string str (starting at offset
off) and gives it the type (represented by) ty, if possible. If the
value cannot be of type ty, the function fails.

For instance,

       SafeUnmarshal.from_string  [^ ( float *  int ) ^] str 0

asks the (memory representation of the) unmarshalled value to be
compatible with the type (float * int).

  - there is no type information in the marshalled data: marshalling
functions are not modified by this patch.

  - classical (unsafe) unmarshalling functions are still available.

The easiest way to obtained a patched version of OCaml is to download:

  http://www.pps.jussieu.fr/~henry/marshal/src/make_source_tree.sh

and to execute the following sequence:

./make_source_tree.sh ocaml-ty && cd ocaml-ty && ./configure && make world &&
make -C otherlibs/safe_unmarshaling top

The last command of the sequence runs the patched OCaml toplevel.

More information at:

  http://www.pps.jussieu.fr/~henry/marshal/

Have fun,

-- Grégoire Henry and Michel Mauny



             reply	other threads:[~2006-06-23  9:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-23  9:13 Michel Mauny [this message]
2006-06-27 18:11 ` [Caml-list] " Aleksey Nogin
2006-06-27 18:44   ` brogoff
2006-06-28 21:05 ` Jonathan Roewen
2006-06-28 21:20   ` Jonathan Roewen
2006-06-28 22:19     ` skaller
2006-06-28 22:27       ` Jonathan Roewen
2006-06-28 23:17         ` skaller

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=449BB0C6.5040204@ensta.fr \
    --to=michel.mauny@ensta.fr \
    --cc=caml-list@inria.fr \
    --cc=gregoire.henry@pps.jussieu.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;
as well as URLs for NNTP newsgroup(s).