oracle / fastr

A high-performance implementation of the R programming language, built on GraalVM.
Other
626 stars 64 forks source link

Using foreign objects in R #82

Open rbotafogo opened 5 years ago

rbotafogo commented 5 years ago

Hello,

I know I have seen the documentation on how to access foreign objects from R, for instance, how to access a Ruby object from R. I remember something like foreign_object$method(...) would work, but I can't find this documentation any more. Can you please provide me with the link to it? And maybe make it accessible from the R docs in graalvm?

Thanks!

steve-s commented 5 years ago

Hello Rodrigo,

there is a section on interoperability, but what you mention is not documented there in detail. We will improve it. Most of the time we try to match what would seem "natural". Few examples on top of my head:

rbotafogo commented 5 years ago

Thanks Stepan,

I´ll go with, but I´m pretty sure having seen some docs somewhere. Maybe some hard to find links that could just be made more explicit. Anyway, I guess most of the info is in your answer.

Em qui, 30 de mai de 2019 às 08:37, Stepan Sindelar < notifications@github.com> escreveu:

Hello Rodrigo,

there is a section on interoperability https://www.graalvm.org/docs/reference-manual/languages/r/#interoperability, but what you mention is not documented there in detail. We will improve it. Most of the time we try to match what would seem "natural". Few examples on top of my head:

  • foreign_object$foo(...) - invoke method "foo" of object "foreign_object"
  • foreign_object[index] - read array element(s)
  • foreign_function(...) - execute foreign function
  • foreign_object$bar - read field bar of object "foreign_object"

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/oracle/fastr/issues/82?email_source=notifications&email_token=AA6QP4MO2DQVTDKNOOLJLILPX636PA5CNFSM4HQGTW6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWSDKGI#issuecomment-497300761, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6QP4I6LP5RXFOPLFCVJG3PX636PANCNFSM4HQGTW6A .

-- Rodrigo Botafogo