Re:Draft of OCaml Scientific Computing book
by mseri on Wednesday August 26, 2020 @10:27AM
(#24282765)
Indeed! There are already OCaml bindings for many R and python packages in the opam repository (opam is the package manager for ocaml), as well as C and fortran libraries. Similarly there are now a few packages to interact with rust. I think, right now, only a library to interact with julia is missing.
Re:Draft of OCaml Scientific Computing book
by 7thaccount on Thursday August 27, 2020 @08:49AM
(#24293121)
I said it earlier, but if I have to call R from another language, in most cases I'd rather just use R by itself.
Of course there are reasons why you might integrate the two. Perhaps you have an R expert doing the statistics work and the back end developer gluing everything together. That's fine, but at some point the system becomes pretty confusing and is a giant leaky abstraction.
But you should be able to call those languages from OCaml. For instance, RInside
https://cran.r-project.org/web/packages/RInside/index.html
lets you call R from any language with a C FFI. A very simple solution (even if not quite as convenient as a full OCaml solution) that lets someone write OCaml if that's their preferred language. I helped add that functionality to RInside and I've been doing that for years so I can use D for my research.