Skip to content
Prev 58940 / 63424 Next

some questions about R internal SEXP types

On 9/8/20 11:47 AM, Dan Kortschak wrote:
I am not sure if I understand correctly, but if you were accessing 
directly the memory of SEXPs from Go implementation instead of calling 
through exported access functions documented in WRE, that would be a 
really bad idea. Of course fine for research and experimentation, but 
the internal structure can and does change at any time, otherwise we 
would not be able to develop nor maintain R. Such direct access 
bypassing WRE would likely be a clear case for rejection in CRAN for 
this interface and any packages using it, and I hope in other package 
repositories as well.

However, I believe the overhead of calling the C-level access functions 
R exports should be minimal compared to other overheads. You can't hope, 
anyway, for being able to efficiently call tiny functions frequently 
between Go and R. This can only work for bigger functions, anyway, and 
then the Go-C overhead should not be important.
Sure, I think it is perfectly fine to cover only a subset, if that is 
already useful to write some extensions in Go. Maintenance would be 
easiest if Go programs didn't call back into the R runtime at all, so 
fewer calls the better for maintenance.

Best
Tomas