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

Guillaume Yziquel guillaume.yziquel at citycable.ch
Sun Nov 22 01:44:22 CET 2009


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/



More information about the R-devel mailing list