From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 9DAE8BB83 for ; Fri, 23 Jun 2006 11:14:07 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k5N9E7hu030311 for ; Fri, 23 Jun 2006 11:14:07 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA16423 for ; Fri, 23 Jun 2006 11:14:06 +0200 (MET DST) Received: from quincy.inria.fr (quincy.inria.fr [128.93.8.52]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k5N9E6EY022537; Fri, 23 Jun 2006 11:14:06 +0200 Received: from [127.0.0.1] (quincy.inria.fr [128.93.8.52]) by quincy.inria.fr (Postfix) with ESMTP id 3C71111C430; Fri, 23 Jun 2006 11:14:06 +0200 (CEST) Message-ID: <449BB0C6.5040204@ensta.fr> Date: Fri, 23 Jun 2006 11:13:42 +0200 From: Michel Mauny Reply-To: Michel.Mauny@ensta.fr Organization: ENSTA User-Agent: Thunderbird 1.5.0.2 (X11/20060501) MIME-Version: 1.0 To: caml-list@inria.fr Cc: =?ISO-8859-15?Q?Gr=E9goire_Henry?= Subject: Typing unmarshalling without marshalling types Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 449BB0DF.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 449BB0DE.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; mauny:01 mauny:01 ensta:01 marshalling:01 marshalling:01 patched:01 ocaml:01 otherlibs:01 unmarshaling:01 patched:01 ocaml:01 toplevel:01 gregoire:01 marshal:01 marshal:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 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