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=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 9106DBC37 for ; Thu, 30 Apr 2009 20:18:20 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlsBADeI+UmYToBnlGdsb2JhbACWagEBAQEJCwgJEQW5ToN/BQ X-IronPort-AV: E=Sophos;i="4.40,274,1238968800"; d="scan'208";a="27056895" Received: from mailgate2.iss.soton.ac.uk ([152.78.128.103]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Apr 2009 20:18:19 +0200 Received: from UOS-MSG00010-SI.soton.ac.uk (uos-msg00010-si.soton.ac.uk [152.78.119.33]) by mailgate2.iss.soton.ac.uk (8.13.8/8.13.4) with ESMTP id n3UIGHG8031636 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Thu, 30 Apr 2009 19:18:02 +0100 Received: from alpha.sesnet.soton.ac.uk (152.78.96.56) by smtp.soton.ac.uk (152.78.119.33) with Microsoft SMTP Server id 8.1.291.1; Thu, 30 Apr 2009 19:17:21 +0100 Received: from [127.0.0.1] (localhost [127.0.0.1]) by alpha.sesnet.soton.ac.uk (Postfix) with ESMTP id 20DCA153590; Thu, 30 Apr 2009 19:17:21 +0100 (BST) Message-ID: <49F9EB30.5090302@soton.ac.uk> Date: Thu, 30 Apr 2009 19:17:20 +0100 From: "Dr. Thomas Fischbacher" User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Markus Mottl Cc: OCaml List Subject: Re: [Caml-list] Custom blocks and finalization References: In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: Pass (UOS-MSG00010-SI.soton.ac.uk: domain of t.fischbacher@soton.ac.uk designates 152.78.96.56 as permitted sender) receiver=UOS-MSG00010-SI.soton.ac.uk; client-ip=152.78.96.56; helo=alpha.sesnet.soton.ac.uk; X-ISS-MailScanner-Information: Please contact Serviceline@soton.ac.uk for more information X-ISS-MailScanner: Found to be clean X-ISS-MailScanner-SpamCheck: X-Spam: no; 0.00; markus:01 mottl:01 ocaml-team:01 restrictive:01 c-library:01 callbacks:01 ocaml:01 ocaml:01 vice-versa:01 finalizer:01 arises:01 detour:98 closures:01 closures:01 wrote:01 Markus Mottl wrote: > Otherwise, it might be helpful if the OCaml-team could consider > whether this situation can be improved. For example not being allowed > to register/unregister roots to values seems overly restrictive, since > global roots (e.g. for protecting OCaml-callback closures) sometimes > need to be associated with C-values (e.g. for allowing some external > C-library to efficiently perform callbacks into OCaml). I would just like to point out that the OCaml/Python based "nmag" (/"nsim") MPI-parallel micromagnetic simulator does this a lot, and it is actually needed for a seamless vice-versa integration of Python/Caml closures (i.e. one can freely call Python closures from within OCaml, and OCaml closures from within Python.) I think we could change this in such a way that registering the finalizer is done by a detour through OCaml wherever the problem arises, but it just feels very wrong to do so, somehow... -- best regards, Thomas Fischbacher t.fischbacher@soton.ac.uk