From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 84CB0BBC1 for ; Fri, 28 Mar 2008 13:03:31 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlUCAJF77EfAbSoIiGdsb2JhbACRMwEBAQ8mmTo X-IronPort-AV: E=Sophos;i="4.25,569,1199660400"; d="scan'208";a="24298387" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail4-smtp-sop.national.inria.fr with ESMTP; 28 Mar 2008 13:03:31 +0100 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from einhorn.in-berlin.de (localhost [127.0.0.1]) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id m2SC3Unk003329 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 28 Mar 2008 13:03:30 +0100 Received: (from www-data@localhost) by einhorn.in-berlin.de (8.13.6/8.13.6/Submit) id m2SC3URe003327 for caml-list@yquem.inria.fr; Fri, 28 Mar 2008 13:03:30 +0100 X-Authentication-Warning: einhorn.in-berlin.de: www-data set sender to oliver@first.in-berlin.de using -f Received: from dslb-088-073-089-114.pools.arcor-ip.net (dslb-088-073-089-114.pools.arcor-ip.net [88.73.89.114]) by webmail.in-berlin.de (IMP) with HTTP for ; Fri, 28 Mar 2008 13:03:30 +0100 Message-ID: <1206705810.47ecde9222d8e@webmail.in-berlin.de> Date: Fri, 28 Mar 2008 13:03:30 +0100 From: Oliver Bandel To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] The Bridge Pattern in OCaml References: <4a051d930803190929q60d31012kb6c9d2b03a2d2ca6@mail.gmail.com> <891bd3390803191907q5838ee66u83cb35e549805af0@mail.gmail.com> <200803281206.30620.micha-1@fantasymail.de> <1206703811.47ecd6c379853@webmail.in-berlin.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.6 X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Spam: no; 0.00; bandel:01 in-berlin:01 ocaml:01 bandel:01 in-berlin:01 serialize:01 o'caml:01 marshalling:01 serialize:01 ocaml:01 beter:98 wrote:01 oliver:01 oliver:01 caml-list:01 Zitat von Jim Farrand : > On 28/03/2008, Oliver Bandel wrote: > > It seems that you already know, what things you > > want to write to the files > > No. > > The opposite in fact. I want to be able to serialize things I (the > framework designer) never even thought of. I want the users of my > framework to have maximum flexibility to implement whatever behaviour > they like, without restricted them to the things I thought of putting > into the file format. [...] OK, so I misunderstood your needs. sorry, I didn't read the thread completely and just jumped in. > > O'Caml marshalling is in the right direction (take any closure and > serialize it, this is very flexible in this respect), but it is far > to > restricted in other ways to be of use (file format tied to particular > executable). OK. Marhsal-module is nice, but there are disadvantages: if the marshalled data is loaded but was corrupted, this can crash your program! So I would never recommend to use it. It also possibly could be a security hole, when using that module. Another reason why I would never recommend it's usage. Beter write your own implementation of the serialization on top of OCaml, without of Marhsalling-module (which is too deep inside the internals of Ocaml, and therefore make things possibly unreliable!). Ciao, Oliver