[ANN] JuliaConnectoR v1.0.0

Greetings to all Julia and R users!

I would like to announce that the JuliaConnectoR R package has reached version 1.0.
It is available from CRAN and GitHub.

The goal of the package is to make it convenient to access functionality from Julia (packages) in R.

The JuliaConnectoR has already been available on CRAN from version 0.6. The new version 1.0 does not introduce any breaking changes. But it contains one bigger new feature, which is, that multiple R processes can connect to a single Julia process. This is useful for saving Julia startup/precompilation time when calling functions asynchronously in R, e.g., via futures/promises. It also allows to share a global state in Julia between asynchronous calls from R to Julia. Accessing a single Julia session from multiple R sessions becomes possible because the communication is based on TCP and the Julia TCP server can handle multiple clients asynchronously.

Otherwise, the new version number should indicate the stability of the package and its interface.

If you are interested, you might also want to take a look at the article, which covers the basic functionality of the package, or its documentation. There has also been a talk at JuliaCon 2020, which covers the basic features.

11 Likes

Could you say a bit about how this package relates to the JuliaCall package?

The JuliaConnectoR is an independent approach for integrating Julia in R. We started it because we were not satisfied with the stability of JuliaCall. This has improved greatly but the more ambitious goal of JuliaCall to connect R and Julia via the C interface still results in many rough edges.
The way of connecting via TCP, as the JuliaConnectoR does, allows a very stable experience. It also allowed to put more efforts in features for convenient interactive use, which are not available in JuliaCall.
There is also more detailed information about this in the article, which compares the JuliaConnectoR to JuliaCall and also to XRJulia as a third contender.

5 Likes

Great, thanks! I hope I’ll never be in the situation to have to do the main bit of my work in R and call out to Julia, but if it happens I’ll give this a try!

2 Likes

Thanks for your work. Just curious: if we are working locally with both Julia and R, then to call a Julia function with a vector argument in R, the following steps have to be executed: serialize the vector into binary data in R → send the data via TCP → deserialize the data into a vector in Julia, right?

If the vector is huge, then the above steps may be expensive. Is there a way to share data without copying on a local PC?

Yes, the data is serialized. It is serialized in the most efficient binary form, but it still needs to be copied and written/read via TCP.
Via the JuliaConnectoR, R and Julia cannot share data in memory. This would require interfacing at the level of C interfaces. The advantage of the looser coupling via TCP is that this can be more stable and can be maintained more easily across versions. It also allows some features, such as getting standard output/standard error output, which you can’t get when connecting via the C interface. You have to check for your use case whether the speed is sufficient for you.

1 Like