Fork me on GitHub
#babashka
<
2022-01-07
>
grumplet10:01:22

I have a need to interop with R code in order to test a cljs implementation of a statistical model generated by R. I’ve seen @gigasquid’s 2016 presentation on using GraalVM for this, but I was wondering whether this remains the best starting point? I’m asking on this channel because there’s plenty of Graal expertise here! :)

borkdude10:01:29

@grumplet We also have a #graalvm channel, but I'd be happy to answer it here in a 🧵

borkdude10:01:56

What you have to do is use the GraalVM JVM and then use the polyglot API

borkdude10:01:21

Of course you could also shell out to an existing R environment if the above is too complicated.

☝️ 1
grumplet10:01:25

OK thanks. I think that is the approach that gigasquid took too.

grumplet10:01:50

One problem is that I need to test a cljs implementation rather than a clj one. Not really a problem unless I have to change the code under test too much.

borkdude10:01:29

you can run the javascript compiled by CLJS in a polyglot engine too

borkdude10:01:35

and the R code too, and you can then compare the results

grumplet10:01:43

That’s more than I expected! Will go play. Thank you!

grumplet10:01:06

Ah I should have checked for a graalvm channel first!

borkdude10:01:30

See reactions in thread.

kbaba100122:01:13

I noticed that pop! doesn't work in Babashka, so I made a pull request https://github.com/babashka/sci/pull/658

👏 1
borkdude22:01:49

Pushed to babashka as well. New binary should appear in #babashka-circleci-builds soon

❤️ 1
borkdude22:01:06

actually they are published here too: https://github.com/babashka/babashka-dev-builds and you can use the install script to get it locally

borkdude22:01:16

(when the build is done)

❤️ 1