From guillaume.yziquel at citycable.ch  Sun Nov 22 01:44:22 2009
From: guillaume.yziquel at citycable.ch (Guillaume Yziquel)
Date: Sun, 22 Nov 2009 01:44:22 +0100
Subject: [Rd] R strings, null-terminated or size delimited?
In-Reply-To: <4B0884DC.5010203@stats.uwo.ca>
References: <4B0857DB.8060606@citycable.ch>	<22C4DF66-C380-4922-AAD0-3D274CBDC9E0@r-project.org>
	<4B08784C.8040507@citycable.ch> <4B0884DC.5010203@stats.uwo.ca>
Message-ID: <4B088966.70704@citycable.ch>

Duncan Murdoch a ?crit :
>>
>> I believe I should. I'd like the OCaml / R binding to be closely knit 
>> to R internals. One reason would be for speed, the other being that 
>> I'd like to make use of camlp4 to write syntax extensions to mix OCaml 
>> and R syntax. It's therefore important for me not to rely on the R 
>> interpreter to be active when building R values. Or when marshaling R 
>> values via OCaml. There are numerous other issues aside this one.
> 
> You are probably not going to be able to do that.  Take your example of 
> the promise below:  to evaluate a promise, you need to evaluate the 
> expression attached to it in the R interpreter.  (This is discussed in 
> the R Language Definition.)
> 
> You can put probably put together simple R objects like integer arrays 
> without having R running, but anything substantial isn't going to be 
> feasible.
> 
> Duncan Murdoch

That's precisely the issue. I want to map a functional language to a 
functional language. And keep the same evaluation semantics. I do not 
(yet?) see why it should not be feasible.

If this is done properly, OCaml could then compile R code natively. That 
would be really nice. There would be other advantages in integrating the 
two languages cleanly.

So, taking the example of promises, I need to map it to its OCaml 
semantic equivalent, which seems to be a Lazy.t structure. That doesn't 
seem (yet) unfeasible.

Thank you for your pointer to the R Language Definition. Starting by R 
Internals was perhaps a bit brutal.

All the best,

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



[Rd] R strings, null-terminated or size delimited?
Guillaume Yziquel