From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p1AAhRks016191 for ; Thu, 10 Feb 2011 11:43:27 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai4BAANQU02LEwExe2dsb2JhbACXTo4dFQEBFiIFH6w4AY1pBYVci30 X-IronPort-AV: E=Sophos;i="4.60,451,1291590000"; d="scan'208";a="87779867" Received: from hera.mpi-sb.mpg.de ([139.19.1.49]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 10 Feb 2011 11:43:21 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mpi-sb.mpg.de; s=mail200803; h=Message-ID:In-Reply-To: References:Date:Subject:From:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=GZf7++6rIYP0EEfEB4CRA3IfKna/+KaX5l BvgZludLE=; b=mgSqYxa+0yllgl57pFGXrM2DITIVGCoQMPGdZXAEK94yPbjQM5 v5mvG89iKIt6RFqupQ+oWfDhYazzLteFHEiOwcm0PMkY5RAad3r19OmaxIbSpYKA BYYsJNDPF8Y/L29/U3ZmzVPWM/7SEGsy/KQxakJCkDcw29K82lbidM/BQ= Received: from infao0710.mpi-klsb.mpg.de ([139.19.1.27]:40853 helo=zak.mpi-klsb.mpg.de) by hera.mpi-sb.mpg.de (envelope-from ) with esmtp (Exim 4.69) id 1PnTzY-0007Bf-0z; Thu, 10 Feb 2011 11:43:18 +0100 Received: from local by zak.mpi-klsb.mpg.de (envelope-from ) with local (Exim 4.69) id 1PnTzX-0004bN-GR; Thu, 10 Feb 2011 11:43:15 +0100 Received: from 74.125.57.233 (SquirrelMail authenticated user rossberg) by mail.mpi-sws.org with HTTP; Thu, 10 Feb 2011 11:43:15 +0100 (CET) Message-ID: <0161c25695dd28a84238010d94e8166d.squirrel@mail.mpi-sws.org> In-Reply-To: <20110210095043.E9EE817196@Adric.ern.nps.edu> References: <20110210095043.E9EE817196@Adric.ern.nps.edu> Date: Thu, 10 Feb 2011 11:43:15 +0100 (CET) From: rossberg@mpi-sws.org To: oleg@okmij.org Cc: la@iki.fi, caml-list@inria.fr User-Agent: SquirrelMail/1.4.15 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [Caml-list] Re: Closure marshalling inconsistency Oleg wrote: > > Lauri Alanko wrote: >> Marshalling closures with references to globals is precarious >> business. > > Indeed. I would not blame OCaml though: OCaml serialization functions > (when invoked with the right flags) ensure the preservation of sharing > of components _within_ a serialized value. There are no guarantees > about the preservation of sharing _between_ separately serialized > values. The documentation explicitly says so: ``Sharing between values > marshaled by successive calls to Marshal.to_channel is not detected, > though.'' That is, if v1 and v2 share a component, the results of > pickling/unpickling v1 and separately v2 may not share the component. True, but I think Lauri complains about a slightly different issue, namely sharing inconsistencies between a _single_ marshalled value and the program environment. Or in other words, that the language does not actually define what it means to be "_within_ a serialized values", nor implements it consistently. There are obvious ways in which this could be made coherent, but they are likely to be difficult to implement as an afterthought. > I might agree that this is a bug -- but not that it is a bug in > OCaml. I might agree with the argument that it is a global mutable > variable that is the bug, in programmer's code. He he. That sounds like an entirely un-MLish kind of argument. The language has undefined and incoherent semantics? Of course, it's the programmer's mistake to expect otherwise! ;) /Andreas