Using Xojo Shell as a Bash in order to a execute scripts.

Hello! I intend to use Xojo for my thesis project in the Computer Systems Engineering department. A Xojo web app will serve as a UI, that will execute scripts on a Linux Server (Fedora OS) and serve the answers as a graph and a bunch of data. The first task is the following:

I have a dataset in text format and I want to find the best fitting curve to fit the data. The fitting algorithms will be written in Octave (Matlab) or in a language like R / Python. Is it efficient enough to control the above scripts by using the Xojo Shell Object? By control, I mean executing a script and getting the result.

Further down the line, I have to feed the produced data (would be written to a file or a db) in another bash script (written in Fortran) and again get the result. This is why using the shell as an actual bash through Xojo is so vital to me.

We execute bash scripts all the time from Xojo console apps in our internal processes, so the answer to “can it do this” is definitely yes.

That said, Shell is not a terminal. It does not inherit any environment variables, nor does it run any login scripts so you’ll have to do all the setup work yourself. Oh, and if you have any long running scripts, I suggest doing this stuff asynchronously.

Here’s something else to think about… for performance sake (and if your license supports it) it may be beneficial to make a console helper app which is just for running shell scripts and communicates with the main app through an IPCSocket. This allows the shell instance to run on a separate cpu core than the main app although that’s up to the machine you’re running on.

xargs is supposed to multiprocess to many CPUs from a single thread. Haven’t tested it yet but will soon.
There is an I/O cost with serialised batch processes where data is fed from one program into another of course.