Version française
Home     About     Download     Resources     Contact us    
Browse thread
Custom blocks and finalization
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dr. Thomas Fischbacher <t.fischbacher@s...>
Subject: Re: [Caml-list] Custom blocks and finalization
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