From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA01165; Mon, 20 Aug 2001 11:12:57 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA01163 for ; Mon, 20 Aug 2001 11:12:56 +0200 (MET DST) Received: from pochi.inria.fr (pochi.inria.fr [128.93.8.128]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f7K9Cq909188; Mon, 20 Aug 2001 11:12:53 +0200 (MET DST) Received: (from mentre@localhost) by pochi.inria.fr (8.11.1/8.10.0) id f7K9Cqu23765; Mon, 20 Aug 2001 11:12:52 +0200 X-Authentication-Warning: pochi.inria.fr: mentre set sender to David.Mentre@inria.fr using -f To: Brian Rogoff Cc: caml-list@inria.fr Subject: Re: [Caml-list] Segfault in a native code multi-threaded program References: From: David Mentre Date: 20 Aug 2001 11:12:52 +0200 Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Brian Rogoff writes: > > > > > > It would be very nice to be able to rely on Marshal as safely as on [...] > > > > A more type safe marshaling framework is way up there on my list of > desired enhancements. I think this will be part of the extensional > polymorphism enhancements that you can see now in G'Caml. In my opinion, they are two different kinds of marshaling that one could expect: the safe one and the correct one. Supose that I have : type t = A | B of int | C of float To be safe is just to ensure that if I marshal a B(3), then if I receive a B(2.6) it will raise an exception. In other words, the marshaled data structure should contain enough information to ensure that once unmarshaled, it won't trigger a segfault. That's all. Basically, it means to encode in some way the type constructor of sent data structure (in my example, something like (type t: first: nothing; second: int; third: float)), and to check those constructors at unmarshaling time. The correct encoding is of course to ensure that the A of my program is the same A of the .mli you are using to send to me a data structure. It is of course much more difficult. I have probably missed something on the difficulty of marshaling. I tried to look at the mailing list archive, but did not find out the relevant messages. Any pointer? Best regards, d. -- David.Mentre@inria.fr Opinions expressed here are only mine. ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr