Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Julia to perform computations on a webpage

Tags:

julia

I was wondering if it is possible to use Julia to perform computations on a webpage in an automated way.

For example suppose we have a 3x3 html form in which we input some numbers. These form a square matrix A, and we can find its eigenvalues in Julia pretty straightforward. I would like to use Julia to make the computation and then return the results.

In my understanding (which is limited in this direction) I guess the process should be something like:

  • collect the data entered in the form
  • send the data to a machine which has Julia installed
  • run the Julia code with the given data and store the result
  • send the result back to the webpage and show it.

Do you think something like this is possible? (I've seen some stuff using HttpServer which allows computation with the browser, but I'm not sure this is the right thing to use) If yes, which are the things which I need to look into? Do you have any examples of such implementations of web calculations?

like image 727
Beni Bogosel Avatar asked Apr 19 '16 22:04

Beni Bogosel


1 Answers

If you are using or can use Node.js, you can use node-julia. It has some limitations, but should work fine for this.

Coincidentally, I was already mostly done with putting together an example that does this. A rough mockup is available here, which uses express to serve the pages and plotly to display results (among other node modules).

Another option would be to write the server itself in Julia using Mux.jl and skip server-side javascript entirely.

like image 54
ARM Avatar answered Nov 07 '22 16:11

ARM