Hi, I'm building an R package that uses Pascal executable files. I'm wondering if there are any problems associated with this as I haven't found any real resources on this type of project, as most R packages use C++. Are there any rules to be followed on how to architect the project, call my executables, etc? At the time of writing, I'm just calling executables from src/, depending on the user's operating system.
I have 2 compiled files (one for Windows and one for Unix) that work fine (the output of the program is to write a file, which I then parse with R).
I have the impression that what I'm doing is very ‘manual’ and perhaps not very intelligent. I'm not looking for exact explanations but rather advice on the direction to take and the resources to look for.
Not an expert, I can't advise much on the structure
Two clarifications needed: do you want to make the package available to others (e.g. on CRAN), and are you going to include the binary or the source code?
A source package if possible should not contain binary executable files: they are not portable, and a security risk if they are of the appropriate architecture. R CMD check will warn about them4 unless they are listed (one filepath per line) in a file BinaryFiles at the top level of the package. Note that CRAN will not accept submissions containing binary files even if they are listed.
For CRAN packages containing C/C++/Fortran, typically the package only contains the source, you don't distribute binaries. That means the user may need to compile the code during installation ( or the CRAN servers may also pre-compile). An example of not-officially-supported language used in some packages is Rust, there are some non-trivial aspects. For Pascal, I didn't really find cases of it being used in R packages, so you'd have to figure out a lot. My guess is that it's probably not feasible without a lot of work (or negotiation).
If, on the other hand, you are not submitting to CRAN, that shouldn't be a problem.