PlanetJava
Custom Search

java-vm-languages
[Top] [All Lists]

Re: Re: new milestone build for Renjin - R for the JVM

Subject: Re: Re: new milestone build for Renjin - R for the JVM
Date: Mon, 16 May 2011 10:02:31 +0200
On 05/13/2011 05:46 PM, Alexander Bertram wrote:
Hi Rémi,
Thanks for taking a look!
I see now that you're right about the example with runif(). To be
honest, I have more questions about compilation then running code at
this point. I'm reading Modern Compiler Implementation by Appel and
have started building the IRFactory, but R's lazy-non-pure-call-by-
need-semantics-with-higher -order-functions are a bit dizzying for a
compiler-novice like myself. I think i'm going to start with a subset
of the language while finishing the interpreter and base library. Any
pointers to good resources or good example code? (I'm taking a look at
your PHP reboot now...)
PHP.reboot is not the best language to see how to implement
lambda/high order function with side effects.
I've designed the language in the opposite way as usual,
instead of thinking about the expressiveness of the language,
I've designed it with the compiler in mind, i.e to be easily compiled
in raw bytecodes (at runtime).
So all elements of the language are type-checkable, use pass-by-value semantics and the language has no reflection over the stack values, no globals, no weird scope rules, etc.
What I was alluding to in the presentation is a way to run existing R
code on very large datasets -- though this would definitely not the
default behavior. The language offers a really nice abstract view of
data -- every value in the language is vector, and operations on
vector values work as they should (e.g. sum(1:100^2+3) ). The current
R interpreter implements these operations on vectors with arrays and
pointer arithmetic, limiting the size of the data you can work with to
what you can fit in memory. (You could of course read files
sequentially, but then R sort of looses its charm)
In Renjin, everything is implemented against an interface, Vector,
which is by default implemented with an array, but could also be
implemented by some new SqlResultSetDoubleVector that accesses values
from a database or some cloud-based storage on demand.
Ok, cool.
Best,
Alex
cheers,
Rémi
On May 12, 9:27 pm, Rémi Forax<[email protected]>  
wrote:
On 05/12/2011 02:17 PM, Alexander Bertram wrote:
Hi all,
I'm posting a new milestone build for Renjin, a pure java
implementation of an R-language interpreter. There's still a long way
to go to implementing the base library (huge), but this latest build
is complete enough to correctly load and execute external packages
written in R.
http://code.google.com/p/renjin
If there are any R developers/users in the group it would be great to
get feedback!
Best,
Alex
Hi Alex,
I had myself to figure how to call some programs written in R from the JVM,
it was not a pleasant trip so I'm a big supporter of your work.
I've read your 
presentation:http://caes.ewi.utwente.nl/External/NLFP/Slides/Session-2/AlexanderBe...
and I have some questions:
It seems that your implementation requires to store objects on the
Google cloud,
it's cool for a prototype but having a predefined way to execute any R
functions
in memory is must have from my point of view.
Also, for your second examples of functions that you don't want to compile,
the function can be easily transformed to something more appealing
if the compiler transforms the code to introduce
a 'else' branch that guarantee that x is always a local variable.
f<- function() {
    if(runif()>  0.5) x<- 5
    else x<- x_from_global_scope
    ...
}
cheers,
R mi
--
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to 
jvm-languages-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en.
msgmiddle
<Prev in Thread] Current Thread [Next in Thread>
Current Sitemap | © 2012 planetjava | Contact | Privacy Policy