This is a simple function that generates a compiled
routine that we can call to invoke the native routine.
We can already do this with rdyncall
or Rffi
. However, this is another
approach that uses LLVM.
It is not clear we actually need this. We can call existing routines directly (except with ...) via .llvm. See the example on the Function page.
createProxy(name, returnType, types = list(), id = sprintf("r%s", name),
mod = Module(name), ee = ExecutionEngine(mod),
env = globalenv(), sym = getNativeSymbolInfo(name)$address, ...)
the name of the routine to which we are interfacing
the return type of the routine to which we are interfacing
the parameter types of the target routine
the name of the R routine
the LLVM module in which to create the routine
the LLVM execution engine
the environment for the R function
the address of the routine to which we are interfacing
additional arguments
The compiled routine that calls the native routine.