https://github.com/duncantl/RLLVMCompile
Raw File
Tip revision: 7fad5bd394a6f74ace0f6053a5d08e4f15cf3a1f authored by Duncan Temple Lang on 07 March 2017, 00:49:31 UTC
correct name for variable
Tip revision: 7fad5bd
Python

Write a function in R (that involves loops)

Have it take a vector of doubles and a length.

Compile it to LLVM

Then pass this to Python

If python is embedded in R or vice versa with Rpy2, then 
call the routine directly.  Pass reference to routine or module
and then allow Python call that.

If don't have two interpreters in same process, export the compile
routine to a file and allow Python to import it. Then call.

Work with NumPy strides, etc.




Lazy evaluation:
Example: 

f = function(x, y)
{
  g()
}

g = function(z, a)
{
  z
  a
}
back to top