[graalvm-users] Calling Ruby from R

Stepan Sindelar stepan.sindelar at oracle.com
Mon Oct 1 09:22:05 PDT 2018

Hi Rodrigo, 

this looks like a bug on FastR side. We are working on a fix. Thank you for reporting it. 


----- Original Message ----- 
From: rodrigo.a.botafogo at gmail.com 
To: graalvm-users at oss.oracle.com 
Sent: Friday, September 28, 2018 6:08:59 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna 
Subject: [graalvm-users] Calling Ruby from R 

Making a small change on the previous code where 'ruby_obj$to_s()' is changed to 'ruby_obj at to_s()' 

rf = Polyglot.eval("R", <<-R) 
function(ruby_obj) { 
ruby_obj at to_s(); 

h = [1, 2, 3, 4] 
puts h 


The result: 

[polyglot value] 
[1] 1 2 3 4 
Error in ruby_obj at to_s : 
trying to get slot "to_s" from an object of a basic class ("integer") with no slots 

An error occurred while loading ./specs/tmp.rb. 
Failure/Error: rf.call(h) 

Error in ruby_obj at to_s : 
trying to get slot "to_s" from an object of a basic class ("integer") with no slots (RError) 
from com.oracle.truffle.r.runtime.RErrorHandling.errorcallDfltWithCall(RErrorHandling.java:573) 
from com.oracle.truffle.r.runtime.RErrorHandling.errorcallDflt(RErrorHandling.java:494) 
from com.oracle.truffle.r.runtime.RError.error0(RError.java:275) 
from com.oracle.truffle.r.runtime.RError.error(RError.java:194) 
from com.oracle.truffle.r.runtime.nodes.RBaseNode.error(RBaseNode.java:358) 
from com.oracle.truffle.r.nodes.access.AccessSlotNode.getSlot(AccessSlotNode.java:87) 
from com.oracle.truffle.r.nodes.access.AccessSlotNodeGen.executeAndSpecialize(AccessSlotNodeGen.java:132) 
from com.oracle.truffle.r.nodes.access.AccessSlotNodeGen.executeAccess(AccessSlotNodeGen.java:91) 
from com.oracle.truffle.r.nodes.builtin.base.Slot.getSlot(Slot.java:157) 
from com.oracle.truffle.r.nodes.builtin.base.SlotNodeGen.executeAndSpecialize(SlotNodeGen.java:66) 
Translated to internal error 


Rodrigo Botafogo 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/graalvm-users/attachments/20181001/eaccfbd2/attachment.html 

More information about the GraalVM-Users mailing list