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 TAA11539; Wed, 6 Feb 2002 19:36:38 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 TAA11967 for ; Wed, 6 Feb 2002 19:36:37 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g16Iaan16251; Wed, 6 Feb 2002 19:36:36 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA12764; Wed, 6 Feb 2002 19:36:36 +0100 (MET) Date: Wed, 6 Feb 2002 19:36:36 +0100 From: Xavier Leroy To: Frederic Tronel Cc: caml-list@inria.fr Subject: Re: [Caml-list] Classes and marshaling Message-ID: <20020206193636.A12420@pauillac.inria.fr> References: <3C5EAF9B.E0B25E1@inrialpes.fr> <3C5FD0DE.9E3913FB@inrialpes.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <3C5FD0DE.9E3913FB@inrialpes.fr>; from Frederic.Tronel@inrialpes.fr on Tue, Feb 05, 2002 at 01:32:30PM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Is it possible to serialize an object ?? Currently not. > After having taken a look at the source code (byterun/extern.c), it > seems that caml value tagged with Object_tag (that is object) are > simply ignored (an exception is raised). They are not ignored, but rejected :-) > Is there any chance to see object serialization being implemented in > the near future ?? Object serialization, like function serialization, is quite a challenge. One can either send the code for the object's methods, so that it can be read back anywhere -- but OCaml's code is not relocatable enough to allow this; or one send the object's instance variables only, and add various mechanisms to ensure that the method code at the receiving end is compatible with that at the sender -- but no such really good mechanism exist (witness Java's serialization). So, we're thinking about it, especially in the context of JoCaml (a distributed programming language based on Caml), but don't hold your breath. In the meantime, I'd recommend either serializing objects "by hand" (via methods that write the object's state), or converting between your objects and a pure datatype that you can then read and write efficiently with output_value and input_value. - Xavier Leroy ------------------- 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