Online Octave Compiler

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Online Octave Compiler

Shanthi_Roy .
I would like to know if GNU Octave provides APIs to compile Octave code online .
I want to implement Octave online compiler in my website, so I'm trying to figure out a way to do this. Any help would be really appreciated.

These are some of the sites where I could find online Octave compilers. My requirement is very similar to these. 

Thanks


Reply | Threaded
Open this post in threaded view
|

Re: Online Octave Compiler

Oliver Heimlich
On 04.08.2018 14:18, Shanthi_Roy . wrote:

> I would like to know if GNU Octave provides APIs to compile Octave code
> online .
> I want to implement Octave online compiler in my website, so I'm trying
> to figure out a way to do this. Any help would be really appreciated.
>
> These are some of the sites where I could find online Octave compilers.
> My requirement is very similar to these. 
> https://www.jdoodle.com/execute-octave-matlab-online
> https://www.tutorialspoint.com/execute_matlab_online.php
> http://rextester.com/l/octave_online_compiler
>
> Thanks
It looks like you want an Octave interpreter, which runs Octave script
files.  This is easier than an interactive Octave interpreter (like
octave-online.net).

There is no ready to use API, which will give you the functionality seen
in the examples.  You will have to build the infrastructure and the API
around it yourself.

A simple approach would be to save the script file as a new m-file, run
octave on this file and then return the output. But be prepared that
this is not trivial (especially when you want to put this on a public
web page):
 - How can the backend be secured against malicious script files?
 - How to handle long running processes (timeouts, denial of service)?
 - How to handle graphics output?

An Octave package which gives you sort of an API ist the cgi package
(https://octave.sourceforge.io/cgi/). It could be used to receive the
script file as a POST parameter from an HTML form, run it with the eval
function, and return the result as plain text.

To protect your backend from malicious scripts, you could run Octave
inside isolated docker containers, but I have no practical experience in
doing this.

HTH,
Oliver




signature.asc (499 bytes) Download Attachment