I have a large Perl code base and I want to develop bindings of some description so it can be called from other systems on a local machine, in this case R.

What are good ways of approaching this problem? And is there prior art that I can adapt?

 

The reason for this is that a large chunk of the user base lives in R, and it is neither practical nor desirable to rewrite the system in R. I have a GUI system in place that hides all the coding but this obviously cannot be integrated with automated workflows for people who are comfortable coding.

My thinking at the moment is to wrap the Perl libraries in a local service via some front-end. The R end of the system can then send data and commands to it, and then receive results and metadata back. Ideally all the low-level stuff on the Perl side would be handled by an existing system, e.g., maybe something like Mojolicious. The aim is to have one Perl process per R session to avoid headaches with shared memory (unless there is a simple solution for that).

This needs to work on the main operating systems (Linux, Windows, Mac, BSD variants). The Perl side of things will be packed up using PAR::Packer.

And if you’re wondering about PDL, it is already in use for many of the analyses.


In reply to Calling perl systems from other systems, e.g. R by swl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.