[Rd] RCC compatibility patch

John Garvin garvin at rice.edu
Sat Oct 2 03:08:21 CEST 2004


Would you consider the following patch to eval.c to allow compatibility 
with RCC? (It's in the applyClosure function.)

@@ -432,6 +432,14 @@
      SEXP f, a, tmp;
      RCNTXT cntxt;

+#ifdef RCC
+    SEXP comp;
+    PROTECT(comp = getAttrib(op, install("RCC_CompiledSymbol")));
+    if (comp != R_NilValue)  /* compiled version exists */
+      op = comp;
+    UNPROTECT(1);
+#endif /* RCC */
+
      /* formals = list of formal parameters */
      /* actuals = values to be bound to formals */
      /* arglist = the tagged list of arguments */

RCC (http://hipersoft.cs.rice.edu/rcc/) is a static compiler for R we're
working on at Rice. It compiles R scripts into dynamic libraries that can
be loaded from within R using the dyn.load function.

This change enables compiled R code to be executed while retaining full
correctness; i.e., inspection and modification of closures generated by
RCC will work exactly as in interpreted R. This patch does not change
the existing implementation in the default build; when enabled, it should
not affect the evaluation of any R code except code compiled with RCC.

John



More information about the R-devel mailing list