From guillaume.yziquel at citycable.ch  Mon Nov 30 15:59:05 2009
From: guillaume.yziquel at citycable.ch (Guillaume Yziquel)
Date: Mon, 30 Nov 2009 15:59:05 +0100
Subject: [Rd] :Re:  PROTECT and OCaml GC.
In-Reply-To: <4B13D956.7030608@gmail.com>
References: <mailman.15.1259578805.1160.r-devel@r-project.org>
	<4B13D956.7030608@gmail.com>
Message-ID: <4B13DDB9.5060703@citycable.ch>

Laurent Gautier a ?crit :
> 
> It does not have to be a functional language.
> To see it in use within a some-language-to-R bridge, you can check the
> source in JRI, rpy2.
> I can mostly speak for rpy2, and the way it is done there relies on both 
> R and Python's GC. Creating a anonymous R object presented to the Python 
> world is first "R_preserved" (from garbage collection from R) then using 
> Python's reference counting mechanism, calling an "R_Release" whenever 
> the Python wrapper is available for garbage collection (in fact there is 
> a twist, but this is roughly the way it is working). In your case, 
> you'll use the OCaml GC system (and "R_release" the R object when its 
> OCaml representation is going for garbage collection).

For now, garbage collection is a secondary issue.

I would have been interested in a binding to a functional language to 
see exactly where you get a closure to closure mapping. That's why I was 
asking since that's what I'm foremost interested in.

>> By low-level, I mean a binding that takes hold of R objects without 
>> using symbols all over to reference them. (Using symbols in the
>> formals, the body or the environment of a closure is fine, for
>> instance, but I'd like to execute a closure directly, and eventually
>> be able to construct R closure from OCaml functions).
> 
> Rpy2 can do a lot of that, and probably so can JRI.

An anonymous closure to anonymous closure mapping? Could you point out 
where this is done exactly?

-- 
      Guillaume Yziquel
http://yziquel.homelinux.org/



[Rd] :Re: PROTECT and OCaml GC.
Guillaume Yziquel